119120121122123124125126127128
assertFalse(tn.internalIsCheckedOut()); } finally { readOnly.logout(); // reset the denied read-access n.checkout(); changeReadPermission(principal, n, true); } } }
15301531153215331534153515361537153815391540
phase="checkin N2 uncommitted."; tx = new UserTransactionImpl(s2); tx.begin(); n2.checkout(); n2.checkin(); Version v2_3 = n2.getBaseVersion(); check(v1_1, phase, "jcr:rootVersion", 1);
154155156157158159160161162163164
assertFalse(tn.internalIsCheckedOut()); } finally { readOnly.logout(); // reset the denied read-access n.checkout(); changeReadPermission(principal, n, true); } } public void testAddNodeUuid() throws RepositoryException, NotExecutableException {
6768697071727374757677
public Version checkpoint(String absPath) throws RepositoryException { // this is not quite correct, since the entire checkpoint operation // should be atomic Node node = session.getNode(absPath); Version v = node.checkin(); node.checkout(); return v; } /** * {@inheritDoc}
7576777879808182838485
/** * @see javax.jcr.version.VersionManager#checkout(String) */ public void checkout(String absPath) throws UnsupportedRepositoryOperationException, LockException, RepositoryException { Node n = itemManager.getNode(resolver.getQPath(absPath)); n.checkout(); } /** * @see javax.jcr.version.VersionManager#checkpoint(String) */
317318319320321322323324325326327
return child; } public void testSetRetentionPolicyOnCheckedInNode() throws NotExecutableException, RepositoryException { Node child = getVersionableChildNode(); child.checkout(); child.checkin(); String childPath = child.getPath(); // get another session. Session otherS = helper.getSuperuserSession();
346347348349350351352353354355356
} } public void testRemoveRetentionPolicyOnCheckedInNode() throws NotExecutableException, RepositoryException { Node child = getVersionableChildNode(); child.checkout(); retentionMgr.setRetentionPolicy(child.getPath(), getApplicableRetentionPolicy()); superuser.save(); child.checkin(); Session otherS = helper.getSuperuserSession();
363364365366367368369370371372373
// success } finally { otherS.logout(); // clear policy added before child.checkout(); try { retentionMgr.removeRetentionPolicy(child.getPath()); superuser.save(); } catch (RepositoryException e) { // should not get here if test is correctly executed.
324325326327328329330331332333334
return child; } public void testAddHoldOnCheckedInNode() throws NotExecutableException, RepositoryException { Node child = getVersionableChildNode(); child.checkout(); child.checkin(); // get another session. javax.jcr.Session otherS = helper.getSuperuserSession(); try {
341342343344345346347348349350351
// success } finally { otherS.logout(); // clear holds (in case of test failure) child.checkout(); Hold[] holds = retentionMgr.getHolds(child.getPath()); for (int i = 0; i < holds.length; i++) { retentionMgr.removeHold(child.getPath(), holds[i]); } superuser.save();