Package javax.jcr.version

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


        n.remove();
        session.save();

        try {
            vm.restore(version1, false);
            fail("An exception should be thrown, because a removed not cannot be restored");
        } catch (VersionException e) {
            // expected
        }
    }
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());
        Property vhProp = n.getProperty(jcrVersionHistory);
        assertEquals(PropertyType.REFERENCE, vhProp.getType());
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

        vMgr.checkpoint(n.getPath());
        Version baseVersion = vMgr.getBaseVersion(n.getPath());
        Node frozenChild = baseVersion.getFrozenNode().getNode(child.getName());
        assertEquals(child.getIdentifier(),
                frozenChild.getProperty(Property.JCR_FROZEN_UUID).getString());
        vMgr.restore(v, true);
    }
}
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.