Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Root.move()


        Tree y = tree.getChild("y");
        Tree x = tree.getChild("x");
        assertTrue(x.exists());

        assertFalse(root.hasPendingChanges());
        root.move("/x", "/y/xx");
        assertTrue(root.hasPendingChanges());
        assertFalse(tree.hasChild("x"));
        assertTrue(y.hasChild("xx"));
        assertEquals("/y/xx", x.getPath());
View Full Code Here


        Tree x = root.getTree("/x");
        Tree z = root.getTree("/z");
        z.setProperty("p", "1");

        root.move("/z", "/x/z");
        root.getTree("/x/z").remove();

        assertFalse(z.exists());

        x.addChild("z");
View Full Code Here

        Root root = session.getLatestRoot();
        Tree tree = root.getTree("/");

        Tree t = tree.addChild("new");

        root.move("/new", "/y/new");
        assertEquals("/y/new", t.getPath());

        assertFalse(tree.getChild("new").exists());
    }
View Full Code Here

        root.commit();

        Tree parent = root.getTree("/parent");
        Tree n = root.getTree("/parent/new");

        root.move("/parent", "/moved");

        assertEquals(Status.NEW, parent.getStatus());
        assertEquals(Status.NEW, n.getStatus());

        assertEquals("/moved", parent.getPath());
View Full Code Here

    public void moveToSelf() throws CommitFailedException {
        Root root = session.getLatestRoot();
        root.getTree("/").addChild("s");
        root.commit();

        assertTrue(root.move("/s", "/s"));
    }

    @Test
    public void moveToDescendant() throws CommitFailedException {
        Root root = session.getLatestRoot();
View Full Code Here

    public void moveToDescendant() throws CommitFailedException {
        Root root = session.getLatestRoot();
        root.getTree("/").addChild("s");
        root.commit();

        assertFalse(root.move("/s", "/s/t"));
    }

    @Test
    public void copyToSelf() throws CommitFailedException {
        Root root = session.getLatestRoot();
View Full Code Here

        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"));

        r.getChild("b").remove();
        assertFalse(r.hasChild("a"));
View Full Code Here

        Root root = session.getLatestRoot();
        Tree tree = root.getTree("/");
        Tree x = tree.getChild("x");
        assertTrue(x.exists());

        root.move("/x", "/xx");
        assertFalse(tree.hasChild("x"));
        assertTrue(tree.hasChild("xx"));
        assertEquals("/xx", x.getPath());
       
        root.commit();
View Full Code Here

        root2.commit();

        root1.move("/x", "/y/x-moved");
        root1.rebase();

        root2.move("/x", "/y/x-moved");
        checkEqual(root1.getTree("/"), (root2.getTree("/")));
    }

    @Test
    public void rebaseWithCopy() throws CommitFailedException {
View Full Code Here

        Tree r = root.getTree("/").addChild("root");
        r.addChild("N3");
        r.addChild("N6");
        r.getChild("N6").addChild("N7");
        root.commit();
        root.move("/root/N6/N7", "/root/N3/N12");
        r.getChild("N3").getChild("N12").remove();
        r.getChild("N6").remove();
        root.commit();
    }
   
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.