jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1138435 - /jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Date Wed, 22 Jun 2011 12:38:28 GMT
Author: mduerig
Date: Wed Jun 22 12:38:28 2011
New Revision: 1138435

URL: http://svn.apache.org/viewvc?rev=1138435&view=rev
Log:
spi2microkernel prototype (WIP)
tests

Modified:
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java

Modified: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java?rev=1138435&r1=1138434&r2=1138435&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Wed Jun 22 12:38:28 2011
@@ -220,37 +220,34 @@ public class MicrokernelTest {
         mk.getJournal(init, head); 
     }
 
-    @Ignore // fixme fix IAE in microkernel
     @Test
     public void journalAddNode() throws ParseException {
         MicroKernel mk = getMicroKernel();
         String init = mk.getHeadRevision();
 
         String head = mk.commit("/",
-                "+\"{}node\" : {}",
+                "+\"node\" : {}",
                 init);
 
         String journal = mk.getJournal(head, head);
-        System.out.println(journal);
 
         JSONArray jsonArray = (JSONArray) new JSONParser().parse(journal);
         JSONObject jsonObject = (JSONObject) jsonArray.get(0);
         String changes = (String) jsonObject.get("changes");
-        System.out.println(changes);
 
         JsopTokenizer tokenizer = new JsopTokenizer(changes);
         tokenizer.read('+');
-        System.out.println(tokenizer.readString());
+        assertEquals("/node", tokenizer.readString());
         tokenizer.read(':');
         tokenizer.read('{');
-        System.out.println(tokenizer.readString());
+        assertEquals(":childNodeCount", tokenizer.readString());
         tokenizer.read(':');
-        tokenizer.read();
-        System.out.println(tokenizer.getToken());
+        tokenizer.read(JsopTokenizer.NUMBER);
+        assertEquals("0", tokenizer.getToken());
         tokenizer.read('}');
+        tokenizer.read(JsopTokenizer.END);
     }
 
-    @Ignore // fixme fix IAE in microkernel
     @Test
     public void journalSetProperty() throws ParseException {
         MicroKernel mk = getMicroKernel();
@@ -265,22 +262,20 @@ public class MicrokernelTest {
                 head);
 
         String journal = mk.getJournal(head, head);
-        System.out.println(journal);
 
         JSONArray jsonArray = (JSONArray) new JSONParser().parse(journal);
         JSONObject jsonObject = (JSONObject) jsonArray.get(0);
         String changes = (String) jsonObject.get("changes");
-        System.out.println(changes);
 
         JsopTokenizer tokenizer = new JsopTokenizer(changes);
         tokenizer.read('^');
-        System.out.println(tokenizer.readString());
+        assertEquals("/node/prop", tokenizer.readString());
         tokenizer.read(':');
         tokenizer.read(JsopTokenizer.NUMBER);
-        System.out.println(tokenizer.getToken());
+        assertEquals("21", tokenizer.getToken());
+        tokenizer.read(JsopTokenizer.END);
     }
 
-    @Ignore // fixme fix IAE in microkernel
     @Test
     public void journalSetProperty2() throws ParseException {
         MicroKernel mk = getMicroKernel();
@@ -295,18 +290,17 @@ public class MicrokernelTest {
                 head);
 
         String journal = mk.getJournal(head, head);
-        System.out.println(journal);
 
         JSONArray jsonArray = (JSONArray) new JSONParser().parse(journal);
         JSONObject jsonObject = (JSONObject) jsonArray.get(0);
         String changes = (String) jsonObject.get("changes");
-        System.out.println(changes);
-        
+
         JsopTokenizer tokenizer = new JsopTokenizer(changes);
         tokenizer.read('^');
-        System.out.println(tokenizer.readString());
+        assertEquals("/node/prop", tokenizer.readString());
         tokenizer.read(':');
         assertEquals("bar", tokenizer.readString());
+        tokenizer.read(JsopTokenizer.END);
     }
 
     //------------------------------------------< private >---



Mime
View raw message