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

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


        NodeState after = persist(builder);

        expect(diff.propertyDeleted(before.getProperty("foo"))).andReturn(true);
        replay(diff);

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

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


        NodeState after = persist(builder);

        expect(diff.childNodeAdded("test", after.getChildNode("test"))).andReturn(true);
        replay(diff);

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

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

        expect(diff.childNodeChanged(
                "baz", before.getChildNode("baz"), after.getChildNode("baz"))).andReturn(true);
        replay(diff);

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

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

        NodeState after = persist(builder);

        expect(diff.childNodeDeleted("baz", before.getChildNode("baz"))).andReturn(true);
        replay(diff);

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

    private NodeState persist(NodeBuilder builder) {
        NodeState state = writer.writeNode(builder.getNodeState());
View Full Code Here

    public void testSameState() {
        NodeState node = persist(builder);

        replay(diff);

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

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

        NodeState before = persist(builder);
        NodeState after = persist(builder);

        replay(diff);

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

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

        NodeState after = persist(builder);

        expect(diff.propertyAdded(after.getProperty("test"))).andReturn(true);
        replay(diff);

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

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

        expect(diff.propertyChanged(
                before.getProperty("foo"), after.getProperty("foo"))).andReturn(true);
        replay(diff);

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

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

        NodeStore store = new MemoryNodeStore(base);
        BuiltInNodeTypes.register(new SystemRoot(store, new EditorHook(
                new CompositeEditorProvider(new NamespaceEditorProvider(),
                        new RegistrationEditorProvider()))));
        NodeState target = store.getRoot();
        target.compareAgainstBaseState(base, new ApplyDiff(builder));
    }

}
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

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.