jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1330406 - /jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
Date Wed, 25 Apr 2012 16:41:29 GMT
Author: stefan
Date: Wed Apr 25 16:41:29 2012
New Revision: 1330406

URL: http://svn.apache.org/viewvc?rev=1330406&view=rev
Log:
OAK-12: Implement a test suite for the MicroKernel (WIP)

Modified:
    jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java

Modified: jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java?rev=1330406&r1=1330405&r2=1330406&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
(original)
+++ jackrabbit/oak/trunk/oak-it/mk/src/main/java/org/apache/jackrabbit/mk/test/MicroKernelIT.java
Wed Apr 25 16:41:29 2012
@@ -147,8 +147,8 @@ public class MicroKernelIT extends Abstr
         head = mk.commit("/",
                 "+\"fuu\" : {} \n" +
                         "^\"fuu/bar\" : 42", head, "");
-        JSONObject jsonObj = parseJSONObject(mk.getNodes("/fuu", head));
-        assertEquals(42l, jsonObj.get("bar"));
+        JSONObject obj = parseJSONObject(mk.getNodes("/fuu", head));
+        assertPropertyValue(obj, "bar", 42L);
     }
 
     @Test
@@ -197,10 +197,14 @@ public class MicroKernelIT extends Abstr
                 head, "");
 
         String json = mk.getNodes('/' + node, head, 3, 0, -1, null);
-        assertEquals("{\"prop1\":41,\":childNodeCount\":2," +
-                "\"child1\":{\"prop2\":42,\":childNodeCount\":1," +
-                "\"grandchild11\":{\"prop3\":43,\":childNodeCount\":0}}," +
-                "\"child2\":{\":childNodeCount\":0}}", json);
+        JSONObject obj = parseJSONObject(mk.getNodes('/' + node, head, 3, 0, -1, null));
+        assertPropertyValue(obj, "prop1", 41L);
+        assertPropertyValue(obj, ":childNodeCount", 2L);
+        assertPropertyValue(obj, "child1/prop2", 42L);
+        assertPropertyValue(obj, "child1/:childNodeCount", 1L);
+        assertPropertyValue(obj, "child1/grandchild11/prop3", 43L);
+        assertPropertyValue(obj, "child1/grandchild11/:childNodeCount", 0L);
+        assertPropertyValue(obj, "child2/:childNodeCount", 0L);
     }
 
     @Test
@@ -211,8 +215,8 @@ public class MicroKernelIT extends Abstr
         head = mk.commit("/", "+\"" + node + "\" : {\"child\":{}}", head, "");
 
         head = mk.commit('/' + node, "-\"child\"", head, "");
-        String json = mk.getNodes('/' + node, head);
-        assertEquals("{\":childNodeCount\":0}", json);
+        JSONObject obj = parseJSONObject(mk.getNodes('/' + node, head));
+        assertPropertyValue(obj, ":childNodeCount", 0L);
     }
 
     @Test
@@ -287,8 +291,8 @@ public class MicroKernelIT extends Abstr
         head = mk.commit("/", "+\"" + node + "\" : {\"prop\":\"value\"}", head, "");
 
         head = mk.commit("/", "^\"" + node + "/prop\" : null", head, "");
-        String json = mk.getNodes('/' + node, head);
-        assertEquals("{\":childNodeCount\":0}", json);
+        JSONObject obj = parseJSONObject(mk.getNodes('/' + node, head));
+        assertPropertyValue(obj, ":childNodeCount", 0L);
     }
 
     @Test



Mime
View raw message