Return-Path: X-Original-To: apmail-sling-commits-archive@www.apache.org Delivered-To: apmail-sling-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E3A3D918 for ; Wed, 22 Aug 2012 07:00:02 +0000 (UTC) Received: (qmail 41356 invoked by uid 500); 22 Aug 2012 07:00:02 -0000 Delivered-To: apmail-sling-commits-archive@sling.apache.org Received: (qmail 41257 invoked by uid 500); 22 Aug 2012 07:00:01 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 41239 invoked by uid 99); 22 Aug 2012 07:00:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2012 07:00:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Aug 2012 06:59:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id D61E523889B8; Wed, 22 Aug 2012 06:59:14 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1375907 - /sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/JSONObjectTest.java Date: Wed, 22 Aug 2012 06:59:14 -0000 To: commits@sling.apache.org From: fmeschbe@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120822065914.D61E523889B8@eris.apache.org> Author: fmeschbe Date: Wed Aug 22 06:59:14 2012 New Revision: 1375907 URL: http://svn.apache.org/viewvc?rev=1375907&view=rev Log: Add test case validating "null" values can be used Modified: sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/JSONObjectTest.java Modified: sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/JSONObjectTest.java URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/JSONObjectTest.java?rev=1375907&r1=1375906&r2=1375907&view=diff ============================================================================== --- sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/JSONObjectTest.java (original) +++ sling/trunk/bundles/commons/json/src/test/java/org/apache/sling/commons/json/JSONObjectTest.java Wed Aug 22 06:59:14 2012 @@ -49,4 +49,12 @@ public class JSONObjectTest extends Test } } + public void testNull() throws JSONException { + JSONObject obj = new JSONObject(); + obj.put(KEY, JSONObject.NULL); + + TestCase.assertTrue(obj.has(KEY)); + TestCase.assertTrue(obj.get(KEY).equals(null)); + TestCase.assertEquals("{\"" + KEY + "\":null}", obj.toString()); + } }