Package org.apache.jackrabbit.oak.api

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


        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

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

        assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
        Tree added = tree.getChild("new");
        added.addChild("another");
        assertEquals(Tree.Status.MODIFIED, tree.getChild("new").getStatus());
        root.commit();

        assertEquals(Tree.Status.EXISTING, tree.getChild("new").getStatus());
        tree.getChild("new").getChild("another").remove();
View Full Code Here

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

        tree.addChild("new");
        assertEquals(Status.MODIFIED, tree.getStatus());

        root.rebase();
        assertEquals(Status.MODIFIED, tree.getStatus());
    }
View Full Code Here

    }

    @Test
    public void noTransitiveModifiedStatus() throws CommitFailedException {
        Tree tree = root.getTree("/");
        tree.addChild("one").addChild("two");
        root.commit();

        tree.getChild("one").getChild("two").addChild("three");
        assertEquals(Tree.Status.EXISTING, tree.getChild("one").getStatus());
        assertEquals(Tree.Status.MODIFIED, tree.getChild("one").getChild("two").getStatus());
View Full Code Here

        Tree large = tree.addChild("large");
        for (int c = 0; c < 10000; c++) {
            String name = "n" + c;
            added.add(name);
            large.addChild(name);
        }

        root.commit();

        for (Tree child : large.getChildren()) {
View Full Code Here

        Tree tree = root.getTree("/").addChild("test2");
        tree.setOrderableChildren(true);

        String[] childNames = new String[]{"a", "b", "c", "d"};
        for (String name : childNames) {
            tree.addChild(name);
        }

        int index = 0;
        for (Tree child : tree.getChildren()) {
            assertEquals(childNames[index++], child.getName());
View Full Code Here

        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

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.