this.g.addVertex(T.label, "Person", "name", "marko");
}
@Test
public void shouldEnsureTraverseRelationshipNeedsTx() throws ScriptException {
final GremlinGroovyScriptEngine engine = new GremlinGroovyScriptEngine();
final Bindings bindings = engine.createBindings();
bindings.put("g", g);
bindings.put("#jsr223.groovy.engine.keep.globals", "phantom");
Vertex marko = this.g.addVertex(T.label, "Person", "name", "marko");
Vertex john = this.g.addVertex(T.label, "Person", "name", "john");
Vertex pete = this.g.addVertex(T.label, "Person", "name", "pete");
marko.addEdge("friend", john);
marko.addEdge("friend", pete);
this.g.tx().commit();
Object result = engine.eval("g.v(" + marko.id().toString() + ").outE('friend')", bindings);
assertTrue(result instanceof GraphTraversal);
this.g.tx().commit();
assertEquals(2L, ((GraphTraversal) result).count().next());
}