Package org.apache.jackrabbit.oak.spi.state

Examples of org.apache.jackrabbit.oak.spi.state.NodeStoreBranch.merge()


        branch = store.branch();
        root = branch.getHead().builder();
        parent = root.child("parent");
        parent.getChildNode("child-moved").remove();
        branch.setRoot(root.getNodeState());
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);

        diff = new Diff();
        store.getRoot().compareAgainstBaseState(base, diff);

        assertEquals(1, diff.removed.size());
View Full Code Here


    private static NodeStore init(NodeStore store) throws CommitFailedException {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getHead().builder();
        builder.setChildNode("root");
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
        return store;
    }

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

            builder.child("c" + k);
        }

        builder.child("foo").child(":bar").child("quz").setProperty("p", "v");
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);

        NodeState after = store.getRoot();
        Diff diff = new Diff();
        after.compareAgainstBaseState(before, diff);
View Full Code Here

        b.child("c");
        b.child("d");
        b.child("e");
        branch.setRoot(builder.getNodeState());

        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
    }

    /**
     * Provide both :hash and :id
     */
 
View Full Code Here

    private void modifyContent() throws Exception {
        NodeStoreBranch branch = store.branch();
        NodeBuilder builder = branch.getHead().builder();
        builder.child("a").setProperty("foo", "bar");
        branch.setRoot(builder.getNodeState());
        branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
    }

    private void readTree(NodeState root) {
        for (ChildNodeEntry cne : root.getChildNodeEntries()) {
            readTree(cne.getNodeState());
View Full Code Here

            NodeStore store = new MemoryNodeStore();
            NodeStoreBranch branch = store.branch();
            try {
                branch.setRoot(root.getNodeState());
                branch.merge(EmptyHook.INSTANCE, PostCommitHook.EMPTY);
            } catch (CommitFailedException e) {
                log.error("Failed to initialize privilege content ", e);
                throw new RuntimeException(e);
            }
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.