use of javax.jcr.Session in project jackrabbit-oak by apache.
the class ObservationTest method run.
private void run(Repository repository, @Nullable Whiteboard whiteboard) throws RepositoryException, ExecutionException, InterruptedException {
Session session = createSession(repository);
long t0 = System.currentTimeMillis();
try {
observationThroughput(repository, whiteboard);
} finally {
System.out.println("Time elapsed: " + (System.currentTimeMillis() - t0) + " ms");
session.logout();
}
}
use of javax.jcr.Session in project jackrabbit-oak by apache.
the class LoginWithMembershipTest method afterSuite.
@Override
public void afterSuite() throws Exception {
Session s = loginAdministrative();
try {
Authorizable authorizable = ((JackrabbitSession) s).getUserManager().getAuthorizable(GROUP);
if (authorizable != null) {
Node n = s.getNode(Text.getRelativeParent(authorizable.getPath(), 1));
n.remove();
}
s.save();
} finally {
s.logout();
}
}
use of javax.jcr.Session in project jackrabbit-oak by apache.
the class GetNodeTest method afterSuite.
@Override
protected void afterSuite() throws Exception {
Session session = loginWriter();
session.getNode(testRoot.getPath()).remove();
testRoot.getSession().logout();
session.save();
session.logout();
}
use of javax.jcr.Session in project jackrabbit-oak by apache.
the class GetPrincipalTest method runTest.
@Override
protected void runTest() throws Exception {
Session s = loginWriter();
PrincipalManager principalManager = ((JackrabbitSession) s).getPrincipalManager();
for (int i = 0; i < 1000; i++) {
Principal p = principalManager.getPrincipal(getUserId());
}
}
use of javax.jcr.Session in project jackrabbit-oak by apache.
the class RemoveMembersTest method runTest.
@Override
public void runTest() throws Exception {
Session s = null;
try {
// use system session login to avoid measuring the login-performance here
s = systemLogin();
UserManager userManager = ((JackrabbitSession) s).getUserManager();
String groupPath = groupPaths.get(random.nextInt(GROUP_CNT));
Group g = (Group) userManager.getAuthorizableByPath(groupPath);
removeMembers(userManager, g, s);
} catch (RepositoryException e) {
if (s.hasPendingChanges()) {
s.refresh(false);
}
} finally {
if (s != null) {
s.logout();
}
}
}
Aggregations