Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Tree.addChild()


        Tree tree = root.getTree("/");
        tree.setProperty("a", 1);
        tree.setProperty("b", 2);
        tree.setProperty("c", 3);
        Tree x = tree.addChild("x");
        x.addChild("xx");
        x.setProperty("xa", "value");
        tree.addChild("y");
        tree.addChild("z");
        root.commit();
    }
View Full Code Here


     */
    @Test
    public void removeMoved() throws CommitFailedException {
        Root root = session.getLatestRoot();
        Tree r = root.getTree("/");
        r.addChild("a");
        r.addChild("b");

        root.move("/a", "/b/c");
        assertFalse(r.hasChild("a"));
        assertTrue(r.hasChild("b"));
View Full Code Here

    @Test
    public void removeMoved() throws CommitFailedException {
        Root root = session.getLatestRoot();
        Tree r = root.getTree("/");
        r.addChild("a");
        r.addChild("b");

        root.move("/a", "/b/c");
        assertFalse(r.hasChild("a"));
        assertTrue(r.hasChild("b"));
View Full Code Here

        root = session.getLatestRoot();
        Tree tree = root.getTree("/");
        tree.setProperty("a", 1);
        tree.setProperty("b", 2);
        tree.setProperty("c", 3);
        tree.addChild("x");
        tree.addChild("y");
        tree.addChild("z");
        root.commit();

        // Acquire a fresh new root to avoid problems from lingering state
View Full Code Here

        Tree tree = root.getTree("/");
        tree.setProperty("a", 1);
        tree.setProperty("b", 2);
        tree.setProperty("c", 3);
        tree.addChild("x");
        tree.addChild("y");
        tree.addChild("z");
        root.commit();

        // Acquire a fresh new root to avoid problems from lingering state
        root = session.getLatestRoot();
View Full Code Here

        tree.setProperty("a", 1);
        tree.setProperty("b", 2);
        tree.setProperty("c", 3);
        tree.addChild("x");
        tree.addChild("y");
        tree.addChild("z");
        root.commit();

        // Acquire a fresh new root to avoid problems from lingering state
        root = session.getLatestRoot();
    }
View Full Code Here

    @Test
    public void addExistingChild() throws CommitFailedException {
        Tree tree = root.getTree("/");

        assertFalse(tree.hasChild("new"));
        tree.addChild("new");

        root.commit();

        assertTrue(tree.hasChild("new"));
        Tree added = tree.addChild("new");
View Full Code Here

        assertEquals(3, tree.getChildrenCount(4));

        tree.getChild("x").remove();
        assertEquals(2, tree.getChildrenCount(3));

        tree.addChild("a");
        assertEquals(3, tree.getChildrenCount(3));

        tree.addChild("x");
        assertEquals(4, tree.getChildrenCount(5));
    }
View Full Code Here

        assertEquals(2, tree.getChildrenCount(3));

        tree.addChild("a");
        assertEquals(3, tree.getChildrenCount(3));

        tree.addChild("x");
        assertEquals(4, tree.getChildrenCount(5));
    }

    @Test
    public void getPropertyCount() {
View Full Code Here

    @Test
    public void nodeStatus() throws CommitFailedException {
        Tree tree = root.getTree("/");

        tree.addChild("new");
        assertEquals(Tree.Status.NEW, tree.getChild("new").getStatus());
        root.commit();

        assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
        Tree added = tree.getChild("new");
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.