Examples of compareAgainstBaseState()


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

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

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

}
View Full Code Here

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

            mergeLock.lock();
            try {
                rebase();
                NodeState toCommit = checkNotNull(hook).processCommit(base, head);
                JsopDiff diff = new JsopDiff(store);
                toCommit.compareAgainstBaseState(base, diff);
                NodeState newHead = store.commit(diff.toString(), base);
                committed.contentChanged(base, newHead);
                branchState = new Merged(base);
                return newHead;
            } catch (MicroKernelException e) {
View Full Code Here

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

                    committed.contentChanged(base, base);
                    branchState = new Merged(base);
                    return base;
                } else {
                    JsopDiff diff = new JsopDiff(store);
                    toCommit.compareAgainstBaseState(head, diff);
                    commit(diff.toString());
                    NodeState newRoot = store.merge(head);
                    committed.contentChanged(base, newRoot);
                    branchState = new Merged(base);
                    return newRoot;
View Full Code Here

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

            Journal parent = store.getJournal(state.get("parent").toString());
            while (!parent.setHead(base, head)) {
                RecordId newBase = parent.getHead();
                NodeBuilder builder =
                        new SegmentNodeState(segment, newBase).builder();
                after.compareAgainstBaseState(before, new MergeDiff(builder));
                RecordId newHead =
                        writer.writeNode(builder.getNodeState()).getRecordId();

                base = newBase;
                head = newHead;
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()

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

        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()

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

        replay(diff);

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

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

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

        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

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

        NodeState after = builder.getNodeState();

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

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

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

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

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