use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit-oak by apache.
the class UserManagerTest method testGetAuthorizableByPath.
@Test
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();
}
}
use of javax.jcr.UnsupportedRepositoryOperationException in project jackrabbit-oak by apache.
the class UserTest method testLoginWithGetCredentials.
@Test
public void testLoginWithGetCredentials() throws RepositoryException, NotExecutableException {
try {
Credentials creds = user.getCredentials();
Session s = getHelper().getRepository().login(creds);
s.logout();
fail("Login using credentials exposed on user must fail.");
} catch (UnsupportedRepositoryOperationException e) {
throw new NotExecutableException(e.getMessage());
} catch (LoginException e) {
// success
}
}
Aggregations