Package javax.jcr.version

Examples of javax.jcr.version.VersionManager.merge()


        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
View Full Code Here


        // "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
        }
    }
View Full Code Here

        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);
View Full Code Here

        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) {
View Full Code Here

        // 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
        }
    }
View Full Code Here

        // "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
        }
    }
View Full Code Here

        super.tearDown();
    }

    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());
View Full Code Here

    public void testMergeShallow() throws RepositoryException {
        String oldP2 = nodeToMerge.getProperty(nodeName2 + "/" + propertyName1).getString();

        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());
View Full Code Here

        String path = nodeToMerge.getPath();
        vmWsp2.checkin(path);
   
        // "merge" the clonedNode with the newNode from the default workspace
        vmWsp2.checkout(path);
        vmWsp2.merge(path, workspace.getName(), true);
   
        // get predecessors
        Version[] predecessors = vmWsp2.getBaseVersion(path).getPredecessors();
        // get mergeFailed property
        Property mergeFailedProperty = nodeToMerge.getProperty(jcrMergeFailed);
View Full Code Here

        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
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.