jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1153123 - in /jackrabbit/sandbox/microkernel/src: main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java test/java/org/apache/jackrabbit/mk/json/JsonBuilderTest.java test/java/org/apache/jackrabbit/mk/json/JsopTest.java
Date Tue, 02 Aug 2011 13:45:14 GMT
Author: thomasm
Date: Tue Aug  2 13:45:13 2011
New Revision: 1153123

URL: http://svn.apache.org/viewvc?rev=1153123&view=rev
Log:
JsopBuilder append bugfix

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsonBuilderTest.java
    jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java?rev=1153123&r1=1153122&r2=1153123&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/json/JsopBuilder.java
Tue Aug  2 13:45:13 2011
@@ -37,7 +37,6 @@ public class JsopBuilder {
      */
     public JsopBuilder append(String string) {
         buff.append(string);
-        needComma = false;
         return this;
     }
 

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsonBuilderTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsonBuilderTest.java?rev=1153123&r1=1153122&r2=1153123&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsonBuilderTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsonBuilderTest.java
Tue Aug  2 13:45:13 2011
@@ -40,7 +40,7 @@ import static junit.framework.Assert.ass
 
 public class JsonBuilderTest {
 
-    @Test 
+    @Test
     public void jsonBuilder() throws IOException {
 
         StringWriter sw = new StringWriter();
@@ -121,8 +121,12 @@ public class JsonBuilderTest {
             this.objectBuilder = objectBuilder;
         }
 
-        public void startJSON() throws ParseException, IOException {}
-        public void endJSON() throws ParseException, IOException {}
+        public void startJSON() throws ParseException, IOException {
+            // ignore
+        }
+        public void endJSON() throws ParseException, IOException {
+            // ignore
+        }
 
         public boolean startObject() throws ParseException, IOException {
             if (currentKey != null) {

Modified: jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java?rev=1153123&r1=1153122&r2=1153123&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
(original)
+++ jackrabbit/sandbox/microkernel/src/test/java/org/apache/jackrabbit/mk/json/JsopTest.java
Tue Aug  2 13:45:13 2011
@@ -230,6 +230,14 @@ public class JsopTest extends TestCase {
         assertEquals("+ {\"foo\":\"bar\",\"int\":3,\"decimal\":3.0," +
                 "\"obj\":{\"boolean\":true,\"null\":null," +
                 "\"arr\":[1,\"42\"]},\"some\":\"more\"}", json);
+
+        buff = new JsopBuilder();
+        buff.array().
+            object().key("x").value("1").endObject().append("\n").
+            object().key("y").value("2").endObject().append("\n").
+            endArray();
+        json = buff.toString();
+        assertEquals("[{\"x\":\"1\"}\n,{\"y\":\"2\"}\n]", json);
     }
 
     public void testEscape() throws IOException {



Mime
View raw message