use of org.neo4j.graphdb.impl.OrderedByTypeExpander in project neo4j by neo4j.
the class TestOrderByTypeExpander method makeSureNodesAreTraversedInCorrectOrder.
@Test
public void makeSureNodesAreTraversedInCorrectOrder() {
PathExpander expander = new OrderedByTypeExpander().add(firstComment).add(comment).add(next);
Iterator<Node> itr = getGraphDb().traversalDescription().depthFirst().expand(expander).traverse(node("A1")).nodes().iterator();
assertOrder(itr, "A1", "C1", "C2", "C3", "A2", "C4", "C5", "C6", "A3", "C7", "C8", "C9");
expander = new OrderedByTypeExpander().add(next).add(firstComment).add(comment);
itr = getGraphDb().traversalDescription().depthFirst().expand(expander).traverse(node("A1")).nodes().iterator();
assertOrder(itr, "A1", "A2", "A3", "C7", "C8", "C9", "C4", "C5", "C6", "C1", "C2", "C3");
}
use of org.neo4j.graphdb.impl.OrderedByTypeExpander in project neo4j by neo4j.
the class TestOrderByTypeExpander method evenDifferentDirectionsKeepsOrder.
@Test
public void evenDifferentDirectionsKeepsOrder() throws Exception {
PathExpander expander = new OrderedByTypeExpander().add(next, INCOMING).add(firstComment).add(comment).add(next, OUTGOING);
Iterator<Node> itr = getGraphDb().traversalDescription().depthFirst().expand(expander).traverse(node("A2")).nodes().iterator();
assertOrder(itr, "A2", "A1", "C1", "C2", "C3", "C4", "C5", "C6", "A3", "C7", "C8", "C9");
}
Aggregations