use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit by apache.
the class CheckinTest method testCheckinNonVersionableNodeJcr2.
/**
* Test calling VersionManager.checkin(P) with the path P resolving to
* a non-versionable node.
*
* @throws RepositoryException
*/
public void testCheckinNonVersionableNodeJcr2() throws RepositoryException {
try {
VersionManager versionManager = nonVersionableNode.getSession().getWorkspace().getVersionManager();
String path = nonVersionableNode.getPath();
versionManager.checkin(path);
fail("VersionManager.checkin(P) must throw UnsupportedRepositoryOperationException if the path P resolves to a non-versionable node.");
} catch (UnsupportedRepositoryOperationException e) {
//success
}
}
use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit by apache.
the class CheckoutTest method testCheckoutNonVersionableNodeJcr2.
/**
* Test calling VersionManager.checkout(P) with P denoting the absolute
* path of a non-versionable node.
*/
public void testCheckoutNonVersionableNodeJcr2() throws RepositoryException {
VersionManager versionManager = nonVersionableNode.getSession().getWorkspace().getVersionManager();
String path = nonVersionableNode.getPath();
try {
versionManager.checkout(path);
fail("VersionManager.checkout(P) with P denoting the absolute path of a non-versionable node must throw UnsupportedRepositoryOperationException");
} catch (UnsupportedRepositoryOperationException e) {
//success
}
}
use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit by apache.
the class ReplaceNodeTest method testAddReplacementAfterMove.
public void testAddReplacementAfterMove() throws RepositoryException {
// transiently move the 'removeNode'
superuser.move(removeNode.getPath(), testRootNode.getPath() + "/" + nodeName4);
// add node that replaces the moved node
Node n = testRootNode.addNode(nodeName1, testNodeType);
// ... and a child node.
n.addNode(nodeName2, testNodeType);
testRootNode.save();
try {
// if (for impl reasons) 'n' is referenceable -> it must have a
// different uuid.
assertFalse(uuid.equals(n.getUUID()));
} catch (UnsupportedRepositoryOperationException e) {
// n has not been made referenceable before -> OK.
}
}
use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit by apache.
the class ReplaceNodeTest method testAddReplacementAfterRemove.
public void testAddReplacementAfterRemove() throws RepositoryException {
// transient removal of the 'removeNode'
removeNode.remove();
// add node that replaces the transiently removed node
Node n = testRootNode.addNode(nodeName2, testNodeType);
// ... and a child node.
n.addNode(nodeName3, testNodeType);
testRootNode.save();
try {
// if (for impl reasons) 'n' is referenceable -> it must have a
// different uuid.
assertFalse(uuid.equals(n.getUUID()));
} catch (UnsupportedRepositoryOperationException e) {
// n has not been made referenceable before -> OK.
}
}
use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit-oak by apache.
the class WorkspaceImpl method clone.
@Override
public void clone(String srcWorkspace, String srcAbsPath, String destAbsPath, boolean removeExisting) throws RepositoryException {
final String srcOakPath = getOakPathOrThrowNotFound(srcAbsPath);
final String destOakPath = getOakPathOrThrowNotFound(destAbsPath);
sessionDelegate.performVoid(new SessionOperation<Void>("clone", true) {
@Override
public void checkPreconditions() throws RepositoryException {
super.checkPreconditions();
ensureIsAlive();
}
@Override
public void performVoid() throws RepositoryException {
sessionDelegate.checkProtectedNode(getParentPath(srcOakPath));
sessionDelegate.checkProtectedNode(getParentPath(destOakPath));
throw new UnsupportedRepositoryOperationException("Not implemented.");
}
});
}
Aggregations