Package javax.jcr.version

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


     * @throws RepositoryException
     */
    public void testFrozenNodeType() throws RepositoryException {
        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        Version v = versionManager.checkin(path);
        Node n = v.getFrozenNode();
        String fuuid = n.getProperty("jcr:frozenPrimaryType").getValue().getString();
        String ruuid = versionableNode.getPrimaryNodeType().getName();
        assertEquals("jcr:frozenPrimaryType needs to be equal to the getPrimaryNodeType() return value.", ruuid, fuuid);
    }
View Full Code Here


    public void testFrozenChildNodeType() throws RepositoryException {
        Node n1 = versionableNode.addNode("child");
        versionableNode.getSession().save();
        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        Version v = versionManager.checkin(path);
        Node n = v.getFrozenNode().getNode("child");
        String fuuid = n.getProperty("jcr:frozenPrimaryType").getValue().getString();
        String ruuid = n1.getPrimaryNodeType().getName();
        assertEquals("jcr:frozenPrimaryType needs to be equal to the getPrimaryNodeType() return value.", ruuid, fuuid);
    }
View Full Code Here

             fail("A versionable node must be checked-out after persistent creation.");
         }
         if (!versionableNode.isCheckedOut()) {
             fail("A versionable node must be checked-out after persistent creation.");
         }
         versionManager.checkin(path);
     }

     /**
      * Test if Node.isCheckedOut() returns true, if the versionable node has
      * been checked out before.
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        version = versionManager.checkin(path);
        versionManager.checkout(path);
        version2 = versionManager.checkin(path);
        versionManager.checkout(path);
        rootVersion = versionManager.getVersionHistory(path).getRootVersion();
View Full Code Here

        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        version = versionManager.checkin(path);
        versionManager.checkout(path);
        version2 = versionManager.checkin(path);
        versionManager.checkout(path);
        rootVersion = versionManager.getVersionHistory(path).getRootVersion();

        // build a second versionable node below the testroot
        try {
View Full Code Here

        // create a version of the versionable child node
        VersionManager wVersionManager = wVersionableChildNode.getSession().getWorkspace().getVersionManager();
        String wPath = wVersionableChildNode.getPath();
        wVersionManager.checkout(wPath);
        wChildVersion = wVersionManager.checkin(wPath);
        wVersionManager.checkout(wPath);
    }


    protected void tearDown() throws Exception {
View Full Code Here

                throw new NotExecutableException("Nodes must be versionable in order to run this test.");
            }

            VersionManager versionManager = wVersionableNode.getSession().getWorkspace().getVersionManager();
            String path = wVersionableNode.getPath();
            Version v = versionManager.checkin(path);
            versionManager.checkout(path);
            wSuperuser.move(wVersionableChildNode.getPath(), wVersionableNode2.getPath() + "/" + wVersionableChildNode.getName());
            wSuperuser.save();
            wSuperuser.getWorkspace().getVersionManager().restore(new Version[]{v}, false);
View Full Code Here

     */
    public void testWorkspaceRestoreOnCheckedInNodeJcr2() throws RepositoryException {
        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        if (versionManager.isCheckedOut(path)) {
            versionManager.checkin(path);
        }
        superuser.getWorkspace().getVersionManager().restore(new Version[]{version}, true);
    }

    /**
 
View Full Code Here

     * @throws RepositoryException
     */
    public void testFrozenNodeUUUID() throws RepositoryException {
        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        Version v = versionManager.checkin(path);
        Node n = v.getFrozenNode();
        String puuid = n.getProperty(jcrUUID).getValue().getString();
        String nuuid = n.getIdentifier();
        assertEquals("jcr:uuid needs to be equal to the getIdentifier() return value.", nuuid, puuid);
    }
View Full Code Here

    public void testFrozenChildNodeUUUID() throws RepositoryException {
        versionableNode.addNode("child");
        versionableNode.getSession().save();
        VersionManager versionManager = versionableNode.getSession().getWorkspace().getVersionManager();
        String path = versionableNode.getPath();
        Version v = versionManager.checkin(path);
        Node n = v.getFrozenNode().getNode("child");
        String puuid = n.getProperty(jcrUUID).getValue().getString();
        String nuuid = n.getIdentifier();
        assertEquals("jcr:uuid needs to be equal to the getIdentifier() return value.", nuuid, puuid);
    }
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.