Examples of compareAgainstBaseState()


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

        NodeState after = builder.getNodeState();

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

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

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

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

        NodeState after = builder.getNodeState();

        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

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

        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

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

        NodeState after = builder.getNodeState();

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

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

}
View Full Code Here

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

        for (String name : Sets.difference(afterNames, beforeNames)) {
            expect(diff.childNodeAdded(name, after.getChildNode(name))).andReturn(true);
        }
        replay(diff);

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

}
View Full Code Here

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

        builder.child("foo").child(":bar").child("quz").setProperty("p", "v");
        store.merge(builder, EmptyHook.INSTANCE, CommitInfo.EMPTY);

        NodeState after = store.getRoot();
        Diff diff = new Diff();
        after.compareAgainstBaseState(before, diff);

        assertEquals(0, diff.removed.size());
        assertEquals(childNodeCount + 1, diff.added.size());
        assertEquals(0, diff.addedProperties.size());
    }
View Full Code Here

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

        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

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

        NodeState afterTypes =
                after.getChildNode(JCR_SYSTEM).getChildNode(JCR_NODE_TYPES);

        Set<String> modifiedTypes = Collections.emptySet();
        TypeRegistration registration = new TypeRegistration();
        afterTypes.compareAgainstBaseState(beforeTypes, registration);
        if (registration.isModified()) {
            afterTypes = registration.apply(builder);
            modifiedTypes = registration.getModifiedTypes(beforeTypes);
        }
View Full Code Here

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

            SegmentWriter writer = new SegmentWriter(store);
            while (!parent.setHead(base, head)) {
                RecordId newBase = parent.getHead();
                NodeBuilder builder =
                        new SegmentNodeState(store, newBase).builder();
                after.compareAgainstBaseState(before, new MergeDiff(builder));
                RecordId newHead =
                        writer.writeNode(builder.getNodeState()).getRecordId();
                writer.flush();

                base = newBase;
View Full Code Here

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

            SegmentWriter writer = new SegmentWriter(store);
            while (!parent.setHead(base, head)) {
                RecordId newBase = parent.getHead();
                NodeBuilder builder =
                        new SegmentNodeState(store, newBase).builder();
                after.compareAgainstBaseState(before, new MergeDiff(builder));
                NodeState state = builder.getNodeState();
                RecordId newHead = writer.writeNode(state).getRecordId();
                writer.flush();

                base = newBase;
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.