/**
* Tests if <code>VersionHistory.lock(boolean, boolean)</code> throws a
* {@link javax.jcr.lock.LockException}
*/
public void testLockJcr2() throws Exception {
LockManager lockManager = vHistory.getSession().getWorkspace().getLockManager();
String path = vHistory.getPath();
try {
lockManager.lock(path, true, true, 60, "");
fail("VersionHistory should not be lockable: VersionHistory.lock(true,true) did not throw a LockException");
} catch (LockException success) {
}
try {
lockManager.lock(path, true, false, 60, "");
fail("VersionHistory should not be lockable: VersionHistory.lock(true,false) did not throw a LockException");
} catch (LockException success) {
}
try {
lockManager.lock(path, false, true, 60, "");
fail("VersionHistory should not be lockable: VersionHistory.lock(false,true) did not throw a LockException");
} catch (LockException success) {
}
try {
lockManager.lock(path, false, false, 60, "");
fail("VersionHistory should not be lockable: VersionHistory.lock(false,false) did not throw a UnsupportedRepositoryOperationException");
} catch (LockException success) {
}
}