http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy deleted file mode 100644 index e1206df..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovySimplePathTest.groovy +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovySimplePathTest { - - public static class Traversals extends SimplePathTest { - - @Override - public Traversal<Vertex, Vertex> get_g_VX1X_outXcreatedX_inXcreatedX_simplePath(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').in('created').simplePath", "v1Id", v1Id); - } - - @Override - public Traversal<Vertex, Path> get_g_V_repeatXboth_simplePathX_timesX3X_path() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both.simplePath).times(3).path()"); - } - } -}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy deleted file mode 100644 index 38c2a1d..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyTailTest.groovy +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Matt Frantz (http://github.com/mhfrantz) - */ -public abstract class GroovyTailTest { - - public static class Traversals extends TailTest { - - @Override - public Traversal<Vertex, String> get_g_V_valuesXnameX_order_tailXglobal_2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(global, 2)") - } - - @Override - public Traversal<Vertex, String> get_g_V_valuesXnameX_order_tailX2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(2)") - } - - @Override - public Traversal<Vertex, String> get_g_V_valuesXnameX_order_tail() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail") - } - - @Override - public Traversal<Vertex, String> get_g_V_valuesXnameX_order_tailX7X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.values('name').order.tail(7)") - } - - @Override - public Traversal<Vertex, Vertex> get_g_V_repeatXbothX_timesX3X_tailX7X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(both()).times(3).tail(7)") - } - - @Override - public Traversal<Vertex, Long> get_g_V_repeatXin_outX_timesX3X_tailX7X_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.in().out()).times(3).tail(7).count()") - } - - @Override - public Traversal<Vertex, List<String>> get_g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_tailXlocal_2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select(mixed,'a').by(unfold().values('name').fold).tail(local, 2)") - } - - @Override - public Traversal<Vertex, String> get_g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_tailXlocal_1X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select(mixed,'a').by(unfold().values('name').fold).tail(local, 1)") - } - - @Override - public Traversal<Vertex, String> get_g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_tailXlocalX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select(mixed,'a').by(unfold().values('name').fold).tail(local)") - } - - @Override - public Traversal<Vertex, String> get_g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXlimitXlocal_0XX_tailXlocal_1X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('a').out.as('a').select(mixed,'a').by(limit(local, 0)).tail(local, 1)") - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_tailXlocal_2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('b').out.as('c').select('a','b','c').by('name').tail(local, 2)") - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_tailXlocal_1X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('b').out.as('c').select('a','b','c').by('name').tail(local, 1)") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyWhereTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyWhereTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyWhereTest.groovy deleted file mode 100644 index 5a40b69..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyWhereTest.groovy +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.filter - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyWhereTest { - - public static class Traversals extends WhereTest { - - /// where(local) - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_eqXbXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').as('a').out.in.has('age').as('b').select('a','b').where('a', eq('b'))") - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_neqXbXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').as('a').out.in.has('age').as('b').select('a','b').where('a', neq('b'))") - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXb_hasXname_markoXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').as('a').out.in.has('age').as('b').select('a','b').where(__.as('b').has('name', 'marko'))") - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_outXknowsX_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().has('age').as('a').out.in.has('age').as('b').select('a','b').where(__.as('a').out('knows').as('b'))") - } - - @Override - public Traversal<Vertex, String> get_g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').where(__.as('a').name.is('josh')).in('created').name") - } - - /// where(global) - - @Override - public Traversal<Vertex, String> get_g_withSideEffectXa_josh_peterX_VX1X_outXcreatedX_inXcreatedX_name_whereXwithinXaXX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a', ['josh','peter']).V(v1Id).out('created').in('created').name.where(within('a'))", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, String> get_g_VX1X_asXaX_outXcreatedX_inXcreatedX_asXbX_whereXa_neqXbXX_name( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').in('created').as('b').where('a', neq('b')).name", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Object> get_g_VX1X_asXaX_outXcreatedX_inXcreatedX_asXbX_whereXasXbX_outXcreatedX_hasXname_rippleXX_valuesXage_nameX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').in('created').as('b').where(__.as('b').out('created').has('name','ripple')).values('age','name')", "v1Id", v1Id) - } - - // except/retain functionality - - @Override - public Traversal<Vertex, String> get_g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXeqXaXX_name( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').in('created').where(eq('a')).name", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, String> get_g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_name( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').in('created').where(neq('a')).name", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Vertex> get_g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out.aggregate('x').out.where(P.not(within('x')))", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Vertex> get_g_withSideEffectXa_graph_verticesX2XX_VX1X_out_whereXneqXaXX( - final Object v1Id, final Object v2Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a'){g.V(v2Id).next()}.V(v1Id).out.where(neq('a'))", "graph", graph, "v1Id", v1Id, "v2Id", v2Id) - } - - @Override - public Traversal<Vertex, Path> get_g_VX1X_repeatXbothEXcreatedX_whereXwithoutXeXX_aggregateXeX_otherVX_emit_path( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).repeat(__.bothE('created').where(without('e')).aggregate('e').otherV).emit.path", "v1Id", v1Id) - } - - // hasNot functionality - - @Override - public Traversal<Vertex, String> get_g_V_whereXnotXoutXcreatedXXX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.where(__.not(out('created'))).name"); - } - - // complex and/or functionality - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_asXaX_out_asXbX_whereXandXasXaX_outXknowsX_asXbX__orXasXbX_outXcreatedX_hasXname_rippleX__asXbX_inXknowsX_count_isXnotXeqX0XXXXX_selectXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('b').where(and(__.as('a').out('knows').as('b'),or(__.as('b').out('created').has('name','ripple'),__.as('b').in('knows').count.is(P.not(eq(0)))))).select('a','b')") - } - - @Override - public Traversal<Vertex, String> get_g_V_whereXoutXcreatedX_and_outXknowsX_or_inXknowsXX_valuesXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.where(out('created').and.out('knows').or.in('knows')).name") - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_asXaX_outXcreatedX_asXbX_whereXandXasXbX_in__notXasXaX_outXcreatedX_hasXname_rippleXXX_selectXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').where(and(__.as('b').in,__.not(__.as('a').out('created').has('name','ripple')))).select('a','b')") - } - - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_bothXknowsX_bothXknowsX_asXdX_whereXc__notXeqXaX_orXeqXdXXXX_selectXa_b_c_dX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').in('created').as('c').both('knows').both('knows').as('d').where('c',P.not(eq('a').or(eq('d')))).select('a','b','c','d')") - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_asXaX_out_asXbX_whereXin_count_isXeqX3XX_or_whereXoutXcreatedX_and_hasXlabel_personXXX_selectXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('b').where(__.as('b').in.count.is(eq(3)).or.where(__.as('b').out('created').and.as('b').has(label,'person'))).select('a','b')") - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_asXaX_outXcreatedX_inXcreatedX_asXbX_whereXa_gtXbXX_byXageX_selectXa_bX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').in('created').as('b').where('a', gt('b')).by('age').select('a', 'b').by('name')") - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_whereXa_gtXbX_orXeqXbXXX_byXageX_byXweightX_byXweightX_selectXa_cX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').outE('created').as('b').inV().as('c').where('a', gt('b').or(eq('b'))).by('age').by('weight').by('weight').select('a', 'c').by('name')") - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_asXaX_outEXcreatedX_asXbX_inV_asXcX_inXcreatedX_asXdX_whereXa_ltXbX_orXgtXcXX_andXneqXdXXX_byXageX_byXweightX_byXinXcreatedX_valuesXageX_minX_selectXa_c_dX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().as('a').outE('created').as('b').inV().as('c').in('created').as('d').where('a', lt('b').or(gt('c')).and(neq('d'))).by('age').by('weight').by(__.in('created').values('age').min()).select('a', 'c', 'd').by('name')") - } - - @Override - public Traversal<Vertex, String> get_g_VX1X_asXaX_out_hasXageX_whereXgtXaXX_byXageX_name(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out.has('age').where(gt('a')).by('age').name", "v1Id", v1Id) - } - - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddEdgeTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddEdgeTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddEdgeTest.groovy deleted file mode 100644 index b3d5f49..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddEdgeTest.groovy +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Edge -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyAddEdgeTest { - - public static class Traversals extends AddEdgeTest { - - @Override - public Traversal<Vertex, Edge> get_g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').addE('createdBy').to('a')", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Edge> get_g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX_propertyXweight_2X( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').addE('createdBy').to('a').property('weight', 2.0d)", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Edge> get_g_V_aggregateXxX_asXaX_selectXxX_unfold_addEXexistsWithX_toXaX_propertyXtime_nowX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.aggregate('x').as('a').select('x').unfold.addE('existsWith').to('a').property('time', 'now')"); - } - - @Override - public Traversal<Vertex, Edge> get_g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_addEXcodeveloperX_fromXaX_toXbX_propertyXyear_2009X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').in('created').where(neq('a')).as('b').addE('codeveloper').from('a').to('b').property('year', 2009)"); - } - - @Override - public Traversal<Vertex, Edge> get_g_V_asXaX_inXcreatedX_addEXcreatedByX_fromXaX_propertyXyear_2009X_propertyXacl_publicX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').in('created').addE('createdBy').from('a').property('year', 2009).property('acl', 'public')"); - } - - @Override - public Traversal<Vertex, Edge> get_g_VX1X_asXaX_outXcreatedX_addOutEXcreatedBy_aX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').addOutE('createdBy', 'a')", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Edge> get_g_VX1X_asXaX_outXcreatedX_addOutEXcreatedBy_a_weight_2X( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').addOutE('createdBy', 'a', 'weight', 2.0d)", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Edge> get_g_withSideEffectXx__g_V_toListX_addOutEXexistsWith_x_time_nowX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('x',g.V.toList()).V.addOutE('existsWith', 'x', 'time', 'now')"); - } - - @Override - public Traversal<Vertex, Edge> get_g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_selectXa_bX_addInEXa_codeveloper_b_year_2009X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').in('created').where(neq('a')).as('b').select('a','b').addInE('a', 'codeveloper', 'b', 'year', 2009)"); - } - - @Override - public Traversal<Vertex, Edge> get_g_V_asXaX_inXcreatedX_addInEXcreatedBy_a_year_2009_acl_publicX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').in('created').addInE('createdBy', 'a', 'year', 2009, 'acl', 'public')"); - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy deleted file mode 100644 index 00312fa..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyAddVertexTest.groovy +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyAddVertexTest { - - public static class Traversals extends AddVertexTest { - - @Override - public Traversal<Vertex, Vertex> get_g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').addV('animal').property('age', select('a').by('age')).property('name', 'puppy')", "v1Id", v1Id); - } - - @Override - public Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXage_0X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().addV('animal').property('age', 0)") - } - - @Override - public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXname_stephenX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.addV(label, 'person', 'name', 'stephen')") - } - - @Override - public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXname_stephenX_propertyXname_stephenmX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.addV('person').property('name', 'stephen').property('name', 'stephenm')") - } - - @Override - public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenmX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.addV('person').property(VertexProperty.Cardinality.single, 'name', 'stephen').property(VertexProperty.Cardinality.single, 'name', 'stephenm')") - } - - @Override - public Traversal<Vertex, Vertex> get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenm_since_2010X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.addV('person').property(VertexProperty.Cardinality.single, 'name', 'stephen').property(VertexProperty.Cardinality.single, 'name', 'stephenm', 'since', 2010)") - } - - @Override - public Traversal<Vertex, Vertex> get_g_V_hasXname_markoX_propertyXfriendWeight_outEXknowsX_weight_sum__acl_privateX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('name', 'marko').property('friendWeight', outE('knows').weight.sum(), 'acl', 'private')") - } - - @Override - public Traversal<Vertex, Vertex> get_g_addVXanimalX_propertyXname_mateoX_propertyXname_gateoX_propertyXname_cateoX_propertyXage_5X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.addV('animal').property('name', 'mateo').property('name', 'gateo').property('name', 'cateo').property('age', 5)") - } - - @Override - public Traversal<Vertex, Vertex> get_g_V_addVXanimalX_propertyXname_valuesXnameXX_propertyXname_an_animalX_propertyXvaluesXnameX_labelX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.addV('animal').property('name', values('name')).property('name', 'an animal').property(values('name'), label())") - } - - @Override - public Traversal<Vertex, Map<String, List<String>>> get_g_withSideEffectXa_testX_V_hasLabelXsoftwareX_propertyXtemp_selectXaXX_valueMapXname_tempX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a', 'test').V.hasLabel('software').property('temp', select('a')).valueMap('name', 'temp')") - } - - @Override - public Traversal<Vertex, String> get_g_withSideEffectXa_markoX_addV_propertyXname_selectXaXX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a', 'marko').addV().property('name', select('a')).name") - } - - ///////// DEPRECATED BELOW - - @Override - public Traversal<Vertex, Vertex> get_g_V_addVXlabel_animal_age_0X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.addV(label, 'animal', 'age', 0)") - } - - @Override - public Traversal<Vertex, Vertex> get_g_addVXlabel_person_name_stephenX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.addV(label, 'person', 'name', 'stephen')") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCoalesceTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCoalesceTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCoalesceTest.groovy deleted file mode 100644 index e6765f5..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCoalesceTest.groovy +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * - * @author Daniel Kuppitz (http://gremlin.guru) - */ -public abstract class GroovyCoalesceTest { - - public static class Traversals extends CoalesceTest { - - @Override - public Traversal<Vertex, Vertex> get_g_V_coalesceXoutXfooX_outXbarXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().coalesce(out('foo'), out('bar'))") - } - - @Override - public Traversal<Vertex, String> get_g_VX1X_coalesceXoutXknowsX_outXcreatedXX_valuesXnameX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).coalesce(out('knows'), out('created')).values('name')", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, String> get_g_VX1X_coalesceXoutXcreatedX_outXknowsXX_valuesXnameX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).coalesce(out('created'), out('knows')).values('name')", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Map<String, Long>> get_g_V_coalesceXoutXlikesX_outXknowsX_inXcreatedXX_groupCount_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().coalesce(out('likes'), out('knows'), out('created')).groupCount().by('name')") - } - - @Override - Traversal<Vertex, Path> get_g_V_coalesceXoutEXknowsX_outEXcreatedXX_otherV_path_byXnameX_byXlabelX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.coalesce(outE('knows'), outE('created')).otherV.path.by('name').by(T.label)") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyConstantTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyConstantTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyConstantTest.groovy deleted file mode 100644 index 1fa03c0..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyConstantTest.groovy +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Matt Frantz (http://github.com/mhfrantz) - */ -public abstract class GroovyConstantTest { - - public static class Traversals extends ConstantTest { - @Override - public Traversal<Vertex, Integer> get_g_V_constantX123X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.constant(123)") - } - - @Override - public Traversal<Vertex, String> get_g_V_chooseXhasLabelXpersonX_valuesXnameX_constantXinhumanXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.choose(hasLabel('person'), values('name'), constant('inhuman'))") - } - - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCountTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCountTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCountTest.groovy deleted file mode 100644 index 898f16c..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyCountTest.groovy +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyCountTest { - - public static class Traversals extends CountTest { - @Override - public Traversal<Vertex, Long> get_g_V_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.count()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_out_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.count") - } - - @Override - public Traversal<Vertex, Long> get_g_V_both_both_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.both.both.count()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_repeatXoutX_timesX3X_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().repeat(__.out).times(3).count()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_repeatXoutX_timesX8X_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.out).times(8).count()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_repeatXoutX_timesX5X_asXaX_outXwrittenByX_asXbX_selectXa_bX_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(out()).times(5).as('a').out('writtenBy').as('b').select('a', 'b').count()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_hasXnoX_count() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('no').count") - } - - @Override - public Traversal<Vertex, Long> get_g_V_fold_countXlocalX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.fold.count(local)") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFlatMapTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFlatMapTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFlatMapTest.groovy deleted file mode 100644 index 712b9bf..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFlatMapTest.groovy +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Matt Frantz (http://github.com/mhfrantz) - */ -public abstract class GroovyFlatMapTest { - - public static class Traversals extends FlatMapTest { - @Override - public Traversal<Vertex, Vertex> get_g_V_asXaX_flatMapXselectXaXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').flatMap(select('a'))") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFoldTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFoldTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFoldTest.groovy deleted file mode 100644 index c8ee43d..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyFoldTest.groovy +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyFoldTest { - - public static class Traversals extends FoldTest { - @Override - public Traversal<Vertex, List<Vertex>> get_g_V_fold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.fold") - } - - @Override - public Traversal<Vertex, Vertex> get_g_V_fold_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.fold.unfold") - } - - @Override - public Traversal<Vertex, Integer> get_g_V_age_foldX0_plusX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.age.fold(0,sum)") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyGraphTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyGraphTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyGraphTest.groovy deleted file mode 100644 index cff3e65..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyGraphTest.groovy +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Edge -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyGraphTest { - - public static class Traversals extends GraphTest { - - @Override - public Traversal<Vertex, String> get_g_VX1X_V_valuesXnameX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).V.name", "v1Id", v1Id); - } - - @Override - public Traversal<Vertex, String> get_g_V_outXknowsX_V_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('knows').V.name") - } - - @Override - public Traversal<Vertex, String> get_g_V_hasXname_GarciaX_inXsungByX_asXsongX_V_hasXname_Willie_DixonX_inXwrittenByX_whereXeqXsongXX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('name','Garcia').in('sungBy').as('song').V.has('name','Willie_Dixon').in('writtenBy').where(eq('song')).name") - } - - @Override - public Traversal<Vertex, Edge> get_g_V_hasLabelXpersonX_asXpX_VXsoftwareX_addInEXuses_pX() { - def software = g.V().hasLabel("software").toList() - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('person').as('p').V(software).addE('uses').from('p')", "software", software) - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyLoopsTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyLoopsTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyLoopsTest.groovy deleted file mode 100644 index 58c9ca9..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyLoopsTest.groovy +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Path -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Daniel Kuppitz (http://gremlin.guru) - */ -public abstract class GroovyLoopsTest { - - public static class Traversals extends LoopsTest { - - @Override - Traversal<Vertex, Path> get_g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_or_loops_isX3XX_hasXname_peterX_path_byXnameX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).repeat(__.both.simplePath).until(has('name', 'peter').or.loops.is(3)).has('name', 'peter').path.by('name')", "v1Id", v1Id) - } - - @Override - Traversal<Vertex, Path> get_g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_or_loops_isX2XX_hasXname_peterX_path_byXnameX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).repeat(__.both.simplePath).until(has('name', 'peter').or.loops.is(2)).has('name', 'peter').path.by('name')", "v1Id", v1Id) - } - - @Override - Traversal<Vertex, Path> get_g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_and_loops_isX3XX_hasXname_peterX_path_byXnameX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).repeat(__.both.simplePath).until(has('name', 'peter').and.loops.is(3)).has('name', 'peter').path.by('name')", "v1Id", v1Id) - } - - @Override - Traversal<Vertex, String> get_g_V_emitXhasXname_markoX_or_loops_isX2XX_repeatXoutX_valuesXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.emit(has('name', 'marko').or.loops.is(2)).repeat(__.out).name") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapKeysTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapKeysTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapKeysTest.groovy deleted file mode 100644 index 1430147..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapKeysTest.groovy +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * - * @author Daniel Kuppitz (http://gremlin.guru) - */ -public abstract class GroovyMapKeysTest { - - public static class Traversals extends MapKeysTest { - - @Override - public Traversal<Vertex, Double> get_g_V_outE_valuesXweightX_groupCount_mapKeys() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE().weight.groupCount().mapKeys()") - } - - @Override - public Traversal<Vertex, Double> get_g_V_outE_valuesXweightX_groupCount_unfold_mapKeys() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE().weight.groupCount().unfold().mapKeys()") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapTest.groovy deleted file mode 100644 index 59eb1ce..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapTest.groovy +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Stephen Mallette (http://stephen.genoprime.com) - */ -public abstract class GroovyMapTest { - - public static class Traversals extends MapTest { - - @Override - public Traversal<Vertex, String> get_g_VX1X_mapXnameX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).map { v -> v.name }", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Integer> get_g_VX1X_outE_label_mapXlengthX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE.label.map { l -> l.length() }", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, Integer> get_g_VX1X_out_mapXnameX_mapXlengthX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out.map { v -> v.name }.map { n -> n.length() }", "v1Id", v1Id) - } - - @Override - public Traversal<Vertex, String> get_g_withPath_V_asXaX_out_mapXa_nameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withPath().V.as('a').out.map { v -> v.path('a').name }") - } - - @Override - public Traversal<Vertex, String> get_g_withPath_V_asXaX_out_out_mapXa_name_it_nameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withPath().V().as('a').out.out().map { v -> v.path('a').name + v.name }") - } - - @Override - public Traversal<Vertex, Vertex> get_g_V_mapXselectXaXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').map(select('a'))") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapValuesTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapValuesTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapValuesTest.groovy deleted file mode 100644 index 5adf0ee..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMapValuesTest.groovy +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * - * @author Daniel Kuppitz (http://gremlin.guru) - */ -public abstract class GroovyMapValuesTest { - - public static class Traversals extends MapValuesTest { - - @Override - public Traversal<Vertex, Long> get_g_V_outE_valuesXweightX_groupCount_mapValues() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE().weight.groupCount().mapValues()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_outE_valuesXweightX_groupCount_unfold_mapValues() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE().weight.groupCount().unfold().mapValues()") - } - - @Override - public Traversal<Vertex, Long> get_g_V_outE_valuesXweightX_groupCount_mapValues_groupCount_mapValues() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE().weight.groupCount().mapValues().groupCount().mapValues()") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy deleted file mode 100644 index 8c36d26..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMatchTest.groovy +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.MatchAlgorithmStrategy -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex -import org.junit.Before - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyMatchTest { - - public static class GreedyMatchTraversals extends Traversals { - @Before - public void setupTest() { - super.setupTest(); - g = graphProvider.traversal(graph, MatchAlgorithmStrategy.build().algorithm(MatchStep.GreedyMatchAlgorithm.class).create()); - } - } - - public static class CountMatchTraversals extends Traversals { - @Before - public void setupTest() { - super.setupTest(); - g = graphProvider.traversal(graph, MatchAlgorithmStrategy.build().algorithm(MatchStep.CountMatchAlgorithm.class).create()); - } - } - - public abstract static class Traversals extends MatchTest { - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_valueMap_matchXa_selectXnameX_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap.match(__.as('a').select('name').as('b'))") - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_out_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out.as('b'))") - } - - @Override - public Traversal<Vertex, Object> get_g_V_matchXa_out_bX_selectXb_idX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match( __.as('a').out.as('b')).select('b').by(id)") - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_knows_b__b_created_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('knows').as('b'), - __.as('b').out('created').as('c')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_knows_b__a_created_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('knows').as('b'), - __.as('a').out('created').as('c')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXd_0knows_a__d_hasXname_vadasX__a_knows_b__b_created_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('d').in('knows').as('a'), - __.as('d').has('name', 'vadas'), - __.as('a').out('knows').as('b'), - __.as('b').out('created').as('c')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_created_b__a_repeatXoutX_timesX2XX_selectXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('created').as('b'), - __.as('a').repeat(__.out).times(2).as('b')).select('a', 'b') - """) - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_matchXa_created_lop_b__b_0created_29_c__c_whereXrepeatXoutX_timesX2XXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('created').has('name', 'lop').as('b'), - __.as('b').in('created').has('age', 29).as('c'), - __.as('c').where(repeat(__.out).times(2))) - """) - } - - @Override - public Traversal<Vertex, String> get_g_V_out_out_matchXa_0created_b__b_0knows_cX_selectXcX_outXcreatedX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.out.out.match( - __.as('a').in('created').as('b'), - __.as('b').in('knows').as('c')).select('c').out('created').name - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_created_b__b_0created_aX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('created').as('b'), - __.as('b').in('created').as('a')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_knows_b__c_knows_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V().match( - __.as('a').out('knows').as('b'), - __.as('c').out('knows').as('b')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_knows_b__b_created_lop__b_matchXb_created_d__d_0created_cX_selectXcX_cX_selectXa_b_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as("a").out("knows").as("b"), - __.as("b").out("created").has("name", "lop"), - __.as("b").match( - __.as("b").out("created").as("d"), - __.as("d").in("created").as("c")).select("c").as("c")).select('a','b','c') - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_hasXname_GarciaX__a_0writtenBy_b__a_0sungBy_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').has('name', 'Garcia'), - __.as('a').in('writtenBy').as('b'), - __.as('a').in('sungBy').as('b')); - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_0sungBy_b__a_0sungBy_c__b_writtenBy_d__c_writtenBy_e__d_hasXname_George_HarisonX__e_hasXname_Bob_MarleyXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').in('sungBy').as('b'), - __.as('a').in('sungBy').as('c'), - __.as('b').out('writtenBy').as('d'), - __.as('c').out('writtenBy').as('e'), - __.as('d').has('name', 'George_Harrison'), - __.as('e').has('name', 'Bob_Marley')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_0sungBy_b__a_0writtenBy_c__b_writtenBy_d__c_sungBy_d__d_hasXname_GarciaXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').in('sungBy').as('b'), - __.as('a').in('writtenBy').as('c'), - __.as('b').out('writtenBy').as('d'), - __.as('c').out('sungBy').as('d'), - __.as('d').has('name', 'Garcia')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_0sungBy_b__a_0writtenBy_c__b_writtenBy_dX_whereXc_sungBy_dX_whereXd_hasXname_GarciaXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').in('sungBy').as('b'), - __.as('a').in('writtenBy').as('c'), - __.as('b').out('writtenBy').as('d')) - .where(__.as('c').out('sungBy').as('d')) - .where(__.as('d').has('name', 'Garcia')); - """) - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_matchXa_created_lop_b__b_0created_29_cX_whereXc_repeatXoutX_timesX2XX_selectXa_b_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as("a").out("created").has("name", "lop").as("b"), - __.as("b").in("created").has("age", 29).as("c")) - .where(__.as("c").repeat(__.out).times(2)) - .select('a','b','c') - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_created_b__b_0created_cX_whereXa_neq_cX_selectXa_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('created').as('b'), - __.as('b').in('created').as('c')) - .where('a', neq('c')) - .select('a', 'c') - """) - } - - @Override - public Traversal<Vertex, Map<String, String>> get_g_V_matchXa_created_b__c_created_bX_selectXa_b_cX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('created').as('b'), - __.as('c').out('created').as('b')).select('a','b','c').by('name') - """) - } - - @Override - public Traversal<Vertex, String> get_g_V_out_asXcX_matchXb_knows_a__c_created_eX_selectXcX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V().out().as("c").match( - __.as("b").out("knows").as("a"), - __.as("c").out("created").as("e")).select("c") - """) - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_matchXa_whereXa_neqXcXX__a_created_b__orXa_knows_vadas__a_0knows_and_a_hasXlabel_personXX__b_0created_c__b_0created_count_isXgtX1XXX_selectXa_b_cX_byXidX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - where('a', neq('c')), - __.as('a').out('created').as('b'), - or( - __.as('a').out('knows').has('name', 'vadas'), - __.as('a').in('knows').and.as('a').has(label, 'person') - ), - __.as('b').in('created').as('c'), - __.as('b').in('created').count.is(gt(1))) - .select('a','b','c').by(id); - """) - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_asXaX_out_asXbX_matchXa_out_count_c__b_in_count_cX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.as('a').out.as('b').match(__.as('a').out.count.as('c'), __.as('b').in.count.as('c')) - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_hasXname_GarciaX__a_0writtenBy_b__b_followedBy_c__c_writtenBy_d__whereXd_neqXaXXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').has('name', 'Garcia'), - __.as('a').in('writtenBy').as('b'), - __.as('b').out('followedBy').as('c'), - __.as('c').out('writtenBy').as('d'), - where('d', neq('a'))) - """) - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_matchXa_knows_b__andXa_created_c__b_created_c__andXb_created_count_d__a_knows_count_dXXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out('knows').as('b'), - and( - __.as('a').out('created').as('c'), - __.as('b').out('created').as('c'), - and( - __.as('b').out('created').count.as('d'), - __.as('a').out('knows').count.as('d') - ) - )) - """) - } - - public Traversal<Vertex, Map<String, Object>> get_g_V_asXaX_out_asXbX_matchXa_out_count_c__orXa_knows_b__b_in_count_c__and__c_isXgtX2XXXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.as('a').out.as('b'). - match( - __.as('a').out.count.as('c'), - or( - __.as('a').out('knows').as('b'), - __.as('b').in.count.as('c').and.as('c').is(gt(2)) - ) - ) - """) - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_matchXa__a_out_b__notXa_created_bXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').out.as('b'), - __.not(__.as('a').out('created').as('b'))); - """) - } - - @Override - public Traversal<Vertex, Map<String, Object>> get_g_V_matchXwhereXandXa_created_b__b_0created_count_isXeqX3XXXX__a_both_b__whereXb_inXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - where(and( - __.as('a').out('created').as('b'), - __.as('b').in('created').count.is(eq(3)))), - __.as('a').both.as('b'), - where(__.as('b').in())); - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa__a_both_b__b_both_cX_dedupXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').both.as('b'), - __.as('b').both.as('c')).dedup('a','b') - """) - } - - @Override - public Traversal<Vertex, Map<String, Vertex>> get_g_V_matchXa_both_b__b_both_cX_dedupXa_bX_byXlabelX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as('a').both.as('b'), - __.as('b').both.as('c')).dedup('a','b').by(label) - """) - } - - @Override - public Traversal<Vertex, Long> get_g_V_hasLabelXsongsX_matchXa_name_b__a_performances_cX_selectXb_cX_count() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.hasLabel('song').match( - __.as('a').values('name').as('b'), - __.as('a').values('performances').as('c') - ).select('b', 'c').count(); - """) - } - - @Override - public Traversal<Vertex, Long> get_g_V_matchXa_knows_count_bX_selectXbX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out('knows').count.as('b')).select('b')") - } - - @Override - public Traversal<Vertex, String> get_g_V_matchXa_knows_b__b_created_c__a_created_cX_dedupXa_b_cX_selectXaX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out('knows').as('b'), __.as('b').out('created').as('c'), __.as('a').out('created').as('c')).dedup('a', 'b', 'c').select('a').by('name')") - } - - @Override - public Traversal<Vertex, String> get_g_V_notXmatchXa_age_b__a_name_cX_whereXb_eqXcXX_selectXaXX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.not(match( - __.as('a').age.as('b'), - __.as('a').name.as('c')). - where('b', eq('c')).select('a')).name - """) - } - - @Override - public Traversal<Vertex, Long> get_g_V_matchXa_followedBy_count_isXgtX10XX_b__a_0followedBy_count_isXgtX10XX_bX_count() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.match( - __.as("a").out("followedBy").count.is(gt(10)).as("b"), - __.as("a").in("followedBy").count().is(gt(10)).as("b")).count; - """) - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMaxTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMaxTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMaxTest.groovy deleted file mode 100644 index ef7376b..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMaxTest.groovy +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyMaxTest { - - public static class Traversals extends MaxTest { - - @Override - public Traversal<Vertex, Integer> get_g_V_age_max() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.age.max") - } - - @Override - public Traversal<Vertex, Integer> get_g_V_repeatXbothX_timesX5X_age_max() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both).times(5).age.max") - } - - @Override - public Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_maxX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('software').group().by('name').by(bothE().weight.max)") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMeanTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMeanTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMeanTest.groovy deleted file mode 100644 index 6776287..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMeanTest.groovy +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyMeanTest { - - public static class Traversals extends MeanTest { - - @Override - public Traversal<Vertex, Double> get_g_V_age_mean() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.age.mean") - } - - @Override - public Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_meanX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('software').group().by('name').by(bothE().weight.mean)") - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e2d1eedc/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMinTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMinTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMinTest.groovy deleted file mode 100644 index f35b7ef..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyMinTest.groovy +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.map - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal -import org.apache.tinkerpop.gremlin.process.traversal.util.ScriptTraversal -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyMinTest { - - public static class Traversals extends MinTest { - - @Override - public Traversal<Vertex, Integer> get_g_V_age_min() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.age.min") - } - - @Override - public Traversal<Vertex, Integer> get_g_V_repeatXbothX_timesX5X_age_min() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both).times(5).age.min") - } - - @Override - public Traversal<Vertex, Map<String, Number>> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_minX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('software').group().by('name').by(bothE().weight.min())") - } - } -}