Package org.apache.jackrabbit.test

Examples of org.apache.jackrabbit.test.NotExecutableException


                    !ntName.startsWith("rep:")) {
                referenceableNt = ntName;
            }
        }
        if (referenceableNt == null) {
            throw new NotExecutableException("No primary type found that extends from mix:referenceable.");
        }
        /*
        TODO: retrieve valid jcr:uuid value from test-properties.
        */
        String uuid = UUID.randomUUID().toString();
View Full Code Here


                break;
            }
        }

        if (privName == null) {
            throw new NotExecutableException("failed to define new privilege name.");
        }
        return privName;
    }
View Full Code Here

                acl = (JackrabbitAccessControlList) p;
            }
        }
        if (acl == null) {
            superuser.logout();
            throw new NotExecutableException("No JackrabbitAccessControlList to test.");
        }

        testPrincipal = getValidPrincipal();
        testPrivileges = privilegesFromName(Privilege.JCR_ALL);
    }
View Full Code Here

        super.tearDown();
    }

    private Principal getValidPrincipal() throws NotExecutableException, RepositoryException {
        if (!(superuser instanceof JackrabbitSession)) {
            throw new NotExecutableException();
        }

        PrincipalManager pMgr = ((JackrabbitSession) superuser).getPrincipalManager();
        PrincipalIterator it = pMgr.getPrincipals(PrincipalManager.SEARCH_TYPE_NOT_GROUP);
        if (it.hasNext()) {
            return it.nextPrincipal();
        } else {
            throw new NotExecutableException();
        }
    }
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 (!(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

    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();
        }

        PrincipalManager pmgr = sImpl.getPrincipalManager();
        if (!pmgr.hasPrincipal(SecurityConstants.ADMINISTRATORS_NAME)) {
            UserManager umgr = sImpl.getUserManager();
            umgr.createGroup(new PrincipalImpl(SecurityConstants.ADMINISTRATORS_NAME));
            if (!umgr.isAutoSave()) {
                sImpl.save();
            }
            if (pmgr.hasPrincipal(SecurityConstants.ADMINISTRATORS_NAME)) {
                throw new NotExecutableException();
            }
        }


        NodeImpl target;
View Full Code Here

                existing = p;
                break;
            }
        }
        if (existing == null) {
            throw new NotExecutableException();
        }

        String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                "<sv:node sv:name=\"t\" xmlns:mix=\"http://www.jcp.org/jcr/mix/1.0\" xmlns:nt=\"http://www.jcp.org/jcr/nt/1.0\" xmlns:fn_old=\"http://www.w3.org/2004/10/xpath-functions\" xmlns:fn=\"http://www.w3.org/2005/xpath-functions\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:sv=\"http://www.jcp.org/jcr/sv/1.0\" xmlns:rep=\"internal\" xmlns:jcr=\"http://www.jcp.org/jcr/1.0\">" +
                "   <sv:property sv:name=\"jcr:primaryType\" sv:type=\"Name\"><sv:value>rep:User</sv:value></sv:property>" +
View Full Code Here

    private Node createVersionableNode(Node parent) throws Exception {
        Node n = (parent.hasNode(nodeName1)) ? parent.getNode(nodeName1) : parent.addNode(nodeName1);
        if (n.canAddMixin(mixVersionable)) {
            n.addMixin(mixVersionable);
        } else {
            throw new NotExecutableException();
        }
        n.getSession().save();
        return n;
    }
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.