use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit by apache.
the class GetOrNullTest method testGetItemOrNullNonExistingNode.
public void testGetItemOrNullNonExistingNode() throws RepositoryException {
JackrabbitSession js = (JackrabbitSession) superuser;
Item item = js.getItemOrNull(PATH_NON_EXISTING_NODE);
assertNull(item);
}
use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit by apache.
the class GetOrNullTest method testGetNodeOrNullExisting.
public void testGetNodeOrNullExisting() throws RepositoryException {
JackrabbitSession js = (JackrabbitSession) superuser;
Node node = js.getNodeOrNull(PATH_EXISTING_NODE);
assertNotNull(node);
assertEquals(node.getPath(), PATH_EXISTING_NODE);
}
use of org.apache.jackrabbit.api.JackrabbitSession in project jackrabbit by apache.
the class GetOrNullTest method testGetItemOrNullExistingProperty.
public void testGetItemOrNullExistingProperty() throws RepositoryException {
JackrabbitSession js = (JackrabbitSession) superuser;
Item item = js.getItemOrNull(PATH_EXISTING_PROPERTY);
assertNotNull(item);
assertTrue(item instanceof Property);
assertEquals(item.getPath(), PATH_EXISTING_PROPERTY);
}
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();
}
Aggregations