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

Examples of org.apache.jackrabbit.oak.spi.state.NodeState.compareAgainstBaseState()


            private NodeState baseLine = store.getRoot();

            @Override
            public void getChanges(NodeStateDiff diff) {
                NodeState head = store.getRoot();
                head.compareAgainstBaseState(baseLine, diff);
                baseLine = head;
            }
        };
    }
View Full Code Here


        NodeState base = ns3.retrieve(base3); // branch base
        assertNotNull(base);
        NodeState branchHead = ns3.retrieve(b3);
        assertNotNull(branchHead);
        TrackingDiff diff = new TrackingDiff();
        branchHead.compareAgainstBaseState(base, diff);
        assertEquals(1, diff.added.size());
        assertEquals(Sets.newHashSet("/mk3"), diff.added);
        assertEquals(new HashSet<String>(), diff.deleted);

        mk1.dispose();
View Full Code Here

                    jsop.tag('*');
                }
                jsop.key(kpath).value(path);

                if (state != kstate) {
                    state.compareAgainstBaseState(
                            kstate, new JsopDiff(jsop, path));
                }
            }

            for (String path : deleted) {
View Full Code Here

            private NodeState baseLine = store.getRoot();

            @Override
            public void getChanges(NodeStateDiff diff) {
                NodeState head = store.getRoot();
                head.compareAgainstBaseState(baseLine, diff);
                baseLine = head;
            }
        };
    }
View Full Code Here

            throws MicroKernelException {
        NodeState before = getNode(fromRevisionId, path);
        NodeState after = getNode(toRevisionId, path);

        JsopDiff diff = new JsopDiff(path, depth);
        after.compareAgainstBaseState(before, diff);
        return diff.toString();
    }

    @Override
    public boolean nodeExists(String path, String revisionId)
View Full Code Here

            Editor childEditor = editor.childNodeDeleted(name, before);
            if (childEditor != null) {
                childEditor.enter(before, after);

                EditorDiff diff = new EditorDiff(childEditor);
                if (!after.compareAgainstBaseState(before, diff)) {
                    exception = diff.exception;
                    return false;
                }

                childEditor.leave(before, after);
View Full Code Here

            } catch (RepositoryException e) {
                log.error("Failed to register built-in privileges", e);
                throw new RuntimeException(e);
            }
            NodeState target = store.getRoot();
            target.compareAgainstBaseState(base, new ApplyDiff(builder));
        }
    }
}
View Full Code Here

            log.error(errorMsg, e);
            throw new RuntimeException(e);
        }

        NodeState target = store.getRoot();
        target.compareAgainstBaseState(base, new ApplyDiff(builder));
    }

}
View Full Code Here

    public void testSameState() {
        NodeState node = builder.getNodeState();

        replay(diff);

        node.compareAgainstBaseState(node, diff);
        verify(diff);
    }

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

        NodeState before = builder.getNodeState();
        NodeState after = before.builder().getNodeState();

        replay(diff);

        after.compareAgainstBaseState(before, diff);
        verify(diff);
    }

    @Test
    public void testPropertyAdded() {
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.