jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1526845 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
Date Fri, 27 Sep 2013 10:03:03 GMT
Author: mduerig
Date: Fri Sep 27 10:03:02 2013
New Revision: 1526845

URL: http://svn.apache.org/r1526845
Log:
OAK-1039: Session#nodExists() true for a transiently moved Node at move Source
OAK-1040: after a non-commited session.move, the session.nodeExists() and getNode() are not
symmetric

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java?rev=1526845&r1=1526844&r2=1526845&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MutableTree.java
Fri Sep 27 10:03:02 2013
@@ -412,6 +412,7 @@ public class MutableTree extends Abstrac
     @CheckForNull
     MutableTree getTree(@Nonnull String path) {
         checkArgument(isAbsolute(checkNotNull(path)));
+        enter();
         MutableTree child = this;
         for (String name : elements(path)) {
             child = new MutableTree(root, child, name, pendingMoves);

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java?rev=1526845&r1=1526844&r2=1526845&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java
Fri Sep 27 10:03:02 2013
@@ -17,6 +17,8 @@
 package org.apache.jackrabbit.oak.jcr;
 
 import javax.jcr.Node;
+import javax.jcr.PathNotFoundException;
+import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 
 import org.apache.jackrabbit.JcrConstants;
@@ -33,6 +35,20 @@ public class MoveTest extends AbstractJC
         if (save) {
             superuser.save();
         }
+        assertFalse(superuser.nodeExists(src));
+        assertFalse(canGetNode(src));
+        assertTrue(superuser.nodeExists(dest));
+        assertTrue(canGetNode(dest));
+    }
+
+    // See OAK-1040
+    private boolean canGetNode(String path) throws RepositoryException {
+        try {
+            superuser.getNode(path);
+            return true;
+        } catch (PathNotFoundException e) {
+            return false;
+        }
     }
 
     @Test



Mime
View raw message