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

Examples of org.apache.jackrabbit.oak.spi.state.ChildNodeEntry


        Iterable<ChildNodeEntry> children = (Iterable<ChildNodeEntry>) store.getChildNodeEntries(indexState, true);
        assertNotNull("The iterable cannot be null", children);
        assertEquals("Expecting 3 items in the index", 3, Iterators.size(children.iterator()));

        // ensuring the right sequence
        ChildNodeEntry entry = null;
        children = (Iterable<ChildNodeEntry>) store.getChildNodeEntries(indexState, true);
        Iterator<ChildNodeEntry> it = children.iterator();
        assertTrue("We should still have elements left to loop through", it.hasNext());
        entry = it.next();
        assertEquals("The first element should be :start", START, entry.getName());
        assertEquals("Wrong entry returned", nodeStart, entry.getNodeState());
        assertTrue("We should still have elements left to loop through", it.hasNext());
        entry = it.next();
        assertEquals("The second element should be n1", n1, entry.getName());
        assertEquals("Wrong entry returned", node1, entry.getNodeState());
        assertTrue("We should still have elements left to loop through", it.hasNext());
        entry = it.next();
        assertEquals("The third element should be n0", n0, entry.getName());
        assertEquals("Wrong entry returned", node0, entry.getNodeState());
        assertFalse("We should be at the end of the list", it.hasNext());
    }
View Full Code Here


        Iterable<? extends ChildNodeEntry> children = store.getChildNodeEntries(index.getNodeState(), true);
        assertEquals("Wrong size of Iterable", 1, Iterators.size(children.iterator()));

        Iterator<? extends ChildNodeEntry> it = store.getChildNodeEntries(index.getNodeState(), true).iterator();
        assertTrue("We should have at least 1 element", it.hasNext());
        ChildNodeEntry entry = it.next();
        assertEquals(":start is expected", START, entry.getName());
        assertEquals("wrong node returned", nodeStart, entry.getNodeState());
        assertFalse("We should be at the end of the list", it.hasNext());
    }
View Full Code Here

        Iterator<? extends ChildNodeEntry> children = store.getChildNodeEntries(index.getNodeState(), true).iterator();
        assertEquals("Wrong number of children", 1, Iterators.size(children));

        children = store.getChildNodeEntries(index.getNodeState(), true).iterator();
        assertTrue("at least one item expected", children.hasNext());
        ChildNodeEntry child = children.next();
        assertEquals(START, child.getName());
        assertEquals(nodeStart, child.getNodeState());
        assertFalse(children.hasNext());
    }
View Full Code Here

        index.setChildNode(START, nodeStart);
        index.setChildNode(n0, node0);

        NodeState indexState = index.getNodeState();
        ChildNodeEntry previous = store.findPrevious(indexState, node0);
        assertNotNull(previous);
        assertEquals("the :start node is expected", nodeStart, previous.getNodeState());
    }
View Full Code Here

        Iterable<? extends ChildNodeEntry> children = store.getChildNodeEntries(indexState);
        assertNotNull("The iterable cannot be null", children);
        assertEquals("Expecting 2 items in the index", 2, Iterators.size(children.iterator()));

        // ensuring the right sequence
        ChildNodeEntry entry = null;
        children = store.getChildNodeEntries(indexState);
        Iterator<? extends ChildNodeEntry> it = children.iterator();
        assertTrue("We should have 2 elements left to loop through", it.hasNext());
        entry = it.next();
        assertEquals("The first element should be n1", n1, entry.getName());
        assertEquals("Wrong entry returned", node1, entry.getNodeState());
        assertTrue("We should have 1 elements left to loop through", it.hasNext());
        entry = it.next();
        assertEquals("The second element should be n0", n0, entry.getName());
        assertEquals("Wrong entry returned", node0, entry.getNodeState());
        assertFalse("We should have be at the end of the list", it.hasNext());
    }
View Full Code Here

        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n2));
        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n3));

        String searchFor = n1;

        ChildNodeEntry item = OrderedContentMirrorStoreStrategy.seek(index.getNodeState(),
            new OrderedContentMirrorStoreStrategy.PredicateEquals(searchFor));

        assertNotNull("we should have found an item", item);
        assertEquals(searchFor, item.getName());
    }
View Full Code Here

        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n2));
        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n3));

        String searchFor = n1;

        ChildNodeEntry item = OrderedContentMirrorStoreStrategy.seek(index.getNodeState(),
            new OrderedContentMirrorStoreStrategy.PredicateGreaterThan(searchFor));

        assertNull("no item should have been found", item);
    }
View Full Code Here

        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n2));
        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n3));

        String searchFor = n2;

        ChildNodeEntry item = OrderedContentMirrorStoreStrategy.seek(index.getNodeState(),
            new OrderedContentMirrorStoreStrategy.PredicateGreaterThan(searchFor));

        assertNotNull("we should have found an item", item);
        assertEquals(n1, item.getName());
    }
View Full Code Here

        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n2));
        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n3));

        String searchFor = KEYS[3];

        ChildNodeEntry item = OrderedContentMirrorStoreStrategy.seek(index.getNodeState(),
            new OrderedContentMirrorStoreStrategy.PredicateGreaterThan(searchFor, true));

        assertNull("we should have not found an item", item);
    }
View Full Code Here

        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n2));
        store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n3));

        String searchFor = n2;

        ChildNodeEntry item = OrderedContentMirrorStoreStrategy.seek(index.getNodeState(),
            new OrderedContentMirrorStoreStrategy.PredicateGreaterThan(searchFor, true));

        assertNotNull("we should have found an item", item);
        assertEquals(n2, item.getName());
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.spi.state.ChildNodeEntry

Copyright © 2018 www.massapicom. 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.