Package javax.jcr

Examples of javax.jcr.Node.addNode()


        }));

        testSession.move(childNPath, siblingDestPath);

        Node sourceParent = testSession.getNode(path);
        sourceParent.addNode(nodeName4);

        try {
            testSession.save();
            fail("Adding child node at source parent be denied: missing add_child_node privilege.");
        } catch (AccessDeniedException e) {
View Full Code Here


        allow(nodePath3, privilegesFromName(Privilege.JCR_ADD_CHILD_NODES));

        testSession.move(childNPath, siblingDestPath);

        Node sourceParent = testSession.getNode(path);
        sourceParent.addNode(nodeName4);

        try {
            testSession.save();
            fail("Adding child node at source parent be denied: missing add_child_node privilege.");
        } catch (AccessDeniedException e) {
View Full Code Here

        }));

        testSession.move(childNPath, siblingDestPath);

        Node sourceParent = testSession.getNode(path);
        sourceParent.addNode(nodeName4);

        testSession.save();
    }

    @Test
View Full Code Here

        List<Exception> exceptions = Collections.synchronizedList(
                new ArrayList<Exception>());
        Node test = getAdminSession().getRootNode().addNode("test");
        List<Thread> worker = new ArrayList<Thread>();
        for (int i = 0; i < NUM_WORKERS; i++) {
            String path = test.addNode("node" + i).getPath();
            worker.add(new Thread(new Worker(
                    createAdminSession(), path, exceptions)));
        }
        getAdminSession().save();
        for (Thread t : worker) {
View Full Code Here

    }

    @Test
    public void removeNode() throws RepositoryException {
        Node parentNode = getNode(TEST_PATH);
        parentNode.addNode("newNode");
        parentNode.getSession().save();

        Session session2 = createAdminSession();
        try {
            Node removeNode = session2.getNode(TEST_PATH + "/newNode");
View Full Code Here

        checkChildAxis(new Value[]{getPathValue("a"), getPathValue("b"), getPathValue("c")});
    }

    public void testChildAxisDeep() throws RepositoryException {
        Node n1 = testRootNode.addNode("node1");
        n1.addNode("a").addNode("b"); // no property
        Node n2 = testRootNode.addNode("node2");
        n2.addNode("a").addNode("b").addNode("c").setProperty("prop", "a");
        Node n3 = testRootNode.addNode("node2");
        n3.addNode("a").addNode("b").addNode("c").setProperty("prop", "b");
        testRootNode.save();
View Full Code Here

    public void testChildAxisDeep() throws RepositoryException {
        Node n1 = testRootNode.addNode("node1");
        n1.addNode("a").addNode("b"); // no property
        Node n2 = testRootNode.addNode("node2");
        n2.addNode("a").addNode("b").addNode("c").setProperty("prop", "a");
        Node n3 = testRootNode.addNode("node2");
        n3.addNode("a").addNode("b").addNode("c").setProperty("prop", "b");
        testRootNode.save();

        List expected = Arrays.asList(new String[]{n1.getPath(), n2.getPath(), n3.getPath()});
View Full Code Here

        Node n1 = testRootNode.addNode("node1");
        n1.addNode("a").addNode("b"); // no property
        Node n2 = testRootNode.addNode("node2");
        n2.addNode("a").addNode("b").addNode("c").setProperty("prop", "a");
        Node n3 = testRootNode.addNode("node2");
        n3.addNode("a").addNode("b").addNode("c").setProperty("prop", "b");
        testRootNode.save();

        List expected = Arrays.asList(new String[]{n1.getPath(), n2.getPath(), n3.getPath()});
        String xpath = testPath + "/* order by a/b/c/@prop";
        assertEquals(expected, collectPaths(executeQuery(xpath)));
View Full Code Here

        assertEquals(expected, collectPaths(executeQuery(xpath)));
    }

    public void testChildAxisNoValue() throws RepositoryException {
        Node n1 = testRootNode.addNode("node1");
        n1.addNode("child").setProperty("prop", "a");
        Node n2 = testRootNode.addNode("node2");
        n2.addNode("child");
        testRootNode.save();

        List expected = Arrays.asList(new String[]{n2.getPath(), n1.getPath()});
View Full Code Here

    public void testChildAxisNoValue() throws RepositoryException {
        Node n1 = testRootNode.addNode("node1");
        n1.addNode("child").setProperty("prop", "a");
        Node n2 = testRootNode.addNode("node2");
        n2.addNode("child");
        testRootNode.save();

        List expected = Arrays.asList(new String[]{n2.getPath(), n1.getPath()});
        String xpath = testPath + "/* order by child/@prop";
        assertEquals(expected, collectPaths(executeQuery(xpath)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.