Package javax.jcr.version

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


        n.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        n.remove();
        superuser.save();
        vMgr.restore(path, v, true);
        assertTrue(superuser.nodeExists(path));
        n = superuser.getNode(path);
        assertEquals("Property not restored", "a", n.getProperty("prop").getString());
    }
View Full Code Here


        Version v = vMgr.checkpoint(path); // 1.0
        n.setProperty("prop", "b");
        child.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        vMgr.restore(v, true);
        assertEquals("Property not restored", "a", n.getProperty("prop").getString());
        assertEquals("Property not restored", "a", child.getProperty("prop").getString());
        assertFalse("Restored node must not have jcr:frozenPrimaryType property",
                child.hasProperty(JcrConstants.JCR_FROZENPRIMARYTYPE));
    }
View Full Code Here

        n.setProperty("prop", "b");
        superuser.save();
        vMgr.checkpoint(path); // 1.1
        n.remove();
        superuser.save();
        vMgr.restore(path, v, true);
        assertTrue(superuser.nodeExists(path));
        n = superuser.getNode(path);
        assertEquals("Property not restored", "a", n.getProperty("prop").getString());
    }
}
View Full Code Here

        initialNodePath = childNode.getPath();
        versionManager.checkout(path);
        childNode.remove();
        nodeParent.getSession().save();

        versionManager.restore(v, false);

        if (!superuser.itemExists(initialNodePath)) {
            fail("On restore of a OnParentVersion-COPY child node, the node needs to be restored, replacing the current node in the workspace.");
        }
        // todo: add proper comparison of restored node. equals does not work
View Full Code Here

        initialNodePath = childNode.getPath();
        versionManager.checkout(path);
        childNode.remove();
        nodeParent.getSession().save();

        versionManager.restore(v, false);

        if (!superuser.itemExists(initialNodePath)) {
            fail("On restore of a OnParentVersion-COPY child node, the node needs to be restored, replacing the current node in the workspace.");
        }
        // todo: add proper comparison of restored node. equals does not work
View Full Code Here

        versionManager.checkout(path);

        p.setValue(newPropValue);
        p.getSession().save();

        versionManager.restore(v, false);

        assertEquals("On restore of a OnParentVersion-INITIALIZE property P, the current value of P must be left unchanged.", p.getString(), newPropValue);
    }
}
View Full Code Here

        versionManager.checkout(path);

        p.setValue(newPropValue);
        p.getSession().save();

        versionManager.restore(v, false);

        assertEquals("On restore of a OnParentVersion-IGNORE property P, the current value of P must be left unchanged.", p.getString(), newPropValue);
    }

    /**
 
View Full Code Here

        // add 'ignore' child
        String childName = addChildNode(OPVAction).getName();
        versionableNode.getSession().save();

        versionManager.restore(v, false);

        if (!versionableNode.hasNode(childName)) {
            fail("On restore of a OnParentVersion-Ignore child node, the node needs to be untouched.");
        }
    }
View Full Code Here

        versionManager.checkout(path);

        p.setValue(newPropValue);
        p.getSession().save();

        versionManager.restore(v, false);

        assertEquals("On restore of a OnParentVersion-COMPUTE property P, the current P in the workspace will be left unchanged.", p.getString(), newPropValue);
    }
}
View Full Code Here

        // check the number of children again
        assertEquals(childCount, n.getNodes().getSize());

        // restore base versiob
        Version baseVersion = vm.getBaseVersion(n.getPath());
        vm.restore(baseVersion, true);

        n.getSession().refresh(false);

        // check the number of children again
        assertEquals(childCount, n.getNodes().getSize());
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.