Package org.apache.jackrabbit.test

Examples of org.apache.jackrabbit.test.NotExecutableException


     * and a {@link Event#NODE_ADDED} event with same name siblings.
     */
    public void testNodeReorderSameName()
            throws RepositoryException, NotExecutableException {
        if (!testRootNode.getDefinition().getDeclaringNodeType().hasOrderableChildNodes()) {
            throw new NotExecutableException("Node at '" + testRoot + "' does not support orderable child nodes.");
        }

        /**
         * Initial tree:
         *  + testroot
         *      + nodename1[1]
         *      + nodename1[2]
         *      + nodename1[3]
         *
         * After reorder:
         *  + testroot
         *      + nodename1[1]
         *      + nodename1[2] (was 3)
         *      + nodename1[3] (was 2)
         */
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        if (!n.getDefinition().allowsSameNameSiblings()) {
            throw new NotExecutableException("Node at " + testRoot + " does not allow same name siblings with name " + nodeName1);
        }
        testRootNode.addNode(nodeName1, testNodeType);
        testRootNode.addNode(nodeName1, testNodeType);
        testRootNode.save();
        EventResult addNodeListener = new EventResult(log);
View Full Code Here


     * a node is removed in the same save scope.
     */
    public void testNodeReorderSameNameWithRemove()
            throws RepositoryException, NotExecutableException {
        if (!testRootNode.getDefinition().getDeclaringNodeType().hasOrderableChildNodes()) {
            throw new NotExecutableException("Node at '" + testRoot + "' does not support orderable child nodes.");
        }

        /**
         * Initial tree:
         *  + testroot
         *      + nodename1[1]
         *      + nodename2
         *      + nodename1[2]
         *      + nodename1[3]
         *      + nodename3
         *
         * After reorder:
         *  + testroot
         *      + nodename1[1]
         *      + nodename2
         *      + nodename1[2] (was 3)
         *      + nodename1[3] (was 2)
         */
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        if (!n.getDefinition().allowsSameNameSiblings()) {
            throw new NotExecutableException("Node at " + testRoot + " does not allow same name siblings with name " + nodeName1);
        }
        testRootNode.addNode(nodeName2, testNodeType);
        testRootNode.addNode(nodeName1, testNodeType);
        testRootNode.addNode(nodeName1, testNodeType);
        testRootNode.addNode(nodeName3, testNodeType);
View Full Code Here

        Node n = testRootNode.addNode(nodeName1, testNodeType);
        NodeType nt = superuser.getWorkspace().getNodeTypeManager().getNodeType(testNodeType);
        Value v1 = superuser.getValueFactory().createValue("foo");
        Value v2 = superuser.getValueFactory().createValue(System.currentTimeMillis());
        if (!nt.canSetProperty(propertyName1, v1) || !nt.canSetProperty(propertyName1, v2)) {
            throw new NotExecutableException("Property " + propertyName1 + " is not of type UNDEFINED");
        }
        n.setProperty(propertyName1, v1);
        testRootNode.save();
        EventResult result = new EventResult(log);
        addEventListener(result, Event.PROPERTY_ADDED | Event.PROPERTY_CHANGED | Event.PROPERTY_REMOVED);
View Full Code Here

     */
    public void setUp() throws Exception {
        super.setUp();
        Repository repo = helper.getRepository();
        if (!isSupported(Repository.OPTION_LOCKING_SUPPORTED)) {
            throw new NotExecutableException("SetValueLockExceptionTest "
                    + "not executable: Locking not supported");
        }
        else {
            lockingSession = superuser;

View Full Code Here

        // locate a property definition of type string
        PropertyDefinition propDef =
                NodeTypeUtil.locatePropertyDef(superuser, PropertyType.STRING, false, false, false, false);

        if (propDef == null) {
            throw new NotExecutableException("No testable property has been found.");
        }

        // create a node of type propDef.getDeclaringNodeType()
        String nodeType = propDef.getDeclaringNodeType().getName();
        Node testNode = testRootNode.addNode(nodeName1, nodeType);
View Full Code Here

        // locate a property definition of type string
        PropertyDefinition propDef =
                NodeTypeUtil.locatePropertyDef(superuser, PropertyType.STRING, false, false, false, false);

        if (propDef == null) {
            throw new NotExecutableException("No testable property has been found.");
        }

        // create a node of type propDef.getDeclaringNodeType()
        String nodeType = propDef.getDeclaringNodeType().getName();
        Node testNode = testRootNode.addNode(nodeName1, nodeType);
View Full Code Here

        // locate a property definition of type string
        PropertyDefinition propDef =
                NodeTypeUtil.locatePropertyDef(superuser, PropertyType.STRING, true, false, false, false);

        if (propDef == null) {
            throw new NotExecutableException("No testable property has been found.");
        }

        // create a node of type propDef.getDeclaringNodeType()
        String nodeType = propDef.getDeclaringNodeType().getName();
        Node testNode = testRootNode.addNode(nodeName1, nodeType);
View Full Code Here

            // locate a property definition of type undefined
            PropertyDefinition propDef =
                    NodeTypeUtil.locatePropertyDef(superuser, PropertyType.UNDEFINED, multiple, false, false, false);

            if (propDef == null) {
                throw new NotExecutableException("No testable property of type " +
                                                 "UNDEFINED has been found.");
            }

            // create a node of type propDef.getDeclaringNodeType()
            String nodeType = propDef.getDeclaringNodeType().getName();
            testNode = testRootNode.addNode(nodeName1, nodeType);
            testPropName = propDef.getName();
        }
        catch (RepositoryException e) {
            throw new NotExecutableException("Not able to set up test items.");
        }
    }
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

     * org.apache.jackrabbit.test.NotExecutableException} is thrown.
     */
    public void testIsMandatory() throws RepositoryException, NotExecutableException {
        traverse(testRootNode);
        if (!foundMandatoryNode) {
            throw new NotExecutableException("Workspace does not contain any node with a mandatory child node definition");
        }
    }
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.