Search in sources :

Example 1 with PruneEvaluator

use of org.neo4j.graphdb.traversal.PruneEvaluator in project graphdb by neo4j-attic.

the class TestMultiPruneEvaluators method makeSurePruneIsntCalledForStartNode.

@Test
public void makeSurePruneIsntCalledForStartNode() {
    final boolean[] calledForStartPosition = new boolean[1];
    PruneEvaluator evaluator = new PruneEvaluator() {

        public boolean pruneAfter(Path position) {
            if (position.length() == 0) {
                calledForStartPosition[0] = true;
            }
            return false;
        }
    };
    IteratorUtil.lastOrNull(Traversal.description().prune(evaluator).traverse(referenceNode()));
    assertFalse(calledForStartPosition[0]);
}
Also used : Path(org.neo4j.graphdb.Path) PruneEvaluator(org.neo4j.graphdb.traversal.PruneEvaluator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 Path (org.neo4j.graphdb.Path)1 PruneEvaluator (org.neo4j.graphdb.traversal.PruneEvaluator)1