throws NotExecutableException, RepositoryException {
Session session = superuser;
if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
throw new NotExecutableException("Locking is not supported.");
}
// create a node that is lockable
Node lockableNode = testRootNode.addNode(nodeName1, testNodeType);
// or try to make it lockable if it is not
if (!lockableNode.isNodeType(mixLockable)) {
if (lockableNode.canAddMixin(mixLockable)) {
lockableNode.addMixin(mixLockable);
} else {
throw new NotExecutableException("Node " + nodeName1 + " is not lockable and does not " +
"allow to add mix:lockable");
}
}
// add a sub node (the one that is tried to move later on)