@Override public ContentSession run() throws NoSuchWorkspaceException, LoginException { return repository.login(null, null); } });
@Override public ContentSession run() { try { return contentRepository.login(null, null); } catch (Exception e) { throw new RuntimeException(e); } } });
@Override public ContentSession run() throws LoginException, NoSuchWorkspaceException { return getContentRepository().login(null, null); } });
@Override public ContentSession run() throws Exception { return repo.login(null, null); } });
@Override public ContentSession run() throws LoginException, NoSuchWorkspaceException { return contentRepository.login(null, null); } });
@Override public ContentSession run() throws NoSuchWorkspaceException, LoginException { return repository.login(null, null); } });
@Override public ContentSession run() throws LoginException, NoSuchWorkspaceException { return repository.login(null, rcb.getWorkspaceName()); } });
@Override public ContentSession run() throws LoginException, NoSuchWorkspaceException { return repository.login(null, rcb.getWorkspaceName()); } });
@Override public ContentSession run() throws Exception { return repo.login(null, null); } });
protected ContentSession login1(@Nullable Credentials credentials) throws LoginException, NoSuchWorkspaceException { return contentRepository1.login(credentials, null); } protected ContentSession login2(@Nullable Credentials credentials)
@Override protected void beforeSuite() throws Exception { super.beforeSuite(); Credentials creds = (runAsAdmin) ? getCredentials() : new GuestCredentials(); cs = contentRepository.login(creds, null); subject = new Subject(true, cs.getAuthInfo().getPrincipals(), Collections.emptySet(), Collections.emptySet()); }
@Override public ContentSession login(ContentRepository repository) throws RemoteLoginException { ContentSession session; try { session = repository.login(new SimpleCredentials(user, password), null); } catch (LoginException e) { throw new RemoteLoginException("unable to login", e); } catch (NoSuchWorkspaceException e) { throw new RemoteLoginException("unable to use the default workspace", e); } return session; }
@Before public void before() throws Exception { ContentSession session = createRepository().login(null, null); root = session.getLatestRoot(); }
@Test(expected = IllegalStateException.class) public void throwOnClosedSession() throws LoginException, NoSuchWorkspaceException, IOException { ContentSession session = repository.login(null, null); session.close(); session.getLatestRoot(); }
@Test(expected = IllegalStateException.class) public void throwOnClosedRoot() throws LoginException, NoSuchWorkspaceException, IOException { ContentSession session = repository.login(null, null); Root root = session.getLatestRoot(); session.close(); root.getTree("/"); }
@Before public void before() throws Exception { session = createRepository().login(null, null); root = session.getLatestRoot(); qe = root.getQueryEngine(); }
@Before public void before() throws Exception { session = createRepository().login(null, null); root = session.getLatestRoot(); qe = root.getQueryEngine(); createTestIndexNode(); }
@Test(expected = IllegalStateException.class) public void throwOnClosedTree() throws LoginException, NoSuchWorkspaceException, IOException { ContentSession session = repository.login(null, null); Root root = session.getLatestRoot(); Tree tree = root.getTree("/"); session.close(); tree.getChild("any"); } }
@Before public void setUp() throws LoginException, NoSuchWorkspaceException { repository = new Oak().with(new InitialContent()).with(new OpenSecurityProvider()) .with(new TypeEditorProvider()).createContentRepository(); session = repository.login(null, null); root = session.getLatestRoot(); }
@Test public void testMissingPermissionRoot() throws Exception { ContentRepository repo = new Oak().with(new OpenSecurityProvider()).createContentRepository(); Root tmpRoot = repo.login(null, null).getLatestRoot(); try { PrivilegeDefinitionReader reader = new PrivilegeDefinitionReader(tmpRoot); assertNull(reader.readDefinition(JCR_READ)); } finally { tmpRoot.getContentSession().close(); } } }