use of org.apache.jackrabbit.commons.flat.TreeManager in project jackrabbit by apache.
the class ItemSequenceTest method testSingletonNodeSequence.
public void testSingletonNodeSequence() throws RepositoryException {
Comparator<String> order = Rank.<String>comparableComparator();
TreeManager treeManager = new BTreeManager(testNode, 5, 10, order, true);
NodeSequence nodes = ItemSequence.createNodeSequence(treeManager, errorHandler);
nodes.addNode("key", NodeType.NT_UNSTRUCTURED);
assertTrue(nodes.hasItem("key"));
Iterator<Node> nodeIt = nodes.iterator();
assertTrue(nodeIt.hasNext());
assertEquals("key", nodeIt.next().getName());
assertFalse(nodeIt.hasNext());
checkTreeProperty(testNode, 5, 10, order);
checkOrder(nodes, order);
nodes.removeNode("key");
assertEmpty(nodes);
}
use of org.apache.jackrabbit.commons.flat.TreeManager in project jackrabbit by apache.
the class ItemSequenceTest method testEmptyPropertySequence.
public void testEmptyPropertySequence() throws RepositoryException {
Comparator<String> order = Rank.<String>comparableComparator();
TreeManager treeManager = new BTreeManager(testNode, 2, 4, order, true);
PropertySequence properties = ItemSequence.createPropertySequence(treeManager, errorHandler);
Iterator<Property> propertyIt = properties.iterator();
assertFalse(propertyIt.hasNext());
assertEmpty(properties);
}
Aggregations