Package javax.jcr.version

Examples of javax.jcr.version.Version


    public void testRestoreInvalidVersion2() throws RepositoryException {
        String invalidName;
        do {
            invalidName = createRandomString(3);
            for (VersionIterator it = versionableNode.getVersionHistory().getAllVersions(); it.hasNext();) {
                Version v = it.nextVersion();
                if (invalidName.equals(v.getName())) {
                    invalidName = null;
                    break;
                }
            }
        } while (invalidName == null);
View Full Code Here


    public void testRestoreInvalidVersion2Jcr2() throws RepositoryException {
        String invalidName;
        do {
            invalidName = createRandomString(3);
            for (VersionIterator it = versionManager.getVersionHistory(versionableNode.getPath()).getAllVersions(); it.hasNext();) {
                Version v = it.nextVersion();
                if (invalidName.equals(v.getName())) {
                    invalidName = null;
                    break;
                }
            }
        } while (invalidName == null);
View Full Code Here

     *
     * @throws javax.jcr.RepositoryException
     */
    public void testRestoreSetsBaseVersion() throws RepositoryException {
        versionableNode.restore(version, true);
        Version baseV = versionableNode.getBaseVersion();
        assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV));
    }
View Full Code Here

     *
     * @throws javax.jcr.RepositoryException
     */
    public void testRestoreSetsBaseVersionJcr2() throws RepositoryException {
        versionManager.restore(version, true);
        Version baseV = versionManager.getBaseVersion(versionableNode.getPath());
        assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV));
    }
View Full Code Here

     *
     * @throws javax.jcr.RepositoryException
     */
    public void testRestoreSetsBaseVersionJcr2_2() throws RepositoryException {
        versionManager.restore(versionableNode.getPath(), version, true);
        Version baseV = versionManager.getBaseVersion(versionableNode.getPath());
        assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV));
    }
View Full Code Here

     *
     * @throws javax.jcr.RepositoryException
     */
    public void testRestoreSetsBaseVersionJcr2_3() throws RepositoryException {
        versionManager.restore(versionableNode.getPath(), version.getName(), true);
        Version baseV = versionManager.getBaseVersion(versionableNode.getPath());
        assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV));
    }
View Full Code Here

     *
     * @throws javax.jcr.RepositoryException
     */
    public void testRestoreSetsBaseVersionJcr2_4() throws RepositoryException {
        versionManager.restore(new Version[] {version}, true);
        Version baseV = versionManager.getBaseVersion(versionableNode.getPath());
        assertTrue("Restoring a node must set node's base version in order to point to the restored version.", version.isSame(baseV));
    }
View Full Code Here

     * specified version is not part of this node's version history.
     *
     * @throws RepositoryException
     */
    public void testRestoreInvalidVersion() throws RepositoryException {
        Version vNode2 = versionableNode2.checkin();
        try {
            versionableNode.restore(vNode2, true);

            fail("VersionException expected on Node.restore(Version, boolean) if the specified version is not part of this node's version history.");
        } catch (VersionException e) {
View Full Code Here

     * specified version is not part of this node's version history.
     *
     * @throws RepositoryException
     */
    public void testRestoreInvalidVersionJcr2() throws RepositoryException {
        Version vNode2 = versionManager.checkin(versionableNode2.getPath());
        try {
            versionManager.restore(versionableNode.getPath(), vNode2, true);

            fail("VersionException expected on Node.restore(Version, boolean) if the specified version is not part of this node's version history.");
        } catch (VersionException e) {
View Full Code Here

    public void testRestoreInvalidVersion2() throws RepositoryException {
        String invalidName;
        do {
            invalidName = createRandomString(3);
            for (VersionIterator it = versionableNode.getVersionHistory().getAllVersions(); it.hasNext();) {
                Version v = it.nextVersion();
                if (invalidName.equals(v.getName())) {
                    invalidName = null;
                    break;
                }
            }
        } while (invalidName == null);
View Full Code Here

TOP

Related Classes of javax.jcr.version.Version

Copyright © 2018 www.massapicom. 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.