Package org.apache.jackrabbit.test

Examples of org.apache.jackrabbit.test.NotExecutableException


            protectedUserProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));

            protectedUserProps.add(resolver.getJCRName(UserConstants.P_MEMBERS));
            protectedGroupProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here


    protected void setUp() throws Exception {
        super.setUp();
        if (!isExecutable()) {
            superuser.logout();
            throw new NotExecutableException();
        }

        try {
            UserManager uMgr = getUserManager(superuser);
            // create the testUser
View Full Code Here

    }

    protected static UserManager getUserManager(Session session) throws
            NotExecutableException {
        if (!(session instanceof JackrabbitSession)) {
            throw new NotExecutableException();
        }
        try {
            return ((JackrabbitSession) session).getUserManager();
        } catch (RepositoryException e) {
            throw new NotExecutableException();
        }
    }
View Full Code Here

    private String pPrincipalName;

    protected void setUp() throws Exception {
        super.setUp();
        if (!(userMgr instanceof UserManagerImpl)) {
            throw new NotExecutableException("UserManagerImpl expected -> cannot perform test.");
        }
        NameResolver resolver = (SessionImpl) superuser;
        pPrincipalName = resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME);
    }
View Full Code Here

        try {
            Node naa = createVersionableNode(versionableNode, nodeName4, versionableNodeType);
            // Verify that nodes used for the test have proper opv behaviour
            NodeDefinition nd = naa.getDefinition();
            if (nd.getOnParentVersion() != OnParentVersionAction.COPY && nd.getOnParentVersion() != OnParentVersionAction.VERSION) {
                throw new NotExecutableException("Child nodes must have OPV COPY or VERSION in order to be able to test Node.restore with uuid conflict.");
            }

            Version v = versionableNode.checkin();
            versionableNode.checkout();
            superuser.move(naa.getPath(), versionableNode2.getPath() + "/" + naa.getName());
View Full Code Here

        } catch (NoSuchNodeTypeException e) {
            // only nt:base is strictly required
            if ("nt:base".equals(name)) {
                fail(e.getMessage());
            } else {
                throw new NotExecutableException("NodeType " + name +
                        " not supported by this repository implementation.");
            }
        } catch (RepositoryException e) {
            fail(e.getMessage());
        }
View Full Code Here

        if (u == null) {
            fail("User " +uID+ "hast not been removed and must be visible to the Session created with its credentials.");
        }

        if (!uSession.hasPermission(((UserImpl) u).getNode().getPath(), "set_property")) {
            throw new NotExecutableException("Users should be able to modify their properties -> Check repository config.");
        }

        // single valued properties
        u.setProperty("Email", new StringValue("tu@security.test"));
        save(uSession);
View Full Code Here

            protectedUserProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));

            protectedUserProps.add(resolver.getJCRName(UserConstants.P_MEMBERS));
            protectedGroupProps.add(resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME));
        } else {
            throw new NotExecutableException();
        }
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();
        if (!(userMgr instanceof UserManagerImpl)) {
            throw new NotExecutableException("UserManagerImpl expected -> cannot perform test.");
        }
        NameResolver resolver = (SessionImpl) superuser;
        pPrincipalName = resolver.getJCRName(UserConstants.P_PRINCIPAL_NAME);
    }
View Full Code Here

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

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

        sImpl = (SessionImpl) superuser;

        UserManager umgr = sImpl.getUserManager();
        if (umgr.isAutoSave()) {
            try {
                umgr.autoSave(false);
            } catch (RepositoryException e) {
                // user manager cannot have the autosave behavior changed
                // -> test not executable
                throw new NotExecutableException("Expected user manager that can have its autosave behavior changed to false.");
            }
        }
        this.umgr = (UserManagerImpl) umgr;
        // avoid collision with testing a-folders that may have been created
        // with another test (but not removed as user/groups got removed)
        String path = this.umgr.getUsersPath() + "/t";
        if (sImpl.nodeExists(path)) {
            sImpl.getNode(path).remove();
        }
        path = this.umgr.getGroupsPath() + "/g";
        if (sImpl.nodeExists(path)) {
            sImpl.getNode(path).remove();
        }
        sImpl.save();

        Authorizable administrators = umgr.getAuthorizable(SecurityConstants.ADMINISTRATORS_NAME);
        if (administrators == null) {
            groupIdToRemove = umgr.createGroup(new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME)).getID();
            sImpl.save();
        } else if (!administrators.isGroup()) {
            throw new NotExecutableException("Expected " + administrators.getID() + " to be a group.");
        }
    }
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.