Package org.apache.jackrabbit.test

Examples of org.apache.jackrabbit.test.NotExecutableException


    public void testUpdateUser() throws NotExecutableException, RepositoryException {
        // create the same use in 2 different workspace must make the 'corresponding'
        // and updating must succeed
        String altWsp = getAlternativeWorkspaceName();
        if (altWsp == null) {
            throw new NotExecutableException();
        }

        UserManager uMgr = ((JackrabbitSession) superuser).getUserManager();

        Session s = getHelper().getSuperuserSession(altWsp);
        User u = null;
        try {
            // other users created in the default workspace...
            u = uMgr.createUser("testUser", "testUser");
            superuser.save();

            String userPath = null;
            if (u.getPrincipal() instanceof ItemBasedPrincipal) {
                userPath = ((ItemBasedPrincipal) u.getPrincipal()).getPath();
                assertTrue(superuser.nodeExists(userPath));
            } else {
                throw new NotExecutableException();
            }

            // ... must not be present in the alternate-workspace
            UserManager umgr = ((JackrabbitSession) s).getUserManager();
            assertNull(umgr.getAuthorizable("testUser"));
View Full Code Here


    @Override
    protected void setUp() throws Exception {
        super.setUp();

        if (!(superuser instanceof SessionImpl)) {
            throw new NotExecutableException("SessionImpl expected");
        }
        sImpl = (SessionImpl) superuser;

        // make sure the repository provides resource based policies.
        AccessControlPolicyIterator it = sImpl.getAccessControlManager().getApplicablePolicies("/");
        if (!it.hasNext()) {
            AccessControlPolicy[] pcs = sImpl.getAccessControlManager().getPolicies("/");
            if (pcs == null || pcs.length == 0) {
                throw new NotExecutableException();
            }

        } // ok resource based acl
    }
View Full Code Here

        if (!testRootNode.getDefinition().isProtected()) {
            ProtectedNodeImporter piImporter = createImporter();
            piImporter.init(sImpl, sImpl, false, ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW, null);
            assertFalse(piImporter.start((NodeImpl) testRootNode));
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

    private static Logger log = LoggerFactory.getLogger(NodeImplTest.class);

    protected void setUp() throws Exception {
        super.setUp();
        if (!(testRootNode instanceof NodeImpl) && !(testRootNode.getSession() instanceof SessionImpl)) {
            throw new NotExecutableException();
        }
    }
View Full Code Here

            acl.addEntry(principal, new Privilege[] {acMgr.privilegeFromName(Privilege.JCR_READ)}, allowRead);
            acMgr.setPolicy(n.getPath(), acl);
            s.save();
        } else {
            // no JackrabbitAccessControlList found.
            throw new NotExecutableException();
        }
    }
View Full Code Here

                }
            }
        } finally {
            s.logout();
        }
        throw new NotExecutableException();
    }
View Full Code Here

    public void testImportPrincipalBasedACL() throws Exception {
        JackrabbitAccessControlManager acMgr = (JackrabbitAccessControlManager) sImpl.getAccessControlManager();
        if (acMgr.getApplicablePolicies(EveryonePrincipal.getInstance()).length > 0 ||
                acMgr.getPolicies(EveryonePrincipal.getInstance()).length > 0) {
            // test expects that only resource-based acl is supported
            throw new NotExecutableException();
        }


        NodeImpl target;
        NodeImpl root = (NodeImpl) sImpl.getRootNode();
View Full Code Here

    private static AccessManager getAccessManager(Session session) throws NotExecutableException {
        if (session instanceof SessionImpl) {
            return ((SessionImpl) session).getAccessManager();
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

    private static ItemId getItemId(Item item) throws NotExecutableException {
        if (item instanceof ItemImpl) {
            return ((ItemImpl)item).getId();
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

        try {
            Set<String> allAccessibles = new HashSet<String>(Arrays.asList(superuser.getWorkspace().getAccessibleWorkspaceNames()));
            Set<String> sWorkspaceNames = new HashSet<String>(Arrays.asList(s.getWorkspace().getAccessibleWorkspaceNames()));

            if (!allAccessibles.removeAll(sWorkspaceNames) || allAccessibles.isEmpty()) {
                throw new NotExecutableException("No workspace name found that exists but is not accessible for ReadOnly session.");
            }

            String notAccessibleName = allAccessibles.iterator().next();
            assertFalse(getAccessManager(s).canAccess(notAccessibleName));
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.test.NotExecutableException

Copyright © 2018 www.massapicom. 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.