jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1336557 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/core/ oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/ oak-core/src/test/java/org/apache/jackrabbit/oak/core/ oak-jcr/src/test/java/org/apache/jac...
Date Thu, 10 May 2012 09:31:34 GMT
Author: mduerig
Date: Thu May 10 09:31:33 2012
New Revision: 1336557

URL: http://svn.apache.org/viewvc?rev=1336557&view=rev
Log:
OAK-93: Tree has wrong parent after move
- Initial fix
- Regression tests

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1336557&r1=1336556&r2=1336557&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Thu May 10 09:31:33 2012
@@ -21,6 +21,7 @@ package org.apache.jackrabbit.oak.core;
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Tree;
+import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateBuilder;
@@ -29,8 +30,10 @@ import org.apache.jackrabbit.oak.spi.sta
 import org.apache.jackrabbit.oak.util.Function1;
 import org.apache.jackrabbit.oak.util.Iterators;
 
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 
 /**
  * Implementation of tree based on {@link NodeStateBuilder}s. Each subtree
@@ -42,43 +45,46 @@ public class TreeImpl implements Tree {
     /** Underlying store */
     private final NodeStore store;
 
+    private final NodeStateBuilder rootBuilder;
+
     /**
      * Underlying persistent state or {@code null} if this instance represents an
      * added tree
      */
     private final NodeState baseState;
 
-    private final NodeStateBuilder builder;
-
     /** Listener for changes on this tree */
     private final Listener listener;
 
+    /** Parent of this tree */
+    private TreeImpl parent;
+
     /** Name of this tree */
     private String name;
 
-    /** Parent of this tree */
-    private TreeImpl parent;
+    // FIXME: should be synchronized, and weak refs
+    private final Map<String, TreeImpl> children = new HashMap<String, TreeImpl>();
 
-    private TreeImpl(NodeStore store, NodeState baseState, NodeStateBuilder builder,
+    private TreeImpl(NodeStore store, NodeState baseState, NodeStateBuilder rootBuilder,
             TreeImpl parent, String name, Listener listener) {
 
         this.store = store;
-        this.builder = builder;
+        this.rootBuilder = rootBuilder;
         this.baseState = baseState;
         this.listener = listener;
-        this.name = name;
         this.parent = parent;
+        this.name = name;
     }
 
     /**
      * Create a new instance which represents the root of a tree.
      * @param store  underlying store to the tree
-     * @param nodeStateBuilder  builder for the root
+     * @param rootBuilder  builder for the root
      * @param listener  change listener for the tree. May be {@code null} if
      *                  listening to changes is not needed.
      */
-    TreeImpl(NodeStore store, NodeStateBuilder nodeStateBuilder, Listener listener) {
-        this(store, nodeStateBuilder.getNodeState(), nodeStateBuilder, null, "", listener);
+    TreeImpl(NodeStore store, NodeStateBuilder rootBuilder, Listener listener) {
+        this(store, rootBuilder.getNodeState(), rootBuilder, null, "", listener);
     }
 
     /**
@@ -147,15 +153,14 @@ public class TreeImpl implements Tree {
 
     @Override
     public String getPath() {
+        // Shortcut for root
         if (parent == null) {
-            return name;
-        }
-        else {
-            String path = parent.getPath();
-            return path.isEmpty()
-                    ? name
-                    : path + '/' + name;
+            return "";
         }
+
+        StringBuilder sb = new StringBuilder();
+        buildPath(sb);
+        return sb.toString();
     }
 
     @Override
@@ -233,17 +238,22 @@ public class TreeImpl implements Tree {
 
     @Override
     public TreeImpl getChild(String name) {
-        NodeStateBuilder childBuilder = builder.getChildBuilder(name);
-        if (childBuilder == null) {
-            return null;
+        TreeImpl child = children.get(name);
+        if (child != null) {
+            return child;
         }
-        else {
-            NodeState childBaseState = baseState == null
-                    ? null
-                    : baseState.getChildNode(name);
 
-            return new TreeImpl(store, childBaseState, childBuilder, this, name, listener);
+        if (!hasChild(name)) {
+            return null;
         }
+
+        NodeState childBaseState = baseState == null
+                ? null
+                : baseState.getChildNode(name);
+
+        child = new TreeImpl(store, childBaseState, rootBuilder, this, name, listener);
+        children.put(name, child);
+        return child;
     }
 
     @Override
@@ -307,14 +317,24 @@ public class TreeImpl implements Tree {
         return new Iterable<Tree>() {
             @Override
             public Iterator<Tree> iterator() {
+                final NodeState nodeState = getNodeState();
+
                 Iterator<? extends ChildNodeEntry> childEntries =
-                        getNodeState().getChildNodeEntries().iterator();
+                        nodeState.getChildNodeEntries().iterator();
 
                 return Iterators.map(childEntries, new Function1<ChildNodeEntry, Tree>()
{
                     @Override
                     public Tree apply(ChildNodeEntry entry) {
-                        NodeStateBuilder childBuilder = builder.getChildBuilder(entry.getName());
-                        return new TreeImpl(store, childBuilder.getNodeState(), childBuilder,
TreeImpl.this, entry.getName(), listener);
+                        String childName = entry.getName();
+                        TreeImpl child = children.get(entry.getName());
+                        if (child != null) {
+                            return child;
+                        }
+
+                        NodeState childNodeState = nodeState.getChildNode(childName);
+                        child = new TreeImpl(store, childNodeState, rootBuilder, TreeImpl.this,
childName, listener);
+                        children.put(childName, child);
+                        return child;
                     }
                 });
             }
@@ -323,24 +343,27 @@ public class TreeImpl implements Tree {
 
     @Override
     public Tree addChild(String name) {
-        if (builder.addNode(name) != null) {
+        if (getBuilder().addNode(name) != null) {
             listener.addChild(this, name);
         }
-        return getChild(name);
+        TreeImpl child = getChild(name);
+        children.put(name, child);
+        return child;
     }
 
     @Override
     public boolean removeChild(String name) {
-        boolean result = builder.removeNode(name);
+        boolean result = getBuilder().removeNode(name);
         if (result) {
             listener.removeChild(this, name);
+            children.remove(name);
         }
         return result;
     }
 
     @Override
     public PropertyState setProperty(String name, CoreValue value) {
-        PropertyState property = builder.setProperty(name, value);
+        PropertyState property = getBuilder().setProperty(name, value);
         if (listener != null) {
             listener.setProperty(this, name, value);
         }
@@ -349,7 +372,7 @@ public class TreeImpl implements Tree {
 
     @Override
     public PropertyState setProperty(String name, List<CoreValue> values) {
-        PropertyState property = builder.setProperty(name, values);
+        PropertyState property = getBuilder().setProperty(name, values);
         if (listener != null) {
             listener.setProperty(this, name, values);
         }
@@ -358,7 +381,7 @@ public class TreeImpl implements Tree {
 
     @Override
     public void removeProperty(String name) {
-        builder.removeProperty(name);
+        getBuilder().removeProperty(name);
         if (listener != null) {
             listener.removeProperty(this, name);
         }
@@ -374,8 +397,13 @@ public class TreeImpl implements Tree {
      * when {@code destName} already exists at {@code destParent}
      */
     public boolean move(TreeImpl destParent, String destName) {
-        boolean result = builder.moveTo(destParent.builder, destName);
+        NodeStateBuilder builder = getBuilder();
+        NodeStateBuilder destParentBuilder = destParent.getBuilder();
+        boolean result = builder.moveTo(destParentBuilder, destName);
         if (result) {
+            parent.children.remove(name);
+            destParent.children.put(destName, this);
+
             TreeImpl oldParent = parent;
             String oldName = name;
 
@@ -398,7 +426,7 @@ public class TreeImpl implements Tree {
      * when {@code destName} already exists at {@code destParent}
      */
     public boolean copy(TreeImpl destParent, String destName) {
-        boolean result = builder.copyTo(destParent.builder, destName);
+        boolean result = getBuilder().copyTo(destParent.getBuilder(), destName);
         if (result) {
             if (listener != null) {
                 listener.copy(parent, name, destParent.getChild(destName));
@@ -410,8 +438,30 @@ public class TreeImpl implements Tree {
 
     //------------------------------------------------------------< private >---
 
+    private void buildPath(StringBuilder sb) {
+        if (parent != null) {
+            parent.buildPath(sb);
+            if (sb.length() > 0) {
+                sb.append('/');
+            }
+            sb.append(name);
+        }
+    }
+
+    private NodeStateBuilder getBuilder() {
+        NodeStateBuilder builder = rootBuilder;
+        for (String name : PathUtils.elements(getPath())) {
+            builder = builder.getChildBuilder(name);
+            if (builder == null) {
+                throw new IllegalStateException("Stale NodeStateBuilder for " + getPath());
+            }
+        }
+
+        return builder;
+    }
+
     private NodeState getNodeState() {
-        return builder.getNodeState();
+        return getBuilder().getNodeState();
     }
 
     private boolean isSame(NodeState state1, NodeState state2) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java?rev=1336557&r1=1336556&r2=1336557&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeStateBuilder.java
Thu May 10 09:31:33 2012
@@ -28,27 +28,28 @@ import java.util.List;
 public class KernelNodeStateBuilder implements NodeStateBuilder {
     private final NodeStateBuilderContext context;
 
-    private String path;
+    private KernelNodeStateBuilder parent;
+    private String name;
 
-    private KernelNodeStateBuilder(NodeStateBuilderContext context, String path) {
+    private KernelNodeStateBuilder(NodeStateBuilderContext context, KernelNodeStateBuilder
parent, String name) {
         this.context = context;
-        this.path = path;
+        this.parent = parent;
+        this.name = name;
     }
 
     public static NodeStateBuilder create(NodeStateBuilderContext context) {
-        return new KernelNodeStateBuilder(context, "");
+        return new KernelNodeStateBuilder(context, null, "");
     }
 
-
     @Override
     public NodeState getNodeState() {
-        return context.getNodeState(path);
+        return context.getNodeState(getPath());
     }
 
     @Override
     public NodeStateBuilder getChildBuilder(String name) {
         return hasChild(name)
-            ? new KernelNodeStateBuilder(context, PathUtils.concat(path, name))
+            ? new KernelNodeStateBuilder(context, this, name)
             : null;
     }
 
@@ -58,9 +59,9 @@ public class KernelNodeStateBuilder impl
             return null;
         }
         else {
-            String targetPath = PathUtils.concat(path, name);
+            String targetPath = PathUtils.concat(getPath(), name);
             context.addNode(nodeState, targetPath);
-            return new KernelNodeStateBuilder(context, targetPath);
+            return new KernelNodeStateBuilder(context, this, name);
         }
     }
 
@@ -70,16 +71,16 @@ public class KernelNodeStateBuilder impl
             return null;
         }
         else {
-            String targetPath = PathUtils.concat(path, name);
+            String targetPath = PathUtils.concat(getPath(), name);
             context.addNode(targetPath);
-            return new KernelNodeStateBuilder(context, targetPath);
+            return new KernelNodeStateBuilder(context, this, name);
         }
     }
 
     @Override
     public boolean removeNode(String name) {
         if (hasChild(name)) {
-            context.removeNode(PathUtils.concat(path, name));
+            context.removeNode(PathUtils.concat(getPath(), name));
             return true;
         }
         else {
@@ -91,10 +92,10 @@ public class KernelNodeStateBuilder impl
     public PropertyState setProperty(String name, CoreValue value) {
         PropertyState property = new PropertyStateImpl(name, value);
         if (hasProperty(name)) {
-            context.setProperty(property, path);
+            context.setProperty(property, getPath());
         }
         else {
-            context.addProperty(property, path);
+            context.addProperty(property, getPath());
         }
         return property;
     }
@@ -103,10 +104,10 @@ public class KernelNodeStateBuilder impl
     public PropertyState setProperty(String name, List<CoreValue> values) {
         PropertyState property = new PropertyStateImpl(name, values);
         if (hasProperty(name)) {
-            context.setProperty(property, path);
+            context.setProperty(property, getPath());
         }
         else {
-            context.addProperty(property, path);
+            context.addProperty(property, getPath());
         }
         return property;
     }
@@ -114,7 +115,7 @@ public class KernelNodeStateBuilder impl
     @Override
     public void removeProperty(String name) {
         if (hasProperty(name)) {
-            context.removeProperty(PathUtils.concat(path, name));
+            context.removeProperty(PathUtils.concat(getPath(), name));
         }
     }
 
@@ -129,10 +130,13 @@ public class KernelNodeStateBuilder impl
         }
 
         KernelNodeStateBuilder destParentBuilder = (KernelNodeStateBuilder) destParent;
-        String destPath = PathUtils.concat(destParentBuilder.path, destName);
+        String destPath = PathUtils.concat(destParentBuilder.getPath(), destName);
+
+        context.moveNode(getPath(), destPath);
+
+        name = destName;
+        parent = destParentBuilder;
 
-        context.moveNode(path, destPath);
-        path = destPath;
         return true;
     }
 
@@ -147,9 +151,9 @@ public class KernelNodeStateBuilder impl
         }
 
         KernelNodeStateBuilder destParentBuilder = (KernelNodeStateBuilder) destParent;
-        String destPath = PathUtils.concat(destParentBuilder.path, destName);
+        String destPath = PathUtils.concat(destParentBuilder.getPath(), destName);
 
-        context.copyNode(path, destPath);
+        context.copyNode(getPath(), destPath);
         return true;
     }
 
@@ -161,6 +165,27 @@ public class KernelNodeStateBuilder impl
 
     //------------------------------------------------------------< private >---
 
+    private String getPath() {
+        // Shortcut for root
+        if (parent == null) {
+            return "";
+        }
+
+        StringBuilder sb = new StringBuilder();
+        buildPath(sb);
+        return sb.toString();
+    }
+
+    private void buildPath(StringBuilder sb) {
+        if (parent != null) {
+            parent.buildPath(sb);
+            if (sb.length() > 0) {
+                sb.append('/');
+            }
+            sb.append(name);
+        }
+    }
+
     private boolean hasChild(String name) {
         return getNodeState().getChildNode(name) != null;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java?rev=1336557&r1=1336556&r2=1336557&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Thu May 10 09:31:33 2012
@@ -230,6 +230,20 @@ public class RootImplTest extends Abstra
     }
 
     @Test
+    public void move2() {
+        RootImpl root = new RootImpl(store, "test");
+        Tree r = root.getTree("");
+        Tree x = r.getChild("x");
+        Tree y = r.getChild("y");
+
+        assertFalse(y.hasChild("x"));
+        assertEquals("", x.getParent().getName());
+        root.move("x", "y/x");
+        assertTrue(y.hasChild("x"));
+        assertEquals("y", x.getParent().getName());
+    }
+
+    @Test
     public void rename() throws CommitFailedException {
         RootImpl root = new RootImpl(store, "test");
         Tree tree = root.getTree("/");

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java?rev=1336557&r1=1336556&r2=1336557&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
Thu May 10 09:31:33 2012
@@ -27,6 +27,7 @@ import util.NumberStream;
 
 import javax.jcr.Binary;
 import javax.jcr.GuestCredentials;
+import javax.jcr.InvalidItemStateException;
 import javax.jcr.Item;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.NoSuchWorkspaceException;
@@ -71,6 +72,7 @@ import static org.junit.Assert.assertEqu
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 public class RepositoryTest extends AbstractRepositoryTest {
     private static final String TEST_NODE = "test_node";
@@ -950,7 +952,7 @@ public class RepositoryTest extends Abst
             session2.logout();
         }
 
-        Session session3 = createAnonymousSession();;
+        Session session3 = createAnonymousSession();
         try {
             assertFalse(session3.propertyExists(TEST_PATH + "/newProperty"));
         }
@@ -965,7 +967,7 @@ public class RepositoryTest extends Abst
         parentNode.setProperty("newProperty", "some value");
         parentNode.getSession().save();
 
-        Session session2 = createAnonymousSession();;
+        Session session2 = createAnonymousSession();
         try {
             session2.getProperty(TEST_PATH + "/newProperty").remove();
             session2.save();
@@ -974,7 +976,7 @@ public class RepositoryTest extends Abst
             session2.logout();
         }
 
-        Session session3 = createAnonymousSession();;
+        Session session3 = createAnonymousSession();
         try {
             assertFalse(session3.propertyExists(TEST_PATH + "/newProperty"));
         }
@@ -989,9 +991,17 @@ public class RepositoryTest extends Abst
         parentNode.addNode("newNode");
         parentNode.getSession().save();
 
-        Session session2 = createAnonymousSession();;
+        Session session2 = createAnonymousSession();
         try {
-            session2.getNode(TEST_PATH + "/newNode").remove();
+            Node removeNode = session2.getNode(TEST_PATH + "/newNode");
+            removeNode.remove();
+
+            try {
+                removeNode.getParent();
+                fail("Cannot retrieve the parent from a transiently removed item.");
+            }
+            catch (InvalidItemStateException expected) {}
+
             assertTrue(session2.getNode(TEST_PATH).isModified());
             session2.save();
         }
@@ -999,7 +1009,7 @@ public class RepositoryTest extends Abst
             session2.logout();
         }
 
-        Session session3 = createAnonymousSession();;
+        Session session3 = createAnonymousSession();
         try {
             assertFalse(session3.nodeExists(TEST_PATH + "/newNode"));
             assertFalse(session3.getNode(TEST_PATH).isModified());
@@ -1011,8 +1021,8 @@ public class RepositoryTest extends Abst
 
     @Test
     public void sessionSave() throws RepositoryException {
-        Session session1 = createAnonymousSession();;
-        Session session2 = createAnonymousSession();;
+        Session session1 = createAnonymousSession();
+        Session session2 = createAnonymousSession();
         try {
             // Add some items and ensure they are accessible through this session
             session1.getNode("/").addNode("node1");
@@ -1061,7 +1071,7 @@ public class RepositoryTest extends Abst
 
     @Test
     public void sessionRefresh() throws RepositoryException {
-        Session session = createAnonymousSession();;
+        Session session = createAnonymousSession();
         try {
             // Add some items and ensure they are accessible through this session
             session.getNode("/").addNode("node1");
@@ -1103,8 +1113,8 @@ public class RepositoryTest extends Abst
 
     @Test
     public void sessionRefreshFalse() throws RepositoryException {
-        Session session1 = createAnonymousSession();;
-        Session session2 = createAnonymousSession();;
+        Session session1 = createAnonymousSession();
+        Session session2 = createAnonymousSession();
         try {
             Node foo = session1.getNode("/foo");
             foo.addNode("added");
@@ -1124,8 +1134,8 @@ public class RepositoryTest extends Abst
 
     @Test
     public void sessionRefreshTrue() throws RepositoryException {
-        Session session1 = createAnonymousSession();;
-        Session session2 = createAnonymousSession();;
+        Session session1 = createAnonymousSession();
+        Session session2 = createAnonymousSession();
         try {
             Node foo = session1.getNode("/foo");
             foo.addNode("added");
@@ -1145,8 +1155,8 @@ public class RepositoryTest extends Abst
 
     @Test
     public void sessionIsolation() throws RepositoryException {
-        Session session1 = createAnonymousSession();;
-        Session session2 = createAnonymousSession();;
+        Session session1 = createAnonymousSession();
+        Session session2 = createAnonymousSession();
         try {
             session1.getRootNode().addNode("node1");
             session2.getRootNode().addNode("node2");
@@ -1170,8 +1180,8 @@ public class RepositoryTest extends Abst
 
     @Test
     public void saveRefreshConflict() throws RepositoryException {
-        Session session1 = createAnonymousSession();;
-        Session session2 = createAnonymousSession();;
+        Session session1 = createAnonymousSession();
+        Session session2 = createAnonymousSession();
         try {
             session1.getRootNode().addNode("node");
             session2.getRootNode().addNode("node");
@@ -1201,8 +1211,8 @@ public class RepositoryTest extends Abst
         getSession().getRootNode().addNode("node");
         getSession().save();
 
-        Session session1 = createAnonymousSession();;
-        Session session2 = createAnonymousSession();;
+        Session session1 = createAnonymousSession();
+        Session session2 = createAnonymousSession();
         try {
             session1.getNode("/node").remove();
             session2.getNode("/node").addNode("2");
@@ -1227,7 +1237,7 @@ public class RepositoryTest extends Abst
 
     @Test
     public void liveNodes() throws RepositoryException {
-        Session session = createAnonymousSession();;
+        Session session = createAnonymousSession();
         try {
             Node n1 = (Node) session.getItem(TEST_PATH);
             Node n2 = (Node) session.getItem(TEST_PATH);
@@ -1265,7 +1275,9 @@ public class RepositoryTest extends Abst
         node.addNode("target");
         session.save();
 
+        Node sourceNode = session.getNode(TEST_PATH + "/source/node");
         session.move(TEST_PATH + "/source/node", TEST_PATH + "/target/moved");
+        assertEquals("/test_node/target/moved", sourceNode.getPath());
 
         assertFalse(node.hasNode("source/node"));
         assertTrue(node.hasNode("source"));
@@ -1332,7 +1344,7 @@ public class RepositoryTest extends Abst
         testNode.setPrimaryType("nt:folder");
         getSession().save();
 
-        Session session2 = createAnonymousSession();;
+        Session session2 = createAnonymousSession();
         try {
             testNode = session2.getNode(TEST_PATH);
             assertEquals("nt:folder", testNode.getPrimaryNodeType().getName());
@@ -1409,7 +1421,7 @@ public class RepositoryTest extends Abst
         testNode.addMixin("mix:test");
         testNode.getSession().save();
 
-        Session session2 = createAnonymousSession();;
+        Session session2 = createAnonymousSession();
         try {
             mix = session2.getNode(TEST_PATH).getMixinNodeTypes();
             assertEquals(1, mix.length);
@@ -1422,7 +1434,7 @@ public class RepositoryTest extends Abst
         testNode.removeMixin("mix:test");
         testNode.getSession().save();
 
-        session2 = createAnonymousSession();;
+        session2 = createAnonymousSession();
         try {
             mix = session2.getNode(TEST_PATH).getMixinNodeTypes();
             assertEquals(0, mix.length);
@@ -1702,7 +1714,7 @@ public class RepositoryTest extends Abst
         assertTrue(added.isNew());
         getSession().save();
 
-        Session session2 = createAnonymousSession();;
+        Session session2 = createAnonymousSession();
         try {
             assertTrue(session2.propertyExists(propertyPath));
             Value value2 = session2.getProperty(propertyPath).getValue();



Mime
View raw message