Examples of nextVersion()


Examples of javax.jcr.version.VersionIterator.nextVersion()

                        log.error("  child path: " + restoredChild.safeGetJCRPath());
                        log.error("  selected version: " + v.getName());
                        StringBuffer avail = new StringBuffer();
                        VersionIterator vi = history.getAllVersions();
                        while (vi.hasNext()) {
                            avail.append(vi.nextVersion().getName());
                            if (vi.hasNext()) {
                                avail.append(", ");
                            }
                        }
                        log.error("  available versions: " + avail);
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

        final Version v = mock(Version.class);
        final Version v1 = mock(Version.class);
        when(v.getCreated()).thenReturn(cal);
        when(v1.getCreated()).thenReturn(cal1);
        when(v.getName()).thenReturn("version1");
        when(vi.nextVersion()).thenReturn(v, v1);
        when(vi.hasNext()).thenReturn(true, true, false);
        when(session.getWorkspace()).thenReturn(wk);
        when(wk.getVersionManager()).thenReturn(vm);
        when(resourceResolver.adaptTo(Session.class)).thenReturn(session);
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public VersionResource[] getVersions() throws DavException {
        try {
            VersionIterator vIter = ((VersionHistory)item).getAllVersions();
            ArrayList l = new ArrayList();
            while (vIter.hasNext()) {
                DavResourceLocator versionLoc = getLocatorFromItem(vIter.nextVersion());
                DavResource vr = createResourceFromLocator(versionLoc);
                l.add(vr);
            }
            return (VersionResource[]) l.toArray(new VersionResource[l.size()]);
        } catch (RepositoryException e) {
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

                        log.error("  child path: " + restoredChild.safeGetJCRPath());
                        log.error("  selected version: " + v.getName());
                        StringBuffer avail = new StringBuffer();
                        VersionIterator vi = history.getAllVersions();
                        while (vi.hasNext()) {
                            avail.append(vi.nextVersion().getName());
                            if (vi.hasNext()) {
                                avail.append(", ");
                            }
                        }
                        log.error("  available versions: " + avail);
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

    public void testRemoveAllBut2() throws RepositoryException {
        String baseVersion = versionableNode.getBaseVersion().getName();
        VersionHistory vh = versionableNode.getVersionHistory();
        VersionIterator vi = vh.getAllVersions();
        while (vi.hasNext()) {
            Version currenVersion = vi.nextVersion();
            String versionName = currenVersion.getName();
            if (!versionName.equals("jcr:rootVersion") && !versionName.equals(baseVersion)) {
                vh.removeVersion(versionName);
            }
        }
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

        Version rootVersion = vHistory.getRootVersion();
        Version v = null;
        VersionIterator it = vHistory.getAllVersions();
        while (it.hasNext()) {
            // break after the first version, that MUST be the root version
            v = it.nextVersion();
            break;
        }
        assertEquals("The version that is autocreated on version history creation must be the root version", rootVersion, v);
    }
View Full Code Here

Examples of javax.jcr.version.VersionIterator.nextVersion()

            versionableNode.checkout();
        }

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

Examples of javax.jcr.version.VersionIterator.nextVersion()

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

Examples of javax.jcr.version.VersionIterator.nextVersion()

        // 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.nextVersion()

    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(",");
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.