jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r801213 - in /jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version: MergeShallowTest.java TestAll.java
Date Wed, 05 Aug 2009 13:11:56 GMT
Author: tripod
Date: Wed Aug  5 13:11:56 2009
New Revision: 801213

URL: http://svn.apache.org/viewvc?rev=801213&view=rev
Log:
JCR-2085 test case (TCK) maintenance for JCR 2.0
- adding shallow merge test [VersionManager.merge(String, String, boolean, boolean)]

Added:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeShallowTest.java
      - copied, changed from r801141, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java
Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java

Copied: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeShallowTest.java
(from r801141, jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java)
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeShallowTest.java?p2=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeShallowTest.java&p1=jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java&r1=801141&r2=801213&rev=801213&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeNodeTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/MergeShallowTest.java
Wed Aug  5 13:11:56 2009
@@ -16,45 +16,34 @@
  */
 package org.apache.jackrabbit.test.api.version;
 
-import org.apache.jackrabbit.test.NotExecutableException;
-
-import javax.jcr.version.VersionException;
-import javax.jcr.version.VersionManager;
 import javax.jcr.Node;
+import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
-import javax.jcr.InvalidItemStateException;
-import javax.jcr.NoSuchWorkspaceException;
-import javax.jcr.Property;
-import javax.jcr.Value;
-import javax.jcr.MergeException;
-import javax.jcr.Session;
-import javax.jcr.Repository;
-import javax.jcr.lock.LockException;
+import javax.jcr.version.VersionManager;
 
 /**
- * <code>MergeNodeTest</code> contains tests dealing with general merge node
- * calls.
+ * <code>MergeShallowTest</code> contains tests dealing with general shallow
+ * merge calls.
  *
  * @test
- * @sources MergeNodeTest.java
- * @executeClass org.apache.jackrabbit.test.api.version.MergeNodeTest
+ * @sources MergeShallowTest.java
+ * @executeClass org.apache.jackrabbit.test.api.version.MergeShallowTest
  * @keywords versioning
  */
 
-public class MergeNodeTest extends AbstractMergeTest {
+public class MergeShallowTest extends AbstractMergeTest {
 
     /**
      * node to merge
      */
     Node nodeToMerge;
 
+    String newValue;
+
     protected void setUp() throws Exception {
         super.setUp();
 
         nodeToMerge = testRootNodeW2.getNode(nodeName1);
-        // node has to be checked out while merging
-        VersionManager versionManager = nodeToMerge.getSession().getWorkspace().getVersionManager();
-        versionManager.checkout(nodeToMerge.getPath());
 
     }
 
@@ -63,486 +52,48 @@
         super.tearDown();
     }
 
-    /**
-     * Node.merge(): InvalidItemStateException if unsaved changes within the
-     * current Session<br>
-     */
-    public void testMergeNodeWithUnsavedStates() throws RepositoryException {
-        // set a property and do not save workspace
-        nodeToMerge.setProperty(propertyName1, CHANGED_STRING);
-        try {
-            nodeToMerge.merge(workspace.getName(), false);
-            fail("InvalidItemStateException if unsaved changes within the current Session
was expected.");
-        } catch (InvalidItemStateException e) {
-            // success
-        }
-    }
-
-    /**
-     * VersionManager.merge(): InvalidItemStateException if unsaved changes within the
-     * current Session<br>
-     */
-    public void testMergeNodeWithUnsavedStatesJcr2() throws RepositoryException {
-        // set a property and do not save workspace
-        nodeToMerge.setProperty(propertyName1, CHANGED_STRING);
-        try {
-            nodeToMerge.getSession().getWorkspace().getVersionManager().merge(
-                    nodeToMerge.getPath(), workspace.getName(), false);
-            fail("InvalidItemStateException if unsaved changes within the current Session
was expected.");
-        } catch (InvalidItemStateException e) {
-            // success
-        }
-    }
-
-    /**
-     * Perform a merge on a node with a unkwnown workspacename
-     */
-    public void testMergeUnknownWorkspaceName() throws RepositoryException {
-        try {
-            nodeToMerge.merge(getNonExistingWorkspaceName(superuser), false);
-        } catch (NoSuchWorkspaceException e) {
-            // success expected exception
-        }
-    }
-
-    /**
-     * Perform a merge on a node with a unkwnown workspacename
-     */
-    public void testMergeUnknownWorkspaceNameJcr2() throws RepositoryException {
-        try {
-            nodeToMerge.getSession().getWorkspace().getVersionManager().merge(
-                    nodeToMerge.getPath(), getNonExistingWorkspaceName(superuser), false);
-        } catch (NoSuchWorkspaceException e) {
-            // success expected exception
-        }
-    }
-
-    /**
-     * Node.merge(): If this node does not have a corresponding node in the
-     * indicated workspace <br> then the merge method returns quietly and no
-     * changes are made.<br>
-     */
-    public void testMergeNodeNonCorrespondingNode() throws RepositoryException {
-        // create new node - this node has no corresponding node in default workspace
-        Node subNode = nodeToMerge.addNode(nodeName3, versionableNodeType);
-        subNode.setProperty(propertyName1, CHANGED_STRING);
-        superuserW2.save();
-        subNode.checkin();
-
-        subNode.merge(workspace.getName(), true);
-        assertTrue(subNode.getProperty(propertyName1).getString().equals(CHANGED_STRING));
-    }
-
-    /**
-     * VersionManager.merge(): If this node does not have a corresponding node in the
-     * indicated workspace <br> then the merge method returns quietly and no
-     * changes are made.<br>
-     */
-    public void testMergeNodeNonCorrespondingNodeJcr2() throws RepositoryException {
-        // create new node - this node has no corresponding node in default workspace
-        Node subNode = nodeToMerge.addNode(nodeName3, versionableNodeType);
-        subNode.setProperty(propertyName1, CHANGED_STRING);
-        superuserW2.save();
-        VersionManager versionManager = subNode.getSession().getWorkspace().getVersionManager();
-        String path = subNode.getPath();
-        versionManager.checkin(path);
-
-        versionManager.merge(path, workspace.getName(), true);
-        assertTrue(subNode.getProperty(propertyName1).getString().equals(CHANGED_STRING));
-    }
-
-    /**
-     * Node.merge(): versionable subNode N checked-in: If V is neither a
-     * successor of, predecessor of, nor identical with V', then the merge
-     * result for N is failed<br>
-     */
-    public void testMergeNodeVersionAmbiguous() throws RepositoryException {
-        // create 2 independent versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        originalNode.checkout();
-        originalNode.checkin();
-
-        // second workspace
-        nodeToMerge.checkin();
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // besteffort set to false to stop at the first failure
-        try {
-            nodeToMerge.checkout();
-            nodeToMerge.merge(workspace.getName(), false);
-            fail("Node has ambigous versions. Merge must throw a MergeException");
-        } catch (MergeException e) {
-            // success if the merge exception thrown
-        }
-    }
-
-    /**
-     * VersionManager.merge(): versionable subNode N checked-in: If V is neither a
-     * successor of, predecessor of, nor identical with V', then the merge
-     * result for N is failed<br>
-     */
-    public void testMergeNodeVersionAmbiguousJcr2() throws RepositoryException {
-        // create 2 independent versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        VersionManager vmWsp1 = originalNode.getSession().getWorkspace().getVersionManager();
-        String originalPath = originalNode.getPath();
-        vmWsp1.checkout(originalPath);
-        vmWsp1.checkin(originalPath);
-
-        // second workspace
-        VersionManager vmWsp2 = nodeToMerge.getSession().getWorkspace().getVersionManager();
-        String path = nodeToMerge.getPath();
-        vmWsp2.checkin(path);
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // besteffort set to false to stop at the first failure
-        try {
-            vmWsp2.checkout(path);
-            vmWsp2.merge(path, workspace.getName(), false);
-            fail("Node has ambigous versions. Merge must throw a MergeException");
-        } catch (MergeException e) {
-            // success if the merge exception thrown
-        }
-    }
-
-    /**
-     * Node.merge(): bestEffort is true > any merge-failure (represented by the
-     * version in the workspace) is reported in the jcrMergeFailed property<br>
-     */
-    public void testMergeNodeBestEffortTrueCheckMergeFailedProperty() throws RepositoryException
{
-        // create 2 independent versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        originalNode.checkout();
-        originalNode.checkin();
-
-        // second workspace
-        nodeToMerge.checkin();
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // besteffort set to true to report all failures
-        nodeToMerge.checkout();
-        nodeToMerge.merge(workspace.getName(), true);
-
-        // success merge exception was raised as expected
-        // jcrMergeFailed should contains reference to the V' as it is a different branche
-        String expectedReferenceUUID = originalNode.getBaseVersion().getUUID();
-        Property mergeFailedProperty = nodeToMerge.getProperty(jcrMergeFailed);
-        Value[] references = mergeFailedProperty.getValues();
-        boolean referenceFound = false;
-        if (references != null) {
-            for (int i = 0; i < references.length; i++) {
-                String referenceUUID = references[i].getString();
-                if (referenceUUID.equals(expectedReferenceUUID)) {
-                    referenceFound = true;
-                    break; // it's not necessary to loop thru all the references
-                }
-            }
-
-            assertTrue("reference to expected version that give the failure wasnt found in
the mergeFailed", referenceFound);
-        }
-    }
-
-    /**
-     * VersionManager.merge(): bestEffort is true > any merge-failure (represented by
the
-     * version in the workspace) is reported in the jcrMergeFailed property<br>
-     */
-    public void testMergeNodeBestEffortTrueCheckMergeFailedPropertyJcr2() throws RepositoryException
{
-        // create 2 independent versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        VersionManager vmWsp1 = originalNode.getSession().getWorkspace().getVersionManager();
-        String originalPath = originalNode.getPath();
-        vmWsp1.checkout(originalPath);
-        vmWsp1.checkin(originalPath);
-
-        // second workspace
-        VersionManager vmWsp2 = nodeToMerge.getSession().getWorkspace().getVersionManager();
-        String path = nodeToMerge.getPath();
-        vmWsp2.checkin(path);
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // besteffort set to true to report all failures
-        vmWsp2.checkout(path);
-        vmWsp2.merge(path, workspace.getName(), true);
-
-        // success merge exception was raised as expected
-        // jcrMergeFailed should contains reference to the V' as it is a different branche
-        String expectedReferenceUUID = originalNode.getBaseVersion().getUUID();
-        Property mergeFailedProperty = nodeToMerge.getProperty(jcrMergeFailed);
-        Value[] references = mergeFailedProperty.getValues();
-        boolean referenceFound = false;
-        if (references != null) {
-            for (int i = 0; i < references.length; i++) {
-                String referenceUUID = references[i].getString();
-                if (referenceUUID.equals(expectedReferenceUUID)) {
-                    referenceFound = true;
-                    break; // it's not necessary to loop thru all the references
-                }
+    public void testMergeRecursive() throws RepositoryException {
+        VersionManager vm2 = testRootNodeW2.getSession().getWorkspace().getVersionManager();
+        NodeIterator iter = vm2.merge(nodeToMerge.getPath(),
+                superuser.getWorkspace().getName(), true, false);
+        if (iter.hasNext()) {
+            StringBuffer failed = new StringBuffer();
+            while (iter.hasNext()) {
+                failed.append(iter.nextNode().getPath());
+                failed.append(", ");
             }
-
-            assertTrue("reference to expected version that give the failure wasnt found in
the mergeFailed", referenceFound);
-        }
-    }
-
-    /**
-     * if mergeFailedProperty is present > VersionException<br>
-     */
-    public void disable_testMergeNodeForceFailure() throws RepositoryException {
-        // create 2 independent versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        originalNode.checkout();
-        originalNode.checkin();
-
-        // second workspace
-        nodeToMerge.checkin();
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // besteffort set to true to report all failures
-        nodeToMerge.checkout();
-        nodeToMerge.merge(workspace.getName(), true);
-
-        try {
-            nodeToMerge.merge(workspace.getName(), true);
-            fail("Merge failed for node in earlier merge operations. Because the mergeFailedProperty
is present, merge must throw a VersionException");
-        } catch (VersionException e) {
-            // success version exception expected
-        }
-    }
-
-    /**
-     * if mergeFailedProperty is present > VersionException<br>
-     */
-    public void disable_testMergeNodeForceFailureJcr2() throws RepositoryException {
-        // create 2 independent versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        VersionManager vmWsp1 = originalNode.getSession().getWorkspace().getVersionManager();
-        String originalPath = originalNode.getPath();
-        vmWsp1.checkout(originalPath);
-        vmWsp1.checkin(originalPath);
-
-        // second workspace
-        VersionManager vmWsp2 = nodeToMerge.getSession().getWorkspace().getVersionManager();
-        String path = nodeToMerge.getPath();
-        vmWsp2.checkin(path);
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // besteffort set to true to report all failures
-        vmWsp2.checkout(path);
-        vmWsp2.merge(path, workspace.getName(), true);
-
-        try {
-            vmWsp2.merge(path, workspace.getName(), true);
-            fail("Merge failed for node in earlier merge operations. Because the mergeFailedProperty
is present, merge must throw a VersionException");
-        } catch (VersionException e) {
-            // success version exception expected
+            fail("Merge must not fail. failed nodes: " + failed);
+            return;
         }
-    }
 
-    /**
-     * Node.merge(): bestEffort is false and any merge fails a MergeException is
-     * thrown.<br>
-     */
-    public void testMergeNodeBestEffortFalse() throws RepositoryException {
-        /// create successor versions for a node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        originalNode.checkout();
-        originalNode.checkin();
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // merge, besteffort set to false
-        try {
-            nodeToMerge.merge(workspace.getName(), false);
-            fail("bestEffort is false and any merge should throw a MergeException.");
-        } catch (MergeException e) {
-            // successful
-        }
-    }
-
-    /**
-     * VersionManager.merge(): bestEffort is false and any merge fails a MergeException is
-     * thrown.<br>
-     */
-    public void testMergeNodeBestEffortFalseJcr2() throws RepositoryException {
-        /// create successor versions for a node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        VersionManager vmWsp1 = originalNode.getSession().getWorkspace().getVersionManager();
-        String originalPath = originalNode.getPath();
-        vmWsp1.checkout(originalPath);
-        vmWsp1.checkin(originalPath);
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        // merge, besteffort set to false
-        try {
-            nodeToMerge.getSession().getWorkspace().getVersionManager().merge(
-                    nodeToMerge.getPath(), workspace.getName(), false);
-            fail("bestEffort is false and any merge should throw a MergeException.");
-        } catch (MergeException e) {
-            // successful
-        }
-    }
-
-    /**
-     * A MergeVersionException is thrown if bestEffort is false and a
-     * versionable node is encountered whose corresponding node's base version
-     * is on a divergent branch from this node's base version.
-     */
-    public void testMergeNodeBestEffortFalseAmbiguousVersions() throws RepositoryException
{
-        /// create 2 independent base versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        originalNode.checkout();
-        originalNode.checkin();
-
-        // second workspace
-        nodeToMerge.checkin();
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        nodeToMerge.checkout();
-
-        // merge, besteffort set to false
-        try {
-            nodeToMerge.merge(workspace.getName(), false);
-            fail("BestEffort is false and corresponding node's version is ambiguous. Merge
should throw a MergeException.");
-        } catch (MergeException e) {
-            // successful
-        }
-    }
+        String p1 = nodeToMerge.getProperty(propertyName1).getString();
+        String p2 = nodeToMerge.getProperty(nodeName2 + "/" + propertyName1).getString();
+        assertEquals("Recurisve merge did not restore property on level 1.", newValue, p1);
+        assertEquals("Recurisve merge did not restore property on level 2.", newValue, p2);
 
-    /**
-     * A MergeVersionException is thrown if bestEffort is false and a
-     * versionable node is encountered whose corresponding node's base version
-     * is on a divergent branch from this node's base version.
-     */
-    public void testMergeNodeBestEffortFalseAmbiguousVersionsJcr2() throws RepositoryException
{
-        /// create 2 independent base versions for a node and its corresponding node
-        // so merge fails for this node
-
-        // default workspace
-        Node originalNode = testRootNode.getNode(nodeName1);
-        VersionManager vmWsp1 = originalNode.getSession().getWorkspace().getVersionManager();
-        String originalPath = originalNode.getPath();
-        vmWsp1.checkout(originalPath);
-        vmWsp1.checkin(originalPath);
-
-        // second workspace
-        VersionManager vmWsp2 = nodeToMerge.getSession().getWorkspace().getVersionManager();
-        String path = nodeToMerge.getPath();
-        vmWsp2.checkin(path);
-
-        // "merge" the clonedNode with the newNode from the default workspace
-        vmWsp2.checkout(path);
-
-        // merge, besteffort set to false
-        try {
-            vmWsp2.merge(path, workspace.getName(), false);
-            fail("BestEffort is false and corresponding node's version is ambiguous. Merge
should throw a MergeException.");
-        } catch (MergeException e) {
-            // successful
-        }
     }
 
-    /**
-     * Tests if a {@link LockException} is thrown when merge is called on a
-     * locked node.
-     * @throws NotExecutableException if repository does not support locking.
-     */
-    public void disable_testMergeLocked()
-            throws NotExecutableException, RepositoryException {
+    public void testMergeShallow() throws RepositoryException {
+        String oldP2 = nodeToMerge.getProperty(nodeName2 + "/" + propertyName1).getString();
 
-        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
-            throw new NotExecutableException("Locking is not supported.");
-        }
-
-        // try to make nodeToMerge lockable if it is not
-        ensureMixinType(nodeToMerge, mixLockable);
-        nodeToMerge.getParent().save();
-
-        // lock the node
-        // remove first slash of path to get rel path to root
-        String pathRelToRoot = nodeToMerge.getPath().substring(1);
-        // access node through another session to lock it
-        Session session2 = getHelper().getSuperuserSession();
-        try {
-            Node node2 = session2.getRootNode().getNode(pathRelToRoot);
-            node2.lock(false, false);
-
-            try {
-                nodeToMerge.merge(workspace.getName(), false);
-                fail("merge must throw a LockException if applied on a " +
-                        "locked node");
-            } catch (LockException e) {
-                // success
+        VersionManager vm2 = testRootNodeW2.getSession().getWorkspace().getVersionManager();
+        NodeIterator iter = vm2.merge(nodeToMerge.getPath(),
+                superuser.getWorkspace().getName(), true, true);
+        if (iter.hasNext()) {
+            StringBuffer failed = new StringBuffer();
+            while (iter.hasNext()) {
+                failed.append(iter.nextNode().getPath());
+                failed.append(", ");
             }
-
-            node2.unlock();
-        } finally {
-            session2.logout();
-        }
-    }
-
-    /**
-     * Tests if a {@link LockException} is thrown when merge is called on a
-     * locked node.
-     * @throws NotExecutableException if repository does not support locking.
-     */
-    public void disable_testMergeLockedJcr2()
-            throws NotExecutableException, RepositoryException {
-
-        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
-            throw new NotExecutableException("Locking is not supported.");
+            fail("Merge must not fail. failed nodes: " + failed);
+            return;
         }
 
-        // try to make nodeToMerge lockable if it is not
-        ensureMixinType(nodeToMerge, mixLockable);
-        nodeToMerge.getParent().getSession().save();
-
-        // lock the node
-        // remove first slash of path to get rel path to root
-        String pathRelToRoot = nodeToMerge.getPath().substring(1);
-        // access node through another session to lock it
-        Session session2 = getHelper().getSuperuserSession();
-        try {
-            Node node2 = session2.getRootNode().getNode(pathRelToRoot);
-            node2.getSession().getWorkspace().getLockManager().lock(node2.getPath(), false,
false, 60, "");
-
-            try {
-                nodeToMerge.getSession().getWorkspace().getVersionManager().merge(
-                        nodeToMerge.getPath(), workspace.getName(), false);
-                fail("merge must throw a LockException if applied on a " +
-                        "locked node");
-            } catch (LockException e) {
-                // success
-            }
+        String p1 = nodeToMerge.getProperty(propertyName1).getString();
+        String p2 = nodeToMerge.getProperty(nodeName2 + "/" + propertyName1).getString();
+        assertEquals("Shallow merge did not restore property on level 1.", newValue, p1);
+        assertEquals("Shallow merge did restore property on level 2.", oldP2, p2);
 
-            node2.getSession().getWorkspace().getLockManager().unlock(node2.getPath());
-        } finally {
-            session2.logout();
-        }
     }
 
     /**
@@ -558,10 +109,16 @@
         topVNode.setProperty(propertyName1, topVNode.getName());
         String path = topVNode.getPath();
 
+        // create a versionable sub node
+        // nodeName1/nodeName2
+        Node subNvNode = topVNode.addNode(nodeName2, versionableNodeType);
+        subNvNode.setProperty(propertyName1, subNvNode.getName());
+        String path2 = subNvNode.getPath();
+
         // save default workspace
         testRootNode.getSession().save();
         versionManager.checkin(path);
-        versionManager.checkout(path);
+        versionManager.checkin(path2);
 
         log.println("test nodes created successfully on " + workspace.getName());
 
@@ -572,5 +129,21 @@
         log.println(topVNode.getPath() + " cloned on " + superuserW2.getWorkspace().getName()
+ " at " + topVNode.getPath());
 
         testRootNodeW2 = (Node) superuserW2.getItem(testRoot);
+
+        versionManager.checkout(path);
+        versionManager.checkout(path2);
+
+        // update properties on source nodes
+        newValue = String.valueOf(System.currentTimeMillis());
+
+        Node n1 = testRootNode.getNode(nodeName1);
+        n1.setProperty(propertyName1, newValue);
+        Node n2 = n1.getNode(nodeName2);
+        n2.setProperty(propertyName1, newValue);
+        testRootNode.getSession().save();
+
+        VersionManager vm1 = testRootNode.getSession().getWorkspace().getVersionManager();
+        vm1.checkpoint(n2.getPath());
+        vm1.checkpoint(n1.getPath());
     }
-}
+}
\ No newline at end of file

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java?rev=801213&r1=801212&r2=801213&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/version/TestAll.java
Wed Aug  5 13:11:56 2009
@@ -64,6 +64,7 @@
         suite.addTestSuite(MergeDoneMergeTest.class);
         suite.addTestSuite(MergeNodeIteratorTest.class);
         suite.addTestSuite(MergeNodeTest.class);
+        suite.addTestSuite(MergeShallowTest.class);
         suite.addTestSuite(MergeNonVersionableSubNodeTest.class);
         suite.addTestSuite(MergeSubNodeTest.class);
         



Mime
View raw message