jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1225398 - in /jackrabbit/sandbox/jackrabbit-microkernel/src: main/java/org/apache/jackrabbit/ main/java/org/apache/jackrabbit/state/ test/java/org/apache/jackrabbit/state/
Date Wed, 28 Dec 2011 23:59:31 GMT
Author: mduerig
Date: Wed Dec 28 23:59:31 2011
New Revision: 1225398

URL: http://svn.apache.org/viewvc?rev=1225398&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- refactor, cleanup, minor improvements

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/NodeImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/test/java/org/apache/jackrabbit/state/TransientSpaceTest.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/NodeImpl.java?rev=1225398&r1=1225397&r2=1225398&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/NodeImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/NodeImpl.java
Wed Dec 28 23:59:31 2011
@@ -33,7 +33,6 @@ import org.apache.jackrabbit.utils.Value
 
 import javax.jcr.Binary;
 import javax.jcr.Item;
-import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.ItemVisitor;
 import javax.jcr.Node;
@@ -61,7 +60,7 @@ public class NodeImpl extends ItemImpl i
     private final NodeState nodeState;
 
     static boolean exist(Context sessionContext, Path path) {
-        return NodeState.hasNodeState(sessionContext.getTransientSpace(), path);
+        return NodeState.hasNodeState(sessionContext, path);
     }
 
     static Node create(Context sessionContext, Path path) throws PathNotFoundException {
@@ -131,10 +130,6 @@ public class NodeImpl extends ItemImpl i
 
     @Override
     public Node addNode(String relPath) throws RepositoryException {
-        if (hasNode(relPath)) {
-            throw new ItemExistsException(relPath);
-        }
-
         Path newPath = path().concat(relPath);
         NodeState parentState = getNodeState(sessionContext, newPath.getParent());
         NodeState childState = parentState.addNode(newPath.getName());
@@ -143,10 +138,6 @@ public class NodeImpl extends ItemImpl i
 
     @Override
     public Node addNode(String relPath, String primaryNodeTypeName) throws RepositoryException
{
-        if (hasNode(relPath)) {
-            throw new ItemExistsException(relPath);
-        }
-
         Node childNode = addNode(relPath);
         childNode.setPrimaryType(primaryNodeTypeName);
         return childNode;
@@ -586,7 +577,12 @@ public class NodeImpl extends ItemImpl i
     //------------------------------------------< private >---
 
     private static NodeState getNodeState(Context sessionContext, Path path) throws PathNotFoundException
{
-        return NodeState.getNodeState(sessionContext, path);
+        NodeState nodeState = NodeState.getNodeState(sessionContext, path);
+        if (nodeState == null) {
+            throw new PathNotFoundException(path.toJcrPath());
+        }
+
+        return nodeState;
     }
 
     private Path path() {

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java?rev=1225398&r1=1225397&r2=1225398&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/PropertyImpl.java
Wed Dec 28 23:59:31 2011
@@ -49,21 +49,17 @@ public class PropertyImpl extends ItemIm
     private final JsonValue value;
 
     public static boolean exist(Context sessionContext, Path path) {
-        try {
-            NodeState parentState = NodeState.getNodeState(sessionContext, path.getParent());
-            
-            return parentState.hasProperty(path.getName());
-        }
-        catch (PathNotFoundException e) {
-            // fixme don't use exception handling for flow control.
-            return false;
-        }
+        NodeState parentState = NodeState.getNodeState(sessionContext, path.getParent());
+        return parentState != null && parentState.hasProperty(path.getName());
     }
 
     static Property create(Context sessionContext, Path path) throws PathNotFoundException,
             ItemNotFoundException {
 
         NodeState parentState = NodeState.getNodeState(sessionContext, path.getParent());
+        if (parentState == null) {
+            throw new PathNotFoundException(path.toJcrPath());
+        }
 
         String name = path.getName();
         JsonValue value = parentState.getPropertyValue(name);

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java?rev=1225398&r1=1225397&r2=1225398&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/ChangeTree.java
Wed Dec 28 23:59:31 2011
@@ -102,21 +102,22 @@ public class ChangeTree {
      * the persistence layer.
      */
     public boolean nodeExists(Path path) {
-        return getNodeOrNull(path) != null;
+        return getNode(path) != null;
     }
 
     /**
      * @param path
-     * @return a {@code NodeDelta} instance for the given {@code path}.
-     * @throws PathNotFoundException  if {@code path} does not exist transiently nor
-     * on the persistence layer.
-     */
-    public NodeDelta getNode(Path path) throws PathNotFoundException {
-        NodeDelta delta = getNodeOrNull(path);
-        if (delta == null) {
-            throw new PathNotFoundException(path.toJcrPath());
+     * @return a {@code NodeDelta} instance for the given {@code path} or {@code null}
+     * if {@code path} does not exist transiently nor on the persistence layer.
+     */
+    public NodeDelta getNode(Path path) {
+        NodeDelta delta = root;
+        for (String name : path.getNames()) {
+            delta = delta.getNode(name);
+            if (delta == null) {
+                return null;
+            }
         }
-
         return delta;
     }
 
@@ -142,17 +143,6 @@ public class ChangeTree {
         return root.hasChanges();
     }
 
-    private NodeDelta getNodeOrNull(Path path) {
-        NodeDelta delta = root;
-        for (String name : path.getNames()) {
-            delta = delta.getNode(name);
-            if (delta == null) {
-                return null;
-            }
-        }
-        return delta;
-    }
-
     /**
      * Visitor for traversing a change tree.
      */

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java?rev=1225398&r1=1225397&r2=1225398&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/NodeState.java
Wed Dec 28 23:59:31 2011
@@ -33,7 +33,6 @@ import org.apache.jackrabbit.state.Chang
 
 import javax.jcr.ItemExistsException;
 import javax.jcr.ItemNotFoundException;
-import javax.jcr.PathNotFoundException;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -149,15 +148,13 @@ public class NodeState {
         nodeDelta.setValue(name, null);
     }
 
-    public static NodeState getNodeState(Context sessionContext, Path path)
-            throws PathNotFoundException {
-
+    public static NodeState getNodeState(Context sessionContext, Path path) {
         NodeDelta delta = sessionContext.getTransientSpace().getNode(path);
-        return new NodeState(sessionContext, delta);
+        return delta == null ? null : new NodeState(sessionContext, delta);
     }
 
-    public static boolean hasNodeState(TransientSpace transientSpace, Path path) {
-        return transientSpace.nodeExists(path);
+    public static boolean hasNodeState(Context sessionContext, Path path) {
+        return getNodeState(sessionContext, path) != null;
     }
 
     //------------------------------------------< private >---

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java?rev=1225398&r1=1225397&r2=1225398&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/state/TransientSpace.java
Wed Dec 28 23:59:31 2011
@@ -27,7 +27,6 @@ import org.apache.jackrabbit.spi.commons
 import org.apache.jackrabbit.state.ChangeTree.Listener;
 import org.apache.jackrabbit.state.ChangeTree.NodeDelta;
 
-import javax.jcr.PathNotFoundException;
 import javax.jcr.RepositoryException;
 
 /**
@@ -62,21 +61,11 @@ public class TransientSpace {
 
     /**
      * @param path
-     * @return {@code true} iff there exists a node at the given {@code path}. The node
-     * is either a persisted node in the revision currently bound to this transient space
-     * or a transient node.
-     */
-    public boolean nodeExists(Path path) {
-        return changeTree.nodeExists(path);
-    }
-
-    /**
-     * @param path
      * @return the node at the given {@code path}. The node is either a persisted node in
the
-     * revision currently bound to this transient space or a transient node.
-     * @throws PathNotFoundException
+     * revision currently bound to this transient space or a transient node or {@code null}
+     * if no such node exists.
      */
-    public NodeDelta getNode(Path path) throws PathNotFoundException {
+    public NodeDelta getNode(Path path) {
         return changeTree.getNode(path);
     }
 

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=1225398&r1=1225397&r2=1225398&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
Wed Dec 28 23:59:31 2011
@@ -29,6 +29,8 @@ import static org.apache.jackrabbit.stat
 import static org.apache.jackrabbit.state.TransientSpaceTest.MicrokernelMatcher.propertyHasValue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 
@@ -51,9 +53,9 @@ public class TransientSpaceTest {
         mk.dispose();
     }
 
-    @Test(expected = PathNotFoundException.class)
-    public void getNotExistingNode() throws PathNotFoundException, ItemNotFoundException
{
-        transientSpace.getNode(ROOT.concat("any"));
+    @Test
+    public void getNotExistingNode() {
+        assertNull(transientSpace.getNode(ROOT.concat("any")));
     }
     
     @Test
@@ -80,13 +82,13 @@ public class TransientSpaceTest {
         c.addNode("d").addNode("e");
         c.addNode("f");
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("a/b/c/d/e")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("a/b/c/f")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("a/b/c/d/e")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("a/b/c/f")));
 
         transientSpace.save();
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("a/b/c/d/e")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("a/b/c/f")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("a/b/c/d/e")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("a/b/c/f")));
     }
 
     @Test(expected = ItemNotFoundException.class)
@@ -103,13 +105,13 @@ public class TransientSpaceTest {
         transientSpace.save();
 
         Path addedPath = ROOT.concat("added");
-        assertTrue(transientSpace.nodeExists(addedPath));
+        assertNotNull(transientSpace.getNode(addedPath));
         
         root = transientSpace.getNode(ROOT);
         root.removeNode("added");
-        assertFalse(transientSpace.nodeExists(addedPath));
+        assertNull(transientSpace.getNode(addedPath));
         transientSpace.save();
-        assertFalse(transientSpace.nodeExists(addedPath));
+        assertNull(transientSpace.getNode(addedPath));
     }
 
     @Test
@@ -118,12 +120,12 @@ public class TransientSpaceTest {
         root.addNode("added");
 
         Path addedPath = ROOT.concat("added");
-        assertTrue(transientSpace.nodeExists(addedPath));
+        assertNotNull(transientSpace.getNode(addedPath));
 
         root.removeNode("added");
-        assertFalse(transientSpace.nodeExists(addedPath));
+        assertNull(transientSpace.getNode(addedPath));
         transientSpace.save();
-        assertFalse(transientSpace.nodeExists(addedPath));
+        assertNull(transientSpace.getNode(addedPath));
     }
 
     @Test(expected = ItemNotFoundException.class)
@@ -151,14 +153,14 @@ public class TransientSpaceTest {
         NodeDelta sourceNode = transientSpace.getNode(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -171,14 +173,14 @@ public class TransientSpaceTest {
         NodeDelta sourceNode = transientSpace.getNode(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test(expected = ItemNotFoundException.class)
@@ -222,14 +224,14 @@ public class TransientSpaceTest {
         NodeDelta sourceNode = transientSpace.getNode(ROOT.concat("source"));
         sourceNode.moveNode("node", ROOT.concat("source/moved"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source/moved")));
     }
     
     @Test
@@ -244,16 +246,16 @@ public class TransientSpaceTest {
         b = transientSpace.getNode(ROOT.concat("a/b"));
         b.moveNode("c", y.getPath().concat("c-moved"));
         
-        assertFalse(transientSpace.nodeExists(ROOT.concat("a/b/c")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("a/b")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("v/w/x/y")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("v/w/c-moved/d")));
+        assertNull(transientSpace.getNode(ROOT.concat("a/b/c")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("a/b")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("v/w/x/y")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("v/w/c-moved/d")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("a/b/c")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("a/b")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("v/w/x/y")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("v/w/c-moved/d")));
+        assertNull(transientSpace.getNode(ROOT.concat("a/b/c")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("a/b")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("v/w/x/y")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("v/w/c-moved/d")));
     }
     
     @Test
@@ -269,16 +271,16 @@ public class TransientSpaceTest {
         moveNode.removeNode("c");
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a/b")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a/b")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a/b")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a/b")));
     }
 
     @Test
@@ -294,16 +296,16 @@ public class TransientSpaceTest {
         movedNode.addNode("a").addNode("b");
         movedNode.removeNode("c");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a/b")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a/b")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a/b")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a/b")));
     }
     
     @Test
@@ -324,20 +326,20 @@ public class TransientSpaceTest {
         movedNode.addNode("a2").addNode("b2");
         movedNode.removeNode("c2");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a1/b1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c2")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a2/b2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a1/b1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c2")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a2/b2")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a1/b1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved/c2")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved/a2/b2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a1/b1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved/c2")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved/a2/b2")));
     }
 
     @Test
@@ -351,16 +353,16 @@ public class TransientSpaceTest {
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
         root.getNode("target").removeNode("moved");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -375,16 +377,16 @@ public class TransientSpaceTest {
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
         root.getNode("target").removeNode("moved");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -398,16 +400,16 @@ public class TransientSpaceTest {
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
         root.getNode("target").removeNode("moved");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -422,16 +424,16 @@ public class TransientSpaceTest {
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
         root.getNode("target").removeNode("moved");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
     
     @Test
@@ -447,18 +449,18 @@ public class TransientSpaceTest {
         NodeDelta target1 = root.getNode("target1");
         target1.moveNode("moved1", ROOT.concat("target2/moved2"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
     }
 
     @Test
@@ -475,18 +477,18 @@ public class TransientSpaceTest {
         target1.moveNode("moved1", ROOT.concat("target2/moved2"));
         root.getNode("target2").removeNode("moved2");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
     }
 
     @Test
@@ -504,20 +506,20 @@ public class TransientSpaceTest {
         target1.moveNode("moved1", ROOT.concat("target2/moved2"));
         root.getNode("target2").removeNode("moved2");
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
     }
 
     @Test
@@ -532,14 +534,14 @@ public class TransientSpaceTest {
         NodeDelta target = root.getNode("target");
         target.moveNode("moved", ROOT.concat("source/node"));
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -555,14 +557,14 @@ public class TransientSpaceTest {
         NodeDelta target = root.getNode("target");
         target.moveNode("moved", ROOT.concat("source/node"));
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -575,14 +577,14 @@ public class TransientSpaceTest {
         NodeDelta sourceNode = transientSpace.getNode(ROOT.concat("source1"));
         sourceNode.moveNode("node", ROOT.concat("target/moved"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved")));
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved")));
     }
 
     @Test
@@ -596,15 +598,15 @@ public class TransientSpaceTest {
         root.getNode("source").moveNode("node1", ROOT.concat("target/moved1"));
         root.getNode("source").moveNode("node2", ROOT.concat("target/moved1/child/moved2"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node2")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved1/child/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node2")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved1/child/moved2")));
 
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node2")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved1/child/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node2")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved1/child/moved2")));
     }
 
     @Test
@@ -617,15 +619,15 @@ public class TransientSpaceTest {
         root.getNode("source").moveNode("node1", ROOT.concat("target/moved1"));
         root.getNode("source").moveNode("node2", ROOT.concat("target/moved1/child/moved2"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node2")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved1/child/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node2")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved1/child/moved2")));
 
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node2")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target/moved1/child/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node2")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target/moved1/child/moved2")));
     }
 
     @Test
@@ -639,17 +641,17 @@ public class TransientSpaceTest {
         root.getNode("source").moveNode("node1", ROOT.concat("target1/moved1"));
         root.getNode("target1").getNode("moved1").moveNode("child", ROOT.concat("target2/moved2"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1/child")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1/child")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
 
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1/child")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1/child")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
     }
 
     @Test
@@ -662,17 +664,17 @@ public class TransientSpaceTest {
         root.getNode("source").moveNode("node1", ROOT.concat("target1/moved1"));
         root.getNode("target1").getNode("moved1").moveNode("child", ROOT.concat("target2/moved2"));
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1/child")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1/child")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
 
         transientSpace.save();
 
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target1/moved1")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1/moved1/child")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved2")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target1/moved1")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1/moved1/child")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved2")));
     }
 
     @Test
@@ -686,17 +688,17 @@ public class TransientSpaceTest {
         root.getNode("source").moveNode("node", ROOT.concat("target1/moved"));
         root.moveNode("target1", ROOT.concat("target2/moved-target1"));
         
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved-target1/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved-target1/moved")));
 
         transientSpace.save();
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved-target1/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved-target1/moved")));
     }
 
     @Test
@@ -709,16 +711,16 @@ public class TransientSpaceTest {
         root.getNode("source").moveNode("node", ROOT.concat("target1/moved"));
         root.moveNode("target1", ROOT.concat("target2/moved-target1"));
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1")));
-        assertTrue(transientSpace.nodeExists(ROOT.concat("target2/moved-target1/moved")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("target2/moved-target1/moved")));
 
         transientSpace.save();
 
-        assertTrue(transientSpace.nodeExists(ROOT.concat("source")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("source/node")));
-        assertFalse(transientSpace.nodeExists(ROOT.concat("target1")));
+        assertNotNull(transientSpace.getNode(ROOT.concat("source")));
+        assertNull(transientSpace.getNode(ROOT.concat("source/node")));
+        assertNull(transientSpace.getNode(ROOT.concat("target1")));
     }
 
     @Test



Mime
View raw message