use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit by apache.
the class GetOrNullTest method testGetPropertyOrNullNonExisting.
public void testGetPropertyOrNullNonExisting() throws RepositoryException {
JackrabbitSession js = (JackrabbitSession) superuser;
Property property = js.getPropertyOrNull(PATH_NON_EXISTING_PROPERTY);
assertNull(property);
}
use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit by apache.
the class AbstractACLTemplateTest method setUp.
@Override
protected void setUp() throws Exception {
super.setUp();
if (!(superuser instanceof JackrabbitSession)) {
throw new NotExecutableException();
}
principalMgr = ((JackrabbitSession) superuser).getPrincipalManager();
PrincipalIterator it = principalMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
if (it.hasNext()) {
testPrincipal = it.nextPrincipal();
} else {
throw new NotExecutableException();
}
privilegeMgr = (PrivilegeManagerImpl) ((JackrabbitWorkspace) superuser.getWorkspace()).getPrivilegeManager();
}
use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit-oak by apache.
the class AddMembersTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(GROUP + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
if (!ImportBehavior.NAME_BESTEFFORT.equals(importBehavior)) {
authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(USER + "0");
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
}
s.save();
} finally {
s.logout();
}
}
use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit-oak by apache.
the class AbstractLoginTest method beforeSuite.
@Override
public void beforeSuite() throws Exception {
Session s = loginAdministrative();
try {
AccessControlUtils.addAccessControlEntry(s, "/", EveryonePrincipal.getInstance(), new String[] { Privilege.JCR_READ }, true);
if (USER.equals(runAsUser)) {
((JackrabbitSession) s).getUserManager().createUser(USER, USER);
}
} finally {
s.save();
s.logout();
}
}
use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit-oak by apache.
the class AbstractLoginTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(USER);
if (authorizable != null) {
authorizable.remove();
s.save();
}
} finally {
s.logout();
}
}
Aggregations