jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1447359 - /jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
Date Mon, 18 Feb 2013 16:02:55 GMT
Author: angela
Date: Mon Feb 18 16:02:55 2013
New Revision: 1447359

URL: http://svn.apache.org/r1447359
Log:
OAK-444: test

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java?rev=1447359&r1=1447358&r2=1447359&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/version/VersionablePathsTest.java
Mon Feb 18 16:02:55 2013
@@ -87,7 +87,7 @@ public class VersionablePathsTest extend
         node1.addMixin(JcrConstants.MIX_VERSIONABLE);
         superuser.save();
 
-        String destPath = node2.getPath() + "/" + nodeName1;
+        String destPath = node2.getPath() + '/' + nodeName1;
         superuser.move(node1.getPath(), destPath);
         superuser.save();
 
@@ -101,4 +101,27 @@ public class VersionablePathsTest extend
         assertTrue(vh.hasProperty(workspaceName));
         assertEquals(node1.getPath(), vh.getProperty(workspaceName).getString());
     }
+
+    @Test
+    public void testVersionablePathsAfterParentMove() throws Exception {
+        Node node1 = testRootNode.addNode(nodeName1);
+        Node node3 = node1.addNode(nodeName3);
+        Node node2 = testRootNode.addNode(nodeName2);
+        node3.addMixin(JcrConstants.MIX_VERSIONABLE);
+        superuser.save();
+
+        String destPath = node2.getPath() + '/' + nodeName1;
+        superuser.move(node1.getPath(), destPath);
+        superuser.save();
+
+        // FIXME: node3 is stale after move
+        node3 = node2.getNode(nodeName1 + '/' + nodeName3);
+        assertEquals(destPath + '/' + nodeName3, node3.getPath());
+
+        Node vh = getVersionManager().getVersionHistory(node3.getPath());
+        assertTrue(vh.isNodeType("rep:VersionablePaths"));
+        String workspaceName = superuser.getWorkspace().getName();
+        assertTrue(vh.hasProperty(workspaceName));
+        assertEquals(node3.getPath(), vh.getProperty(workspaceName).getString());
+    }
 }
\ No newline at end of file



Mime
View raw message