jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1297590 - /jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java
Date Tue, 06 Mar 2012 17:34:58 GMT
Author: mduerig
Date: Tue Mar  6 17:34:57 2012
New Revision: 1297590

URL: http://svn.apache.org/viewvc?rev=1297590&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- Fix failing tests

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java?rev=1297590&r1=1297589&r2=1297590&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java
Tue Mar  6 17:34:57 2012
@@ -150,6 +150,7 @@ public class TransientSpaceTest {
         root.addNode("a").addNode("b");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.removeNode("a");
         assertFalse(root.hasNode("a"));
 
@@ -165,6 +166,8 @@ public class TransientSpaceTest {
         assertFalse(root.getNode("a").hasNode("b"));
 
         transientSpace.save();
+
+        root = transientSpace.getNodeDelta(ROOT);
         assertTrue(root.hasNode("a"));
         assertFalse(root.getNode("a").hasNode("b"));
     }
@@ -175,6 +178,7 @@ public class TransientSpaceTest {
         root.addNode("a").addNode("b");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.moveNode("a", ROOT.concat("am1"));
         assertFalse(root.hasNode("a"));
 
@@ -190,6 +194,8 @@ public class TransientSpaceTest {
         assertFalse(root.getNode("a").hasNode("b"));
 
         transientSpace.save();
+
+        root = transientSpace.getNodeDelta(ROOT);
         assertTrue(root.hasNode("a"));
         assertFalse(root.getNode("a").hasNode("b"));
     }
@@ -201,6 +207,7 @@ public class TransientSpaceTest {
         root.addNode("x");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("a").moveNode("b", ROOT.concat("x/bm"));
         root.removeNode("a");
 
@@ -209,6 +216,7 @@ public class TransientSpaceTest {
 
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         assertNull(root.getNode("a"));
         assertNotNull(transientSpace.getNodeDelta(ROOT.concat("x/bm")));
     }
@@ -418,6 +426,7 @@ public class TransientSpaceTest {
         root.addNode("target");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
         root.getNode("target").removeNode("moved");
@@ -441,6 +450,7 @@ public class TransientSpaceTest {
         root.addNode("target");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").addNode("node");
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
@@ -464,6 +474,7 @@ public class TransientSpaceTest {
         root.addNode("source").addNode("node");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.addNode("target");
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
@@ -487,6 +498,7 @@ public class TransientSpaceTest {
         root.addNode("source");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").addNode("node");
         root.addNode("target");
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
@@ -513,6 +525,7 @@ public class TransientSpaceTest {
         root.addNode("target2");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         NodeDelta sourceNode = root.getNode("source");
         sourceNode.moveNode("node", ROOT.concat("target1/moved1"));
         NodeDelta target1 = root.getNode("target1");
@@ -540,6 +553,7 @@ public class TransientSpaceTest {
         root.addNode("target2");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         NodeDelta sourceNode = root.getNode("source");
         NodeDelta target1 = root.getNode("target1");
         target1.addNode("child");
@@ -568,6 +582,7 @@ public class TransientSpaceTest {
         root.addNode("target2");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target1/moved1"));
         NodeDelta target1 = root.getNode("target1");
@@ -593,6 +608,8 @@ public class TransientSpaceTest {
         NodeDelta root = transientSpace.getNodeDelta(ROOT);
         root.addNode("source");
         transientSpace.save();
+
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").addNode("node");
         root.addNode("target1");
         root.addNode("target2");
@@ -626,6 +643,7 @@ public class TransientSpaceTest {
         root.addNode("target");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
         NodeDelta target = root.getNode("target");
@@ -647,6 +665,8 @@ public class TransientSpaceTest {
         root.addNode("source");
         root.getNode("source").addNode("node");
         transientSpace.save();
+
+        root = transientSpace.getNodeDelta(ROOT);
         root.addNode("target");
 
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source"));
@@ -670,6 +690,7 @@ public class TransientSpaceTest {
         root.addNode("target");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.addNode("source1").addNode("node");
         NodeDelta sourceNode = transientSpace.getNodeDelta(ROOT.concat("source1"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
@@ -692,6 +713,7 @@ public class TransientSpaceTest {
         root.addNode("target");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").moveNode("node1", ROOT.concat("target/moved1"));
         root.getNode("source").moveNode("node2", ROOT.concat("target/moved1/child/moved2"));
 
@@ -735,6 +757,7 @@ public class TransientSpaceTest {
         root.addNode("target2");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").moveNode("node1", ROOT.concat("target1/moved1"));
         root.getNode("target1").getNode("moved1").moveNode("child", ROOT.concat("target2/moved2"));
 
@@ -758,6 +781,7 @@ public class TransientSpaceTest {
         root.addNode("t1");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.moveNode("a", ROOT.concat("t1/am"));
         root.getNode("t1").getNode("am").moveNode("b", ROOT.concat("bm"));
         
@@ -805,6 +829,7 @@ public class TransientSpaceTest {
         root.addNode("target2");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").moveNode("node", ROOT.concat("target1/moved"));
         root.moveNode("target1", ROOT.concat("target2/moved-target1"));
         
@@ -850,6 +875,7 @@ public class TransientSpaceTest {
         root.addNode("target");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").moveNode("node", ROOT.concat("target/moved"));
         root.removeNode("target");
 
@@ -890,6 +916,7 @@ public class TransientSpaceTest {
         root.addNode("source").addNode("node1");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").moveNode("node1", ROOT.concat("target"));
         root.getNode("source").addNode("node2");
         root.getNode("source").moveNode("node2", ROOT.concat("target/moved"));
@@ -912,7 +939,8 @@ public class TransientSpaceTest {
         NodeDelta root = transientSpace.getNodeDelta(ROOT);
         root.addNode("node");
         transientSpace.save();
-        
+
+        root = transientSpace.getNodeDelta(ROOT);
         root.addNode("target");
         root.moveNode("node", ROOT.concat("target/node-moved"));
 
@@ -931,7 +959,8 @@ public class TransientSpaceTest {
         root.addNode("a");
         root.addNode("b");
         transientSpace.save();
-        
+
+        root = transientSpace.getNodeDelta(ROOT);
         root.moveNode("a", ROOT.concat("am"));
         root.moveNode("b", ROOT.concat("am/bm"));
 
@@ -941,6 +970,7 @@ public class TransientSpaceTest {
 
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         assertNull(root.getNode("a"));
         assertNull(root.getNode("b"));
         assertNotNull(transientSpace.getNodeDelta(ROOT.concat("am/bm")));
@@ -953,6 +983,7 @@ public class TransientSpaceTest {
         root.addNode("b");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.moveNode("a", ROOT.concat("am"));
         root.getNode("am").addNode("c");
         root.moveNode("b", ROOT.concat("am/c/bm"));
@@ -962,6 +993,7 @@ public class TransientSpaceTest {
         assertNotNull(transientSpace.getNodeDelta(ROOT.concat("am/c/bm")));
 
         transientSpace.save();
+        root = transientSpace.getNodeDelta(ROOT);
 
         assertNull(root.getNode("a"));
         assertNull(root.getNode("b"));
@@ -973,7 +1005,8 @@ public class TransientSpaceTest {
         NodeDelta root = transientSpace.getNodeDelta(ROOT);
         root.addNode("a").addNode("b");
         transientSpace.save();
-        
+
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("a").moveNode("b", ROOT.concat("bm"));
         root.moveNode("a", ROOT.concat("bm/am"));
         
@@ -982,6 +1015,7 @@ public class TransientSpaceTest {
 
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         assertNull(root.getNode("a"));
         assertNotNull(transientSpace.getNodeDelta(ROOT.concat("bm/am")));
     }
@@ -995,22 +1029,26 @@ public class TransientSpaceTest {
         assertThat(mk, propertyHasValue(ROOT.concat("prop"), 42));
 
         // Remove property
+        root = transientSpace.getNodeDelta(ROOT);
         root.setValue("prop", null);
         transientSpace.save();
         assertThat(mk, CoreMatchers.not(propertyExists(ROOT.concat("prop"))));
 
         // Transiently remove property
+        root = transientSpace.getNodeDelta(ROOT);
         root.setValue("prop", JsonAtom.number(42));
         root.setValue("prop", null);
         transientSpace.save();
         assertThat(mk, CoreMatchers.not(propertyExists(ROOT.concat("prop"))));
 
         // Set property on transiently added parent
+        root = transientSpace.getNodeDelta(ROOT);
         root.addNode("node1").addNode("node2").setValue("prop", JsonAtom.string("value"));
         transientSpace.save();
         assertThat(mk, propertyHasValue(ROOT.concat("node1/node2/prop"), "value"));
 
         // Set property and move parent
+        root = transientSpace.getNodeDelta(ROOT);
         root.addNode("source").addNode("node").setValue("prop1", JsonAtom.number(42));
         root.getNode("source").getNode("node").setValue("prop2", JsonAtom.number(43));
         root.addNode("target");
@@ -1018,6 +1056,7 @@ public class TransientSpaceTest {
         assertThat(mk, propertyHasValue(ROOT.concat("source/node/prop1"), 42));
         assertThat(mk, propertyHasValue(ROOT.concat("source/node/prop2"), 43));
 
+        root = transientSpace.getNodeDelta(ROOT);
         root.getNode("source").moveNode("node", ROOT.concat("target/moved"));
         root.getNode("target").getNode("moved").setValue("prop2", null);
         transientSpace.save();
@@ -1033,6 +1072,7 @@ public class TransientSpaceTest {
         root.addNode("test");
         transientSpace.save();
 
+        root = transientSpace.getNodeDelta(ROOT);
         NodeDelta n1 = root.getNode("test");
         NodeDelta n2 = root.getNode("test");
         n1.addNode("c1");



Mime
View raw message