use of com.orientechnologies.orient.core.command.OCommandPredicate in project orientdb by orientechnologies.
the class TraverseTest method traverseAPIIterating.
@Test
public void traverseAPIIterating() {
int cycles = 0;
for (OIdentifiable id : new OTraverse().target(database.browseClass("Movie").iterator()).predicate(new OCommandPredicate() {
@Override
public Object evaluate(OIdentifiable iRecord, ODocument iCurrentResult, OCommandContext iContext) {
return ((Integer) iContext.getVariable("depth")) <= 2;
}
})) {
cycles++;
}
Assert.assertTrue(cycles > 0);
}
Aggregations