incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
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 GMT
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());
+    }
 }



Mime
View raw message