jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1132697 - in /jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel: MicrokernelTest.java MicrokernelTests.java
Date Mon, 06 Jun 2011 16:39:29 GMT
Author: mduerig
Date: Mon Jun  6 16:39:29 2011
New Revision: 1132697

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

Added:
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
      - copied, changed from r1132604, jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java
Removed:
    jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java

Copied: jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
(from r1132604, jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java)
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java?p2=jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java&p1=jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java&r1=1132604&r2=1132697&rev=1132697&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTests.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/test/java/org/apache/jackrabbit/spi2microkernel/MicrokernelTest.java
Mon Jun  6 16:39:29 2011
@@ -34,7 +34,7 @@ import java.lang.reflect.Array;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
-public class MicrokernelTests {
+public class MicrokernelTest {
     private static final File REPO_HOME_DIR = new File("target/repository");
 
     private MicroKernelImpl microkernel;
@@ -64,13 +64,37 @@ public class MicrokernelTests {
         assertEquals(s1, s2);
     }
 
-    @Ignore  // todo fix in microkernel
     @Test
-    public void npe() {
+    public void addNodeWithRelativePath() {
+        MicroKernel mk = getMicroKernel();
+        String head = mk.getHeadRevision();
+
+        head = mk.commit("/", "+foo : {} \n+foo/bar : {}", head);
+        assertTrue(mk.nodeExists("/foo", head));
+        assertTrue(mk.nodeExists("/foo/bar", head));
+    }
+
+    @Test
+    public void addPropertyWithRelativePath() {
+        MicroKernel mk = getMicroKernel();
+        String head = mk.getHeadRevision();
+
+        head = mk.commit("/", "+fuu : {} \n^fuu/bar : 42", head);
+        String n = mk.getNodes("/fuu", 2, head);
+        assertEquals("{\":name\":\"fuu\",\"bar\":\"42\",\":childNodeCount\":0}", n);
+    }
+
+    @Test
+    public void testAddMultipleNodes() {
         MicroKernel mk = getMicroKernel();
         String head = mk.getHeadRevision();
 
-        mk.commit("/", "+foo/bar : {}", head);
+        long millis = System.currentTimeMillis();
+        String node1 = "n1_" + millis;
+        String node2 = "n2_" + millis;
+        head = mk.commit("/", '+' + node1 + " : {} \r+" + node2 + " : {}\n", head);
+        assertTrue(mk.nodeExists('/' + node1, head));
+        assertTrue(mk.nodeExists('/' + node2, head));
     }
 
     @Test



Mime
View raw message