use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class VersionHistoryTest method testGetVersionHistory.
public void testGetVersionHistory() throws Exception {
Node n = testRootNode.addNode(nodeName1, testNodeType);
n.addMixin(JcrConstants.MIX_VERSIONABLE);
superuser.save();
VersionHistory vh = versionManager.getVersionHistory(n.getPath());
assertNotNull(vh);
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class VersionHistoryTest method testGetVersionHistory2.
public void testGetVersionHistory2() throws Exception {
Node n = testRootNode.addNode(nodeName1, testNodeType);
n.addMixin(JcrConstants.MIX_VERSIONABLE);
superuser.save();
Session s = getHelper().getSuperuserSession();
try {
VersionHistory vh = s.getWorkspace().getVersionManager().getVersionHistory(n.getPath());
assertNotNull(vh);
} finally {
s.logout();
}
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class VersionHistoryTest method testGetVersionHistoryFromNode.
public void testGetVersionHistoryFromNode() throws Exception {
Node n = testRootNode.addNode(nodeName1, testNodeType);
n.addMixin(JcrConstants.MIX_VERSIONABLE);
superuser.save();
VersionHistory vh = n.getVersionHistory();
assertNotNull(vh);
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class VersionHistoryTest method testGetNodeByIdentifier.
public void testGetNodeByIdentifier() throws RepositoryException {
Node n = testRootNode.addNode(nodeName1, testNodeType);
n.addMixin(mixVersionable);
superuser.save();
VersionManager vMgr = superuser.getWorkspace().getVersionManager();
String id = vMgr.getVersionHistory(n.getPath()).getIdentifier();
assertTrue("Session.getNodeByIdentifier() did not return VersionHistory object for a nt:versionHistory node.", superuser.getNodeByIdentifier(id) instanceof VersionHistory);
}
use of javax.jcr.version.VersionHistory in project jackrabbit-oak by apache.
the class BrokenVersionableTest method verifyNoVersionable.
@Test
public void verifyNoVersionable() throws RepositoryException {
Session session = createAdminSession();
VersionManager vMgr = session.getWorkspace().getVersionManager();
try {
assertFalse(session.getNode("/versionable1").isNodeType(MIX_VERSIONABLE));
Node versionable2 = session.getNode("/versionable2");
assertTrue(versionable2.isNodeType(MIX_VERSIONABLE));
VersionHistory history = vMgr.getVersionHistory(versionable2.getPath());
VersionIterator versions = history.getAllVersions();
assertEquals("jcr:rootVersion", versions.nextVersion().getName());
assertFalse(versions.hasNext());
} finally {
session.logout();
}
}
Aggregations