Package org.apache.jackrabbit.test

Examples of org.apache.jackrabbit.test.NotExecutableException


            // check if all root nodes have the same UUID
            assertEquals("Referenceable root nodes of different workspaces must have same UUID.",
                    rootNode.getUUID(),
                    rootNodeW2.getUUID());
        } else {
            throw new NotExecutableException("Root node is not referenceable");
        }
    }
View Full Code Here


            throws ConstraintViolationException, NotExecutableException, RepositoryException {

        Session session = testRootNode.getSession();

        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
            throw new NotExecutableException("Locking is not supported.");
        }

        // create a node that is lockable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it lockable if it is not
        if (!node.isNodeType(mixLockable)) {
            if (node.canAddMixin(mixLockable)) {
                node.addMixin(mixLockable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is not lockable and does not " +
                        "allow to add mix:lockable");
            }
        }
        testRootNode.save();

        String mixinName = NodeMixinUtil.getAddableMixinName(session, node);
        if (mixinName == null) {
            throw new NotExecutableException("No testable mixin node type found");
        }

        // remove first slash of path to get rel path to root
        String pathRelToRoot = node.getPath().substring(1);
View Full Code Here

            throws ConstraintViolationException, NotExecutableException, RepositoryException {

        Session session = testRootNode.getSession();

        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
            throw new NotExecutableException("Versioning is not supported.");
        }

        // create a node that is versionable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it versionable if it is not
        if (!node.isNodeType(mixVersionable)) {
            if (node.canAddMixin(mixVersionable)) {
                node.addMixin(mixVersionable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is not versionable and does not " +
                        "allow to add mix:versionable");
            }
        }
        testRootNode.save();

        String mixinName = NodeMixinUtil.getAddableMixinName(session, node);
        if (mixinName == null) {
            throw new NotExecutableException("No testable mixin node type found");
        }

        node.checkin();

        assertFalse("Node.canAddMixin(String mixinName) must return false " +
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

     */
    public void testGetPath()
            throws NotExecutableException, RepositoryException {

        if (childNode == null) {
            throw new NotExecutableException("Workspace does not have sufficient content to run this test.");
        }

        String path = testRoot + "/" + childNode.getName();
        if (getSize(testRootNode.getNodes(childNode.getName())) > 1) {
            // is a same-name-sibling, append index
View Full Code Here

     */
    public void testGetParent()
            throws NotExecutableException, RepositoryException {

        if (childNode == null) {
            throw new NotExecutableException("Workspace does not have sufficient content to run this test.");
        }

        assertTrue("getParent() of a child node return the parent node.",
                testRootNode.isSame(childNode.getParent()));
    }
View Full Code Here

            NodeIterator nodes2 = testRootNode.getNodes();
            Node node = nodes2.nextNode();
            assertTrue("Node from Iterator is not the same as the Node from getNode()",
                    testRootNode.getNode(node.getName()).isSame(node));
        } catch (NoSuchElementException e) {
            throw new NotExecutableException("Workspace does not have sufficient content for this test. " +
                    "Root node must have at least one child node.");
        }
    }
View Full Code Here

            throws NotExecutableException, RepositoryException {

        // get root node and build an ArrayList of its sub nodes
        Node node = testRootNode;
        if (!node.hasNodes()) {
            throw new NotExecutableException("Workspace does not have sufficient content for this test. " +
                    "Root node must have at least one child node.");
        }
        NodeIterator allNodesIt = node.getNodes();
        ArrayList allNodes = new ArrayList();
        while (allNodesIt.hasNext()) {
View Full Code Here

            throws NotExecutableException, RepositoryException {

        Node node = locateNodeWithPrimaryItem(testRootNode);

        if (node == null) {
            throw new NotExecutableException("Workspace does not contain a node with primary item defined");
        }

        String primaryItemName = node.getPrimaryNodeType().getPrimaryItemName();

        Item primaryItem = node.getPrimaryItem();
View Full Code Here

            throws NotExecutableException, RepositoryException {

        Node node = locateNodeWithoutPrimaryItem(testRootNode);

        if (node == null) {
            throw new NotExecutableException("Workspace does not contain a node with primary item defined");
        }

        try {
            node.getPrimaryItem();
            fail("getPrimaryItem() must throw a ItemNotFoundException " +
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.