jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1206117 - /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Date Fri, 25 Nov 2011 10:47:07 GMT
Author: mduerig
Date: Fri Nov 25 10:47:06 2011
New Revision: 1206117

URL: http://svn.apache.org/viewvc?rev=1206117&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP)
- add test case adding deep node structure
- fix test failing due to wrong expectations

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

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java?rev=1206117&r1=1206116&r2=1206117&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Fri Nov 25 10:47:06 2011
@@ -77,11 +77,11 @@ public class MicrokernelTest {
         MicroKernel mk = getMicroKernel();
         String head = mk.getHeadRevision();
 
-        String s1 = mk.getNodes("/test", head);
-        assertEquals("{\"stringProp\":\"stringVal\",\"intProp\":42,\"multiIntProp\":[1,2,3],\"floatProp\":42.2,\":childNodeCount\":0}",
s1);
+        assertTrue(mk.nodeExists("/test", head));
         try {
-            String s2 = mk.getNodes("/test/", head);
-            Assert.fail("Success with invalid path: " + s2);
+            String path = "/test/";
+            mk.getNodes(path, head);
+            Assert.fail("Success with invalid path: " + path);
         } catch (MicroKernelException e) {
             // expected
         }
@@ -123,6 +123,24 @@ public class MicrokernelTest {
     }
 
     @Test
+    public void addDeepNodes() {
+        MicroKernel mk = getMicroKernel();
+        String head = mk.getHeadRevision();
+
+        head = mk.commit("/",
+                "+\"a\" : {} \r" +
+                "+\"a/b\" : {} \r" +
+                "+\"a/b/c\" : {} \r" +
+                "+\"a/b/c/d\" : {} \r",
+            head, "");
+
+        assertTrue(mk.nodeExists("/a", head));
+        assertTrue(mk.nodeExists("/a/b", head));
+        assertTrue(mk.nodeExists("/a/b/c", head));
+        assertTrue(mk.nodeExists("/a/b/c/d", head));
+    }
+
+    @Test
     public void addItemsIncrementally() {
         MicroKernel mk = getMicroKernel();
         String head = mk.getHeadRevision();



Mime
View raw message