use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class GatherStepTest method test_g_v1_out_gatherXget0X.
public void test_g_v1_out_gatherXget0X(final Pipe<Vertex, Vertex> pipe) {
super.test_g_v1_out_gatherXget0X(new GremlinPipeline(g.getVertex(1)).out().gather(new PipeFunction<List, Vertex>() {
public Vertex compute(List argument) {
return (Vertex) argument.get(0);
}
}));
super.test_g_v1_out_gatherXget0X(new GremlinPipeline(g.getVertex(1)).optimize(false).out().gather(new PipeFunction<List, Vertex>() {
public Vertex compute(List argument) {
return (Vertex) argument.get(0);
}
}));
}
use of com.tinkerpop.pipes.PipeFunction in project gremlin by tinkerpop.
the class GroupCountStepTest method test_g_V_outXcreatedX_groupCountXm__nameX.
public void test_g_V_outXcreatedX_groupCountXm__nameX() {
Map<String, Number> m = new HashMap<String, Number>();
super.test_g_V_outXcreatedX_groupCountXm__nameX(new GremlinPipeline(g.getVertices()).out("created").groupCount(m, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}), m);
m = new HashMap<String, Number>();
super.test_g_V_outXcreatedX_groupCountXm__nameX(new GremlinPipeline(g).optimize(false).V().out("created").groupCount(m, new PipeFunction<Vertex, String>() {
public String compute(Vertex vertex) {
return (String) vertex.getProperty("name");
}
}), m);
}
Aggregations