Package org.apache.jackrabbit.oak.plugins.index.old.mk.simple

Examples of org.apache.jackrabbit.oak.plugins.index.old.mk.simple.NodeImpl.asString()


        map.setMaxMemoryChildren(2);
        map.setDescendantInlineCount(-1);

        NodeImpl n = new NodeImpl(map, 0);
        Assert.assertEquals("{}", n.asString());
        n.setId(NodeId.get(255));
        Assert.assertEquals("nff={};", n.asString());
        n.setPath("/test");
        Assert.assertEquals("nff={};/* /test */", n.toString());
        n = n.createClone(10);
View Full Code Here


        map.setDescendantInlineCount(-1);

        NodeImpl n = new NodeImpl(map, 0);
        Assert.assertEquals("{}", n.asString());
        n.setId(NodeId.get(255));
        Assert.assertEquals("nff={};", n.asString());
        n.setPath("/test");
        Assert.assertEquals("nff={};/* /test */", n.toString());
        n = n.createClone(10);
        Assert.assertEquals("{}", n.asString());
        NodeImpl a = new NodeImpl(map, 0);
View Full Code Here

        n.setId(NodeId.get(255));
        Assert.assertEquals("nff={};", n.asString());
        n.setPath("/test");
        Assert.assertEquals("nff={};/* /test */", n.toString());
        n = n.createClone(10);
        Assert.assertEquals("{}", n.asString());
        NodeImpl a = new NodeImpl(map, 0);
        map.addNode(a);
        NodeImpl b = new NodeImpl(map, 0);
        map.addNode(b);
        NodeImpl c = new NodeImpl(map, 0);
View Full Code Here

        n = n.cloneAndAddChildNode("a", false, null, a, 11);
        n = n.cloneAndSetProperty("x", "1", 12);
        n.setId(NodeId.get(3));
        Assert.assertEquals("n3={\"x\":1,\"a\":n1};", n.asString());
        NodeImpl n2 = NodeImpl.fromString(map, n.asString());
        Assert.assertEquals("n3={\"x\":1,\"a\":n1};", n2.asString());

        n = new NodeImpl(map, 0);
        n = n.cloneAndAddChildNode("a", false, null, a, 1);
        Assert.assertEquals("{\"a\":n1}", n.asString());
        n = n.cloneAndAddChildNode("b", false, null, b, 2);
View Full Code Here

        n = n.cloneAndAddChildNode("d", false, null, d, 4);
        Assert.assertEquals("{\":children\":n5,\":names\":\"a\",\":children\":n6,\":names\":\"b\",\":children\":n7,\":names\":\"c\",\":children\":n8,\":names\":\"d\",\n\":childCount\":4}",
                n.asString());
        n2 = NodeImpl.fromString(map, n.asString());
        Assert.assertEquals("{\":children\":n5,\":names\":\"a\",\":children\":n6,\":names\":\"b\",\":children\":n7,\":names\":\"c\",\":children\":n8,\":names\":\"d\",\n\":childCount\":4}",
                n2.asString());
        Assert.assertTrue(n2.exists("a"));
        Assert.assertTrue(n2.exists("b"));
        Assert.assertTrue(n2.exists("c"));
        Assert.assertTrue(n2.exists("d"));
View Full Code Here

        NodeMap map = new NodeMap();
        map.setDescendantCount(true);
        map.setDescendantInlineCount(3);

        NodeImpl n = new NodeImpl(map, 0);
        Assert.assertEquals("{}", n.asString());
        NodeImpl a = new NodeImpl(map, 0);
        a.setProperty("name", "\"a\"");
        map.addNode(a);
        NodeImpl b = new NodeImpl(map, 0);
        b.setProperty("name", "\"b\"");
View Full Code Here

        n = n.cloneAndAddChildNode("a", false, null, a, 11);
        n = n.cloneAndSetProperty("x", "1", 12);
        n.setId(NodeId.get(3));
        Assert.assertEquals("n3={\"x\":1,\"a\":{\"name\":\"a\"}};", n.asString());
        NodeImpl n2 = NodeImpl.fromString(map, n.asString());
        Assert.assertEquals("n3={\"x\":1,\"a\":{\"name\":\"a\"}};", n2.asString());

        n = new NodeImpl(map, 0);
        n = n.cloneAndAddChildNode("a", false, null, a, 1);
        Assert.assertEquals("{\"a\":{\"name\":\"a\"}}", n.asString());
        n = n.cloneAndAddChildNode("b", false, null, b, 2);
View Full Code Here

        Assert.assertEquals(3, n2.getDescendantCount());
        Assert.assertEquals(3, n2.getDescendantInlineCount());

        NodeImpl root = new NodeImpl(map, 0);
        root = root.cloneAndAddChildNode("test", false, null, n2, 1);
        Assert.assertEquals("{\":size\":4,\"test\":n1}", root.asString());
        Assert.assertEquals(0, root.getDescendantInlineCount());

        n2 = n2.cloneAndRemoveChildNode("c", 4);
        root = new NodeImpl(map, 0);
        root = root.cloneAndAddChildNode("test", false, null, n2, 1);
View Full Code Here

        Assert.assertEquals(0, root.getDescendantInlineCount());

        n2 = n2.cloneAndRemoveChildNode("c", 4);
        root = new NodeImpl(map, 0);
        root = root.cloneAndAddChildNode("test", false, null, n2, 1);
        Assert.assertEquals("{\":size\":3,\"test\":" + ab + "}", root.asString());

    }

}
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.