use of org.apache.tinkerpop.gremlin.process.traversal.step.util.event.MutationListener in project sqlg by pietermartin.
the class TestDropStepTruncate method before.
@Before
public void before() throws Exception {
super.before();
configuration.setProperty("implement.foreign.keys", this.fkOn);
this.removedVertices.clear();
if (this.mutatingCallback) {
final MutationListener listener = new AbstractMutationListener() {
@Override
public void vertexRemoved(final Vertex vertex) {
removedVertices.add(vertex);
}
@Override
public void edgeRemoved(final Edge edge) {
removedEdges.add(edge);
}
};
final EventStrategy.Builder builder = EventStrategy.build().addListener(listener);
eventStrategy = builder.create();
this.dropTraversal = this.sqlgGraph.traversal();
if (this.mutatingCallback) {
this.dropTraversal = this.dropTraversal.withStrategies(this.eventStrategy);
}
} else {
this.dropTraversal = this.sqlgGraph.traversal();
}
}
Aggregations