Examples of VersionIterator


Examples of javax.jcr.version.VersionIterator

            v = versionableNode.checkin();
            versions.put(v.getUUID(), v);
            versionableNode.checkout();
        }

        VersionIterator it = vHistory.getAllVersions();
        while (it.hasNext()) {
            v = it.nextVersion();
            if (!versions.containsKey(v.getUUID())) {
                fail("VersionHistory.getAllVersions() must only contain the root version and versions, that have been created by a Node.checkin() call.");
            }
            versions.remove(v.getUUID());
        }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

            v = versionManager.checkin(versionableNode.getPath());
            versions.put(v.getIdentifier(), v);
            versionManager.checkout(versionableNode.getPath());
        }

        VersionIterator it = vHistory.getAllVersions();
        while (it.hasNext()) {
            v = it.nextVersion();
            if (!versions.containsKey(v.getIdentifier())) {
                fail("VersionHistory.getAllVersions() must only contain the root version and versions, that have been created by a Node.checkin() call.");
            }
            versions.remove(v.getIdentifier());
        }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * Tests if restore on simple versioning creates a new version that is
     * in the correct linear order.
     */
    public void testLinearVersions() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionableNode.getVersionHistory().getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionableNode.restore(version, true);
        // append new base version
        expected.append(versionableNode.getBaseVersion().getName()).append(",");

        // get the version names again
        iter = versionableNode.getVersionHistory().getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * Tests if restore on simple versioning creates a new version that is
     * in the correct linear order.
     */
    public void testLinearVersionsJcr2() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionManager.restore(version, true);
        // append new base version
        expected.append(versionManager.getBaseVersion(versionableNode.getPath()).getName()).append(",");

        // get the version names again
        iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * Tests if restore on simple versioning creates a new version that is
     * in the correct linear order.
     */
    public void testLinearVersionsJcr2_2() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionManager.restore(version, true);
        // append new base version
        expected.append(versionManager.getBaseVersion(versionableNode.getPath()).getName()).append(",");

        // get the version names again
        iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * Tests if restore on simple versioning creates a new version that is
     * in the correct linear order.
     */
    public void testLinearVersionsJcr2_3() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionManager.restore(versionableNode.getPath(), version.getName(), true);
        // append new base version
        expected.append(versionManager.getBaseVersion(versionableNode.getPath()).getName()).append(",");

        // get the version names again
        iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * Tests if restore on simple versioning creates a new version that is
     * in the correct linear order.
     */
    public void testLinearVersionsJcr2_4() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionManager.restore(new Version[] {version}, true);
        // append new base version
        expected.append(versionManager.getBaseVersion(versionableNode.getPath()).getName()).append(",");

        // get the version names again
        iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

        };
        // print header
        PrintHelper.printRow(ctx, width, header);
        // print separator
        PrintHelper.printSeparatorRow(ctx, width, '-');
        VersionIterator iter = n.getVersionHistory().getAllVersions();
        while (iter.hasNext()) {
            Version v = iter.nextVersion();
            Collection row = new ArrayList();
            row.add(v.getName());
            row.add(Arrays.asList(n.getVersionHistory().getVersionLabels(v)));
            PrintHelper.printRow(ctx, width, row);
        }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * in the correct linear order.
     */
    @SuppressWarnings("deprecation")
    public void testLinearVersions() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionableNode.getVersionHistory().getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionableNode.restore(version, true);
        // append new base version
        expected.append(versionableNode.getBaseVersion().getName()).append(",");

        // get the version names again
        iter = versionableNode.getVersionHistory().getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator

     * Tests if restore on simple versioning creates a new version that is
     * in the correct linear order.
     */
    public void testLinearVersionsJcr2() throws Exception {
        // first get all linear versions
        VersionIterator iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer expected = new StringBuffer();
        while (iter.hasNext()) {
            expected.append(iter.nextVersion().getName()).append(",");
        }
        // restore version
        versionManager.restore(version, true);
        // append new base version
        expected.append(versionManager.getBaseVersion(versionableNode.getPath()).getName()).append(",");

        // get the version names again
        iter = versionManager.getVersionHistory(versionableNode.getPath()).getAllLinearVersions();
        StringBuffer actual = new StringBuffer();
        while (iter.hasNext()) {
            actual.append(iter.nextVersion().getName()).append(",");
        }
        assertEquals("Node.restore() on simple versioning must create a new version.",
                expected.toString(), actual.toString());
    }
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.