use of org.apache.jackrabbit.test.NotExecutableException in project jackrabbit by apache.
the class DescendantNodeTest method testDescendantNodesDoNotMatchSelector.
public void testDescendantNodesDoNotMatchSelector() throws RepositoryException, NotExecutableException {
testRootNode.addNode(nodeName1, testNodeType);
superuser.save();
NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager();
NodeTypeIterator it = ntMgr.getPrimaryNodeTypes();
NodeType testNt = ntMgr.getNodeType(testNodeType);
while (it.hasNext()) {
NodeType nt = it.nextNodeType();
if (!testNt.isNodeType(nt.getName())) {
// perform test
QueryObjectModel qom = qf.createQuery(qf.selector(nt.getName(), "s"), qf.descendantNode("s", testRoot), null, null);
checkQOM(qom, new Node[] {});
return;
}
}
throw new NotExecutableException("No suitable node type found to " + "perform test against '" + testNodeType + "' nodes");
}
use of org.apache.jackrabbit.test.NotExecutableException in project jackrabbit by apache.
the class ChildNodeTest method testChildNodesDoNotMatchSelector.
public void testChildNodesDoNotMatchSelector() throws RepositoryException, NotExecutableException {
testRootNode.addNode(nodeName1, testNodeType);
superuser.save();
NodeTypeManager ntMgr = superuser.getWorkspace().getNodeTypeManager();
NodeTypeIterator it = ntMgr.getPrimaryNodeTypes();
NodeType testNt = ntMgr.getNodeType(testNodeType);
while (it.hasNext()) {
NodeType nt = it.nextNodeType();
if (!testNt.isNodeType(nt.getName())) {
// perform test
QueryObjectModel qom = qf.createQuery(qf.selector(nt.getName(), "s"), qf.childNode("s", testRoot), null, null);
checkQOM(qom, new Node[] {});
return;
}
}
throw new NotExecutableException("No suitable node type found to " + "perform test against '" + testNodeType + "' nodes");
}
use of org.apache.jackrabbit.test.NotExecutableException in project jackrabbit by apache.
the class UserTest method testChangePassword.
public void testChangePassword() throws RepositoryException, NotExecutableException {
String oldPw = getHelper().getProperty("javax.jcr.tck.superuser.pwd");
if (oldPw == null) {
// missing property
throw new NotExecutableException();
}
User user = getTestUser(superuser);
try {
user.changePassword("pw");
save(superuser);
// make sure the user can login with the new pw
Session s = getHelper().getRepository().login(new SimpleCredentials(user.getID(), "pw".toCharArray()));
s.logout();
} finally {
user.changePassword(oldPw);
save(superuser);
}
}
use of org.apache.jackrabbit.test.NotExecutableException in project jackrabbit by apache.
the class UserTest method testChangePasswordWithOldPassword2.
public void testChangePasswordWithOldPassword2() throws RepositoryException, NotExecutableException {
String oldPw = getHelper().getProperty("javax.jcr.tck.superuser.pwd");
if (oldPw == null) {
// missing property
throw new NotExecutableException();
}
User user = getTestUser(superuser);
try {
user.changePassword("pw", oldPw);
save(superuser);
Session s = getHelper().getRepository().login(new SimpleCredentials(user.getID(), oldPw.toCharArray()));
s.logout();
fail("superuser pw has changed. login must fail.");
} catch (LoginException e) {
// success
} finally {
user.changePassword(oldPw);
save(superuser);
}
}
use of org.apache.jackrabbit.test.NotExecutableException in project jackrabbit by apache.
the class UserManagerTest method testGetAuthorizableByPath.
public void testGetAuthorizableByPath() throws RepositoryException, NotExecutableException {
String uid = superuser.getUserID();
Authorizable a = userMgr.getAuthorizable(uid);
if (a == null) {
throw new NotExecutableException();
}
try {
String path = a.getPath();
Authorizable a2 = userMgr.getAuthorizableByPath(path);
assertNotNull(a2);
assertEquals(a.getID(), a2.getID());
} catch (UnsupportedRepositoryOperationException e) {
throw new NotExecutableException();
}
}
Aggregations