Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.ContentRepository.login()


        }

        // login as admin should fail
        ContentSession adminSession = null;
        try {
            adminSession = repo.login(new SimpleCredentials("admin", new char[0]), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (adminSession != null) {
View Full Code Here


                .createContentRepository();

        ContentSession cs = Subject.doAs(SystemSubject.INSTANCE, new PrivilegedExceptionAction<ContentSession>() {
            @Override
            public ContentSession run() throws Exception {
                return repo.login(null, null);
            }
        });
        try {
            Root root = cs.getLatestRoot();
            UserConfiguration uc = sp.getConfiguration(UserConfiguration.class);
View Full Code Here

        }

        // login as admin should fail
        ContentSession anonymousSession = null;
        try {
            anonymousSession = repo.login(new GuestCredentials(), null);
            fail();
        } catch (LoginException e) {
            //success
        } finally {
            if (anonymousSession != null) {
View Full Code Here

    }

    @Test
    public void testMissingPrivilegeRoot() throws Exception {
        ContentRepository repo = new Oak().with(new OpenSecurityProvider()).createContentRepository();
        Root tmpRoot = repo.login(null, null).getLatestRoot();
        try {
            PrivilegeDefinitionWriter writer = new PrivilegeDefinitionWriter(tmpRoot);
            writer.writeDefinition(new ImmutablePrivilegeDefinition("newName", true, Collections.<String>emptySet()));
            fail("missing privilege root");
        } catch (RepositoryException e) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.