use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class ReadVersionContentTest method testVersionHistoryGetUUID.
/**
* @since oak
*/
@Test
public void testVersionHistoryGetUUID() throws Exception {
VersionHistory testVh = testSession.getNode(versionablePath).getVersionHistory();
testVh.getUUID();
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class ReadVersionContentTest method testVersionHistoryGetVersionableUUID.
/**
* @since oak
*/
@Test
public void testVersionHistoryGetVersionableUUID() throws Exception {
VersionHistory testVh = testSession.getNode(versionablePath).getVersionHistory();
testVh.getVersionableUUID();
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class ReadVersionContentTest method testAccessVersionHistoryVersionableNodeRemoved.
/**
* @since oak
*/
@Test
public void testAccessVersionHistoryVersionableNodeRemoved() throws Exception {
superuser.getNode(versionablePath).remove();
superuser.save();
testSession.refresh(false);
assertTrue(testSession.nodeExists(path));
assertFalse(testSession.nodeExists(versionablePath));
// accessing the version history directly should still succeed as
// read permission is still granted on the tree defined by the parent.
VersionHistory history = (VersionHistory) testSession.getNode(vh.getPath());
history = (VersionHistory) testSession.getNodeByIdentifier(vh.getIdentifier());
history = (VersionHistory) testSession.getNodeByUUID(vh.getUUID());
// revoking read permission on the parent node -> version history
// must no longer be accessible
modify(path, Privilege.JCR_READ, false);
assertFalse(testSession.nodeExists(vh.getPath()));
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class ReadVersionContentTest method testVersionHistoryGetVersionableIdentifier.
/**
* @since oak
*/
@Test
public void testVersionHistoryGetVersionableIdentifier() throws Exception {
VersionHistory testVh = testSession.getNode(versionablePath).getVersionHistory();
testVh.getVersionableIdentifier();
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class VersionHistoryTest method testGetNodeByUUID.
@SuppressWarnings("deprecation")
public void testGetNodeByUUID() throws RepositoryException {
Node n = testRootNode.addNode(nodeName1, testNodeType);
n.addMixin(mixVersionable);
superuser.save();
VersionManager vMgr = superuser.getWorkspace().getVersionManager();
String uuid = vMgr.getVersionHistory(n.getPath()).getUUID();
assertTrue("Session.getNodeByUUID() did not return VersionHistory object for a nt:versionHistory node.", superuser.getNodeByUUID(uuid) instanceof VersionHistory);
}
Aggregations