Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 979AC200C08 for ; Thu, 26 Jan 2017 16:59:35 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 964D4160B40; Thu, 26 Jan 2017 15:59:35 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 4BDBF160B61 for ; Thu, 26 Jan 2017 16:59:33 +0100 (CET) Received: (qmail 17104 invoked by uid 500); 26 Jan 2017 15:59:32 -0000 Mailing-List: contact commits-help@tinkerpop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tinkerpop.apache.org Delivered-To: mailing list commits@tinkerpop.apache.org Received: (qmail 16863 invoked by uid 99); 26 Jan 2017 15:59:32 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jan 2017 15:59:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C1166F174B; Thu, 26 Jan 2017 15:59:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: spmallette@apache.org To: commits@tinkerpop.apache.org Date: Thu, 26 Jan 2017 15:59:38 -0000 Message-Id: <14a7ce63983e471cb2e3db0973d3f2b6@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [08/15] tinkerpop git commit: TINKERPOP-1612 WIP - first step to removal of gremlin-groovy-test archived-at: Thu, 26 Jan 2017 15:59:35 -0000 http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy deleted file mode 100644 index de33944..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyOrderTest.groovy +++ /dev/null @@ -1,140 +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 GroovyOrderTest { - - public static class Traversals extends OrderTest { - - @Override - public Traversal get_g_V_name_order() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().name.order()") - } - - @Override - public Traversal get_g_V_name_order_byXa1_b1X_byXb2_a2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.order.by { a, b -> a[1] <=> b[1] }.by { a, b -> b[2] <=> a[2] }") - } - - @Override - public Traversal get_g_V_order_byXname_incrX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', incr).name") - } - - @Override - public Traversal get_g_V_order_byXnameX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name').name") - } - - @Override - public Traversal get_g_V_outE_order_byXweight_decrX_weight() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.order.by('weight', Order.decr).weight") - } - - @Override - public Traversal get_g_V_order_byXname_a1_b1X_byXname_b2_a2X_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by('name', { a, b -> a[1].compareTo(b[1]) }).by('name', { a, b -> b[2].compareTo(a[2]) }).name") - } - - @Override - public Traversal> get_g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('created').as('b').order.by(shuffle).select('a','b')") - } - - @Override - public Traversal> get_g_VX1X_hasXlabel_personX_mapXmapXint_ageXX_orderXlocalX_byXvalues_decrX_byXkeys_incrX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", """g.V(v1Id).hasLabel("person").map { - final Map map = [:]; - map[1] = it.age; - map[2] = it.age * 2; - map[3] = it.age * 3; - map[4] = it.age; - return map; - }.order(local).by(values,decr).by(keys,incr)""", "v1Id", v1Id) - } - - @Override - public Traversal get_g_V_order_byXoutE_count__decrX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.order.by(__.outE.count, decr)") - } - - @Override - public Traversal>> get_g_V_group_byXlabelX_byXname_order_byXdecrX_foldX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(label).by(values('name').order().by(decr).fold())") - } - - @Override - public Traversal> get_g_V_localXbothE_weight_foldX_order_byXsumXlocalX_decrX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.bothE.weight.fold).order.by(sum(local), decr)") - } - - @Override - public Traversal> get_g_V_asXvX_mapXbothE_weight_foldX_sumXlocalX_asXsX_selectXv_sX_order_byXselectXsX_decrX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('v').map(__.bothE.weight.fold).sum(local).as('s').select('v', 's').order.by(select('s'),decr)") - } - - @Override - public Traversal get_g_V_hasLabelXpersonX_order_byXageX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').order.by('age')") - } - - @Override - public Traversal> get_g_V_hasLabelXpersonX_fold_orderXlocalX_byXageX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').fold.order(local).by('age')") - } - - @Override - public Traversal get_g_V_hasLabelXpersonX_order_byXvalueXageX__decrX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').order.by({it.age},decr).name") - } - - @Override - public Traversal get_g_V_properties_order_byXkey_decrX_key() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.properties().order.by(key, decr).key") - } - - @Override - public Traversal get_g_V_hasXsong_name_OHBOYX_outXfollowedByX_outXfollowedByX_order_byXperformancesX_byXsongType_incrX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('song', 'name', 'OH BOY').out('followedBy').out('followedBy').order.by('performances').by('songType',decr)") - } - - @Override - public Traversal get_g_V_both_hasLabelXpersonX_order_byXage_decrX_limitX5X_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.both.hasLabel('person').order.by('age',decr).limit(5).name") - } - - @Override - public Traversal get_g_V_both_hasLabelXpersonX_order_byXage_decrX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.both.hasLabel('person').order.by('age',decr).name") - } - - @Override - public Traversal get_g_V_hasLabelXsongX_order_byXperfomances_decrX_byXnameX_rangeX110_120X_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('song').order.by('performances',decr).by('name').range(110, 120).name") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPageRankTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPageRankTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPageRankTest.groovy deleted file mode 100644 index 13787cc..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPageRankTest.groovy +++ /dev/null @@ -1,78 +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 GroovyPageRankTest { - - public static class Traversals extends PageRankTest { - - @Override - public Traversal get_g_V_pageRank() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.pageRank") - } - - @Override - public Traversal>> get_g_V_pageRank_byXoutEXknowsXX_byXfriendRankX_valueMapXname_friendRankX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.pageRank.by(outE('knows')).by('friendRank').valueMap('name','friendRank')") - } - - @Override - public Traversal get_g_V_pageRank_order_byXpageRank_decrX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.pageRank.order.by(PageRankVertexProgram.PAGE_RANK, decr).name") - } - - @Override - public Traversal get_g_V_pageRank_order_byXpageRank_decrX_name_limitX2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.pageRank.order.by(PageRankVertexProgram.PAGE_RANK, decr).name.limit(2)") - } - - @Override - public Traversal>> get_g_V_hasLabelXpersonX_pageRank_byXpageRankX_order_byXpageRankX_valueMapXname_pageRankX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').pageRank.by('pageRank').order.by('pageRank').valueMap('name', 'pageRank')") - } - - @Override - public Traversal> get_g_V_pageRank_byXpageRankX_asXaX_outXknowsX_pageRank_asXbX_selectXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.pageRank.by('pageRank').as('a').out('knows').values('pageRank').as('b').select('a', 'b')") - } - - @Override - public Traversal>> get_g_V_hasLabelXsoftwareX_hasXname_rippleX_pageRankX1X_byXinEXcreatedXX_timesX1X_byXpriorsX_inXcreatedX_unionXboth__identityX_valueMapXname_priorsX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('software').has('name', 'ripple').pageRank(1.0).by(inE('created')).times(1).by('priors').in('created').union(identity(),both()).valueMap('name', 'priors')") - } - - @Override - public Traversal>> get_g_V_outXcreatedX_groupXmX_byXlabelX_pageRankX1X_byXpageRankX_byXinEX_timesX1X_inXcreatedX_groupXmX_byXpageRankX_capXmX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').group('m').by(label).pageRank(1.0).by('pageRank').by(inE()).times(1).in('created').group('m').by('pageRank').cap('m')") - } - - @Override - public Traversal>> get_g_V_outXcreatedX_pageRank_byXbothEX_byXprojectRankX_timesX0X_valueMapXname_projectRankX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').pageRank().by(bothE()).by('projectRank').times(0).valueMap('name','projectRank')") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy deleted file mode 100644 index 15c499a..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPathTest.groovy +++ /dev/null @@ -1,63 +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 Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyPathTest { - - public static class Traversals extends PathTest { - - @Override - public Traversal get_g_VX1X_name_path(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).name.path", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_out_path_byXageX_byXnameX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out.path.by('age').by('name')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_V_repeatXoutX_timesX2X_path_by_byXnameX_byXlangX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.out).times(2).path.by.by('name').by('lang')") - } - - @Override - public Traversal get_g_V_out_out_path_byXnameX_byXageX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.out.path.by('name').by('age')") - } - - @Override - public Traversal get_g_V_asXaX_hasXname_markoX_asXbX_hasXage_29X_asXcX_path() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').has('name', 'marko').as('b').has('age', 29).as('c').path") - } - - @Override - public Traversal get_g_VX1X_outEXcreatedX_inV_inE_outV_path(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('created').inV.inE.outV.path()", "v1Id", v1Id) - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPeerPressureTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPeerPressureTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPeerPressureTest.groovy deleted file mode 100644 index 6ec0750..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPeerPressureTest.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 Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyPeerPressureTest { - - public static class Traversals extends PeerPressureTest { - - @Override - public Traversal get_g_V_peerPressure() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.peerPressure") - } - - @Override - public Traversal> get_g_V_peerPressure_byXclusterX_byXoutEXknowsXX_pageRankX1X_byXrankX_byXoutEXknowsXX_timesX2X_group_byXclusterX_byXrank_sumX_limitX100X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.peerPressure.by('cluster').by(outE('knows')).pageRank(1.0).by('rank').by(outE('knows')).times(1).group.by('cluster').by(values('rank').sum).limit(100)") - } - - @Override - public Traversal>> get_g_V_hasXname_rippleX_inXcreatedX_peerPressure_byXoutEX_byXclusterX_repeatXunionXidentity__bothX_timesX2X_dedup_valueMapXname_clusterX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('name', 'ripple').in('created').peerPressure.by(outE()).by('cluster').repeat(union(identity(), both())).times(2).dedup.valueMap('name', 'cluster')") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProfileTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProfileTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProfileTest.groovy deleted file mode 100644 index f2dbfbf..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProfileTest.groovy +++ /dev/null @@ -1,94 +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.process.traversal.util.TraversalMetrics -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Bob Briody (http://bobbriody.com - */ -public abstract class GroovyProfileTest { - - public static class Traversals extends ProfileTest { - - @Override - public Traversal get_g_V_out_out_profile() { - g.V.out.out.profile() // locked traversal - } - - @Override - public Traversal get_g_V_repeatXbothX_timesX3X_profile() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both()).times(3).profile()"); - } - - @Override - public Traversal get_g_V_whereXinXcreatedX_count_isX1XX_name_profile() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().where(__.in('created').count().is(1l)).values('name').profile()"); - } - - @Override - public Traversal get_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profile() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().sideEffect{Thread.sleep(10)}.sideEffect{Thread.sleep(5)}.profile()") - } - - @Override - public Traversal get_g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profile() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out('created').as('b'), __.as('b').in.count.is(eq(1))).select('a', 'b').profile()") - } - - @Override - public Traversal get_g_V_out_out_profileXmetricsX() { - g.V.out.out.profile('metrics') // locked traversal - } - - @Override - public Traversal get_g_V_repeatXbothX_timesX3X_profileXmetricsX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.both()).times(3).profile('metrics')"); - } - - @Override - public Traversal get_g_V_whereXinXcreatedX_count_isX1XX_name_profileXmetricsX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().where(__.in('created').count().is(1l)).values('name').profile('metrics')"); - } - - @Override - public Traversal get_g_V_sideEffectXThread_sleepX10XX_sideEffectXThread_sleepX5XX_profileXmetricsX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().sideEffect{Thread.sleep(10)}.sideEffect{Thread.sleep(5)}.profile('metrics')") - } - - @Override - public Traversal> get_g_V_matchXa_created_b__b_in_count_isXeqX1XXX_selectXa_bX_profileXmetricsX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.match(__.as('a').out('created').as('b'), __.as('b').in.count.is(eq(1))).select('a', 'b').profile('metrics')") - } - - @Override - public Traversal get_g_V_hasLabelXpersonX_pageRank_byXrankX_byXbothEX_rank_profile() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').pageRank.by('rank').by(bothE()).rank.profile()") - } - - @Override - public Traversal get_g_V_groupXmX_profile() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group('m').profile") - } - } -} - http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProgramTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProgramTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProgramTest.groovy deleted file mode 100644 index 7abe113..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProgramTest.groovy +++ /dev/null @@ -1,50 +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 GroovyProgramTest { - - public static class Traversals extends ProgramTest { - - @Override - public Traversal get_g_V_programXpageRankX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.program(PageRankVertexProgram.build().create(graph))") - } - - @Override - public Traversal>> get_g_V_hasLabelXpersonX_programXpageRank_rankX_order_byXrank_incrX_valueMapXname_rankX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').program(PageRankVertexProgram.build().property('rank').create(graph)).order.by('rank',incr).valueMap('name','rank')"); - } - - @Override - public Traversal> get_g_V_outXcreatedX_aggregateXxX_byXlangX_groupCount_programXTestProgramX_asXaX_selectXa_xX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').aggregate('x').by('lang').groupCount.program(new ${ProgramTest.TestProgram.class.getCanonicalName()}()).as('a').select('a', 'x')"); - } - } -} - - http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProjectTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProjectTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProjectTest.groovy deleted file mode 100644 index c20867c..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyProjectTest.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 GroovyProjectTest { - - public static class Traversals extends ProjectTest { - @Override - public Traversal> get_g_V_hasLabelXpersonX_projectXa_bX_byXoutE_countX_byXageX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').project('a','b').by(outE().count).by('age')") - } - - @Override - public Traversal get_g_V_outXcreatedX_projectXa_bX_byXnameX_byXinXcreatedX_countX_order_byXselectXbX__decrX_selectXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').project('a', 'b').by('name').by(__.in('created').count).order.by(select('b'),decr).select('a')") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy deleted file mode 100644 index c74e823..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyPropertiesTest.groovy +++ /dev/null @@ -1,60 +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 -import org.apache.tinkerpop.gremlin.structure.VertexProperty - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyPropertiesTest { - - public static class Traversals extends PropertiesTest { - - @Override - public Traversal get_g_V_hasXageX_propertiesXname_ageX_value() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').properties('name', 'age').value") - } - - @Override - public Traversal get_g_V_hasXageX_propertiesXage_nameX_value() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').properties('age', 'name').value") - } - - @Override - public Traversal get_g_V_hasXageX_properties_hasXid_nameIdX_value(final Object nameId) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').properties().has(T.id, nameId).value()", "nameId", nameId) - } - - @Override - public Traversal> get_g_V_hasXageX_propertiesXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('age').properties('name')") - } - - @Override - public Traversal, String> get_g_injectXg_VX1X_propertiesXnameX_nextX_value( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.inject(g.V(v1Id).properties('name').next()).value()", "v1Id", v1Id) - } - } - -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy deleted file mode 100644 index 789c36f..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy +++ /dev/null @@ -1,242 +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.Pop -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) - * @author Daniel Kuppitz (http://gremlin.guru) - */ -public abstract class GroovySelectTest { - - public static class Traversals extends SelectTest { - - @Override - public Traversal> get_g_VX1X_asXaX_outXknowsX_asXbX_selectXa_bX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('knows').as('b').select('a','b')", "v1Id", v1Id) - } - - @Override - public Traversal> get_g_VX1X_asXaX_outXknowsX_asXbX_selectXa_bX_byXnameX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('knows').as('b').select('a','b').by('name')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_asXaX_outXknowsX_asXbX_selectXaX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('knows').as('b').select('a')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_asXaX_outXknowsX_asXbX_selectXaX_byXnameX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('knows').as('b').select('a').by('name')", "v1Id", v1Id) - } - - @Override - public Traversal> get_g_V_asXaX_out_asXbX_selectXa_bX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.as('b').select('a','b').by('name')") - } - - @Override - public Traversal> get_g_V_asXaX_out_aggregateXxX_asXbX_selectXa_bX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out.aggregate('x').as('b').select('a','b').by('name')") - } - - @Override - public Traversal> get_g_V_asXaX_name_order_asXbX_selectXa_bX_byXnameX_by_XitX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().as('a').name.order().as('b').select('a','b').by('name').by") - } - - @Override - public Traversal> get_g_V_hasXname_gremlinX_inEXusesX_order_byXskill_incrX_asXaX_outV_asXbX_selectXa_bX_byXskillX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('name', 'gremlin').inE('uses').order.by('skill', Order.incr).as('a').outV.as('b').select('a','b').by('skill').by('name')") - } - - @Override - public Traversal get_g_V_hasXname_isXmarkoXX_asXaX_selectXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('name',__.is('marko')).as('a').select('a')") - } - - @Override - public Traversal> get_g_V_label_groupCount_asXxX_selectXxX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().label().groupCount().as('x').select('x')") - } - - @Override - public Traversal> get_g_V_hasLabelXpersonX_asXpX_mapXbothE_label_groupCountX_asXrX_selectXp_rX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').as('p').map(__.bothE.label.groupCount()).as('r').select('p','r')") - } - - @Override - public Traversal get_g_V_chooseXoutE_count_isX0X__asXaX__asXbXX_chooseXselectXaX__selectXaX__selectXbXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.choose(__.outE().count().is(0L), __.as('a'), __.as('b')).choose(select('a'),select('a'),select('b'))") - } - - // below are original back()-tests - - @Override - public Traversal get_g_VX1X_asXhereX_out_selectXhereX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('here').out.select('here')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX4X_out_asXhereX_hasXlang_javaX_selectXhereX(final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).out.as('here').has('lang', 'java').select('here')", "v4Id", v4Id) - } - - @Override - public Traversal get_g_VX4X_out_asXhereX_hasXlang_javaX_selectXhereX_name( - final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).out.as('here').has('lang', 'java').select('here').name", "v4Id", v4Id) - } - - @Override - public Traversal get_g_VX1X_outE_asXhereX_inV_hasXname_vadasX_selectXhereX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE.as('here').inV.has('name', 'vadas').select('here')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outEXknowsX_hasXweight_1X_asXhereX_inV_hasXname_joshX_selectXhereX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('knows').has('weight', 1.0d).as('here').inV.has('name', 'josh').select('here')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outEXknowsX_asXhereX_hasXweight_1X_inV_hasXname_joshX_selectXhereX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('knows').as('here').has('weight', 1.0d).inV.has('name', 'josh').select('here')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outEXknowsX_asXhereX_hasXweight_1X_asXfakeX_inV_hasXname_joshX_selectXhereX( - final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('knows').as('here').has('weight', 1.0d).as('fake').inV.has('name', 'josh').select('here')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_V_asXhereXout_name_selectXhereX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().as('here').out.name.select('here')") - } - - - @Override - public Traversal> get_g_V_outXcreatedX_unionXasXprojectX_inXcreatedX_hasXname_markoX_selectXprojectX__asXprojectX_inXcreatedX_inXknowsX_hasXname_markoX_selectXprojectXX_groupCount_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", """g.V.out('created') - .union(__.as('project').in('created').has('name', 'marko').select('project'), - __.as('project').in('created').in('knows').has('name', 'marko').select('project')).groupCount().by('name')""") - } - - @Override - public Traversal> get_g_V_asXaX_hasXname_markoX_asXbX_asXcX_selectXa_b_cX_by_byXnameX_byXageX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').has('name', 'marko').as('b').as('c').select('a','b','c').by().by('name').by('age')") - } - - @Override - public Traversal> get_g_V_hasLabelXsoftwareX_asXnameX_asXlanguageX_asXcreatorsX_selectXname_language_creatorsX_byXnameX_byXlangX_byXinXcreatedX_name_fold_orderXlocalXX() { - new ScriptTraversal<>(g, "gremlin-groovy", """g.V.hasLabel('software').as('name').as('language').as('creators').select('name','language','creators').by('name').by('lang'). - by(__.in('created').values('name').fold().order(local))""") - } - - // TINKERPOP-619: select should not throw - - @Override - public Traversal get_g_V_selectXaX(final Pop pop) { - final String root = "g.V." - new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a')" : "select(${pop}, 'a')")) - } - - @Override - public Traversal> get_g_V_selectXa_bX(final Pop pop) { - final String root = "g.V." - new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a', 'b')" : "select(${pop}, 'a', 'b')")) - } - - @Override - public Traversal get_g_V_valueMap_selectXpop_aX(final Pop pop) { - final String root = "g.V.valueMap." - new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a')" : "select(${pop}, 'a')")) - } - - @Override - public Traversal> get_g_V_valueMap_selectXpop_a_bX(final Pop pop) { - final String root = "g.V.valueMap." - new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a', 'b')" : "select(${pop}, 'a', 'b')")) - } - - // when labels don't exist - - @Override - public Traversal get_g_V_untilXout_outX_repeatXin_asXaXX_selectXaX_byXtailXlocalX_nameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.until(__.out.out).repeat(__.in.as('a')).select('a').by(tail(local).name)") - } - - @Override - public Traversal> get_g_V_untilXout_outX_repeatXin_asXaX_in_asXbXX_selectXa_bX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.until(__.out.out).repeat(__.in.as('a').in.as('b')).select('a','b').by('name')") - } - - @Override - public Traversal get_g_V_asXaX_whereXoutXknowsXX_selectXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().as('a').where(out('knows')).select('a')") - } - - // select column tests - - @Override - public Traversal get_g_V_outE_weight_groupCount_selectXvaluesX_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.weight.groupCount.select(values).unfold") - } - - @Override - public Traversal get_g_V_outE_weight_groupCount_unfold_selectXvaluesX_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.weight.groupCount.unfold.select(values).unfold") - } - - @Override - public Traversal get_g_V_outE_weight_groupCount_selectXvaluesX_unfold_groupCount_selectXvaluesX_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.weight.groupCount.select(values).unfold.groupCount.select(values).unfold") - } - - @Override - public Traversal get_g_V_outE_weight_groupCount_selectXkeysX_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.weight.groupCount.select(keys).unfold") - } - - @Override - public Traversal get_g_V_outE_weight_groupCount_unfold_selectXkeysX_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.weight.groupCount.unfold.select(keys).unfold") - } - - @Override - public Traversal>> get_g_V_asXa_bX_out_asXcX_path_selectXkeysX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a','b').out.as('c').path.select(keys)") - } - - @Override - public Traversal> get_g_V_asXaX_outXknowsX_asXbX_localXselectXa_bX_byXnameXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.as('a').out('knows').as('b').local(select('a', 'b').by('name'))") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySumTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySumTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySumTest.groovy deleted file mode 100644 index f863398..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySumTest.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 Daniel Kuppitz (http://gremlin.guru) - */ -public abstract class GroovySumTest { - - public static class Traversals extends SumTest { - - @Override - public Traversal get_g_V_valuesXageX_sum() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.age.sum") - } - - @Override - public Traversal> get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_sumX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('software').group().by('name').by(bothE().weight.sum)") - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyUnfoldTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyUnfoldTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyUnfoldTest.groovy deleted file mode 100644 index 8f8058e..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyUnfoldTest.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.Edge -import org.apache.tinkerpop.gremlin.structure.Vertex - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyUnfoldTest { - - public static class Traversals extends UnfoldTest { - - @Override - public Traversal get_g_V_localXoutE_foldX_unfold() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.local(__.outE.fold).unfold") - } - - @Override - public Traversal get_g_V_valueMap_unfold_mapXkeyX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap.unfold.map { it.key }") - } - - @Override - Traversal get_g_VX1X_repeatXboth_simplePathX_untilXhasIdX6XX_path_byXnameX_unfold(Object v1Id, Object v6Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).repeat(__.both.simplePath).until(hasId(v6Id)).path.by('name').unfold", "v1Id", v1Id, "v6Id", v6Id) - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyValueMapTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyValueMapTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyValueMapTest.groovy deleted file mode 100644 index 6e339f9..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyValueMapTest.groovy +++ /dev/null @@ -1,51 +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 GroovyValueMapTest { - - public static class Traversals extends ValueMapTest { - @Override - public Traversal> get_g_V_valueMap() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap"); - } - - @Override - public Traversal> get_g_V_valueMapXname_ageX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap('name', 'age')") - } - - @Override - public Traversal>> get_g_VX1X_outXcreatedX_valueMap(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').valueMap", "v1Id", v1Id) - } - - @Override - public Traversal> get_g_V_hasLabelXpersonX_filterXoutEXcreatedXX_valueMapXtrueX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('person').filter(__.outE('created')).valueMap(true)") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy deleted file mode 100644 index ce5fe6f..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy +++ /dev/null @@ -1,187 +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 GroovyVertexTest { - - public static class Traversals extends VertexTest { - - @Override - public Traversal get_g_VXlistXv1_v2_v3XX_name( - final Vertex v1, final Vertex v2, final Vertex v3) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(ids).name", "ids", [v1, v2, v3]) - } - - @Override - public Traversal get_g_VXlistX1_2_3XX_name( - final Object v1Id, final Object v2Id, final Object v3Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(ids).name", "ids", [v1Id, v2Id, v3Id]) - } - - @Override - public Traversal get_g_V() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V") - } - - @Override - public Traversal get_g_VX1X_out(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out", "v1Id", v1Id); - } - - @Override - public Traversal get_g_VX2X_in(final Object v2Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v2Id).in", "v2Id", v2Id); - } - - @Override - public Traversal get_g_VX4X_both(final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).both", "v4Id", v4Id); - } - - @Override - public Traversal get_g_E() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.E") - } - - @Override - public Traversal get_g_EX11X(final Object e11Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.E(e11Id)", "e11Id", e11Id) - } - - @Override - public Traversal get_g_VX1X_outE(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE", "v1Id", v1Id); - } - - @Override - public Traversal get_g_VX2X_inE(final Object v2Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v2Id).inE", "v2Id", v2Id); - } - - @Override - public Traversal get_g_VX4X_bothE(final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).bothE", "v4Id", v4Id); - } - - @Override - public Traversal get_g_VX4X_bothEXcreatedX(final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).bothE('created')", "v4Id", v4Id); - } - - @Override - public Traversal get_g_VX1X_outE_inV(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE.inV", "v1Id", v1Id); - } - - @Override - public Traversal get_g_VX2X_inE_outV(final Object v2Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v2Id).inE.outV", "v2Id", v2Id); - } - - @Override - public Traversal get_g_V_outE_hasXweight_1X_outV() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.outE.has('weight', 1.0d).outV") - } - - @Override - public Traversal get_g_V_out_outE_inV_inE_inV_both_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.outE.inV.inE.inV.both.name") - } - - @Override - public Traversal get_g_VX1X_outEXknowsX_bothV_name(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('knows').bothV.name", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outXknowsX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('knows')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outXknows_createdX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('knows', 'created')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outEXknowsX_inV(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('knows').inV()", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outEXknows_createdX_inV(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE('knows', 'created').inV", "v1Id", v1Id) - } - - @Override - public Traversal get_g_V_out_out() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out().out()") - } - - @Override - public Traversal get_g_VX1X_out_out_out(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out.out.out", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_out_name(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out.name", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1X_outE_otherV(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).outE.otherV", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX4X_bothE_otherV(final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).bothE.otherV", "v4Id", v4Id) - } - - @Override - public Traversal get_g_VX4X_bothE_hasXweight_lt_1X_otherV(final Object v4Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v4Id).bothE.has('weight', lt(1.0d)).otherV", "v4Id", v4Id) - } - - @Override - public Traversal get_g_VX1X_to_XOUT_knowsX(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).to(Direction.OUT, 'knows')", "v1Id", v1Id) - } - - @Override - public Traversal get_g_VX1_2_3_4X_name( - final Object v1Id, final Object v2Id, final Object v3Id, final Object v4Id) { - g.V(v3Id).drop().iterate(); - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id, v2Id, v4Id, v3Id).name", "v1Id", v1Id, "v2Id", v2Id, "v3Id", v3Id, "v4Id", v4Id) - } - - @Override - public Traversal get_g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').V.hasLabel('software').name") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy deleted file mode 100644 index d9d4a04..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyAggregateTest.groovy +++ /dev/null @@ -1,53 +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.sideEffect - -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 GroovyAggregateTest { - - public static class Traversals extends AggregateTest { - - @Override - public Traversal> get_g_V_name_aggregateXxX_capXxX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.name.aggregate('x').cap('x')") - } - - @Override - public Traversal> get_g_V_aggregateXxX_byXnameX_capXxX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.aggregate('x').by('name').cap('x')") - } - - @Override - public Traversal get_g_V_out_aggregateXaX_path() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.aggregate('a').path") - } - - @Override - public Traversal> get_g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').aggregate('x').by('age').cap('x').as('y').select('y')") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyExplainTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyExplainTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyExplainTest.groovy deleted file mode 100644 index c284e0f..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyExplainTest.groovy +++ /dev/null @@ -1,35 +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.sideEffect - -import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalExplanation - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public abstract class GroovyExplainTest { - - public static class Traversals extends ExplainTest { - - public TraversalExplanation get_g_V_outE_identity_inV_explain() { - g.V().outE().identity().inV().explain() - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupCountTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupCountTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupCountTest.groovy deleted file mode 100644 index 77ba1c1..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupCountTest.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.sideEffect - -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 GroovyGroupCountTest { - - public static class Traversals extends GroupCountTest { - - @Override - public Traversal> get_g_V_outXcreatedX_groupCount_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').groupCount.by('name')") - } - - @Override - public Traversal> get_g_V_outXcreatedX_groupCountXaX_byXnameX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').groupCount('a').by('name').cap('a')") - } - - @Override - public Traversal> get_g_V_outXcreatedX_name_groupCount() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').name.groupCount") - } - - @Override - public Traversal> get_g_V_outXcreatedX_groupCountXxX_capXxX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').groupCount('x').cap('x')") - } - - @Override - public Traversal> get_g_V_outXcreatedX_name_groupCountXaX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('created').name.groupCount('a').cap('a')") - } - - @Override - public Traversal> get_g_V_hasXnoX_groupCount() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('no').groupCount") - } - - @Override - public Traversal> get_g_V_hasXnoX_groupCountXaX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('no').groupCount('a').cap('a')") - } - - @Override - public Traversal> get_g_V_repeatXout_groupCountXaX_byXnameXX_timesX2X_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.out.groupCount('a').by('name')).times(2).cap('a')") - } - - @Override - public Traversal> get_g_V_unionXrepeatXoutX_timesX2X_groupCountXmX_byXlangXX__repeatXinX_timesX2X_groupCountXmX_byXnameXX_capXmX() { - new ScriptTraversal<>(g, "gremlin-groovy", """ - g.V.union( - __.repeat(__.out).times(2).groupCount('m').by('lang'), - __.repeat(__.in).times(2).groupCount('m').by('name')).cap('m') - """) - } - - @Override - public Traversal> get_g_V_groupCount_byXbothE_countX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.groupCount.by(bothE().count)") - } - - @Override - public Traversal get_g_V_unionXoutXknowsX__outXcreatedX_inXcreatedXX_groupCount_selectXvaluesX_unfold_sum() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.union(out('knows'), out('created').in('created')).groupCount.select(values).unfold.sum") - } - - @Override - public Traversal> get_g_V_both_groupCountXaX_out_capXaX_selectXkeysX_unfold_both_groupCountXaX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.both.groupCount('a').out.cap('a').select(keys).unfold.both.groupCount('a').cap('a')") - } - - @Override - public Traversal get_g_V_both_groupCountXaX_byXlabelX_asXbX_barrier_whereXselectXaX_selectXsoftwareX_isXgtX2XXX_selectXbX_name() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.both.groupCount('a').by(label).as('b').barrier.where(select('a').select('software').is(gt(2))).select('b').name") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTest.groovy deleted file mode 100644 index fc0c55d..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTest.groovy +++ /dev/null @@ -1,137 +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.sideEffect - -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 GroovyGroupTest { - - public static class Traversals extends GroupTest { - - @Override - public Traversal>> get_g_V_group_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by('name')") - } - - @Override - public Traversal>> get_g_V_group_byXnameX_by() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by('name').by") - } - - @Override - public Traversal>> get_g_V_groupXaX_byXnameX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group('a').by('name').cap('a')") - } - - @Override - public Traversal>> get_g_V_hasXlangX_groupXaX_byXlangX_byXnameX_out_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('lang').group('a').by('lang').by('name').out.cap('a')") - } - - @Override - public Traversal> get_g_V_hasXlangX_group_byXlangX_byXcountX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('lang').group.by('lang').by(count())") - } - - @Override - public Traversal> get_g_V_repeatXout_groupXaX_byXnameX_byXcountX_timesX2X_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.out.group('a').by('name').by(count())).times(2).cap('a')") - } - - @Override - public Traversal>> get_g_V_group_byXoutE_countX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by(__.outE.count).by('name')") - } - - @Override - public Traversal> get_g_V_groupXaX_byXlabelX_byXoutE_weight_sumX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group('a').by(label).by(outE().weight.sum).cap('a')"); - } - - @Override - public Traversal> get_g_V_repeatXbothXfollowedByXX_timesX2X_group_byXsongTypeX_byXcountX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(both('followedBy')).times(2).group.by('songType').by(count())") - } - - @Override - public Traversal> get_g_V_repeatXbothXfollowedByXX_timesX2X_groupXaX_byXsongTypeX_byXcountX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(both('followedBy')).times(2).group('a').by('songType').by(count()).cap('a')") - } - - @Override - public Traversal> get_g_V_group_byXname_substring_1X_byXconstantX1XX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group.by{it.name[0]}.by(constant(1l))") - } - - @Override - public Traversal> get_g_V_groupXaX_byXname_substring_1X_byXconstantX1XX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group('a').by{it.name[0]}.by(constant(1l)).cap('a')") - } - - @Override - public Traversal get_g_V_out_group_byXlabelX_selectXpersonX_unfold_outXcreatedX_name_limitX2X() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out.group.by(label).select('person').unfold.out('created').name.limit(2)") - } - - @Override - public Traversal>> get_g_V_hasLabelXsongX_group_byXnameX_byXproperties_groupCount_byXlabelXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('song').group.by('name').by(__.properties().groupCount.by(label))") - } - - @Override - public Traversal>> get_g_V_hasLabelXsongX_groupXaX_byXnameX_byXproperties_groupCount_byXlabelXX_out_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('song').group('a').by('name').by(__.properties().groupCount.by(label)).out.cap('a')") - } - - @Override - public Traversal>> get_g_V_repeatXunionXoutXknowsX_groupXaX_byXageX__outXcreatedX_groupXbX_byXnameX_byXcountXX_groupXaX_byXnameXX_timesX2X_capXa_bX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(union(out('knows').group('a').by('age'), out('created').group('b').by('name').by(count())).group('a').by('name')).times(2).cap('a', 'b')") - } - - @Override - public Traversal>>> get_g_V_group_byXbothE_countX_byXgroup_byXlabelXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group().by(bothE().count).by(group().by(label))") - } - - @Override - public Traversal>> get_g_V_outXfollowedByX_group_byXsongTypeX_byXbothE_group_byXlabelX_byXweight_sumXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.out('followedBy').group.by('songType').by(bothE().group.by(label).by(values('weight').sum))") - } - - @Override - public Traversal> get_g_V_groupXmX_byXnameX_byXinXknowsX_nameX_capXmX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group('m').by('name').by(__.in('knows').name).cap('m')") - } - - @Override - public Traversal> get_g_V_group_byXlabelX_byXbothE_groupXaX_byXlabelX_byXweight_sumX_weight_sumX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.group().by(label).by(bothE().group('a').by(label).by(values('weight').sum).weight.sum)") - } - - @Override - public Traversal>> get_g_withSideEffectXa__marko_666_noone_blahX_V_groupXaX_byXnameX_byXoutE_label_foldX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.withSideEffect('a', map).V().group('a').by('name').by(outE().label.fold).cap('a')", "map", new HashMap<>(["marko": [666], "noone": ["blah"]])); - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTestV3d0.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTestV3d0.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTestV3d0.groovy deleted file mode 100644 index d8e9706..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyGroupTestV3d0.groovy +++ /dev/null @@ -1,74 +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.sideEffect - -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) - */ -@Deprecated -public abstract class GroovyGroupTestV3d0 { - - public static class Traversals extends GroupTestV3d0 { - - @Override - public Traversal>> get_g_V_group_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.groupV3d0.by('name')") - } - - @Override - public Traversal>> get_g_V_groupXaX_byXnameX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.groupV3d0('a').by('name').cap('a')") - } - - @Override - public Traversal>> get_g_V_hasXlangX_groupXaX_byXlangX_byXnameX_out_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('lang').groupV3d0('a').by('lang').by('name').out.cap('a')") - } - - @Override - public Traversal> get_g_V_hasXlangX_group_byXlangX_byX1X_byXcountXlocalXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.has('lang').groupV3d0.by('lang').by(__.inject(1)).by(__.count(Scope.local))") - } - - @Override - public Traversal> get_g_V_repeatXout_groupXaX_byXnameX_by_byXcountXlocalXX_timesX2X_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(__.out.groupV3d0('a').by('name').by.by(__.count(Scope.local))).times(2).cap('a')") - } - - @Override - public Traversal>> get_g_V_group_byXoutE_countX_byXnameX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.groupV3d0.by(__.outE.count).by('name')") - } - - @Override - public Traversal> get_g_V_repeatXbothXfollowedByXX_timesX2X_group_byXsongTypeX_byX1X_byXcountXlocalXX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(both('followedBy')).times(2).groupV3d0.by('songType').by(inject(1)).by(count(local))") - } - - @Override - public Traversal> get_g_V_repeatXbothXfollowedByXX_timesX2X_groupXaX_byXsongTypeX_byX1X_byXcountXlocalXX_capXaX() { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V.repeat(both('followedBy')).times(2).groupV3d0('a').by('songType').by(inject(1)).by(count(local)).cap('a')") - } - } -} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/aa828940/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyInjectTest.groovy ---------------------------------------------------------------------- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyInjectTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyInjectTest.groovy deleted file mode 100644 index fb8efb2..0000000 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/GroovyInjectTest.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.sideEffect - -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 GroovyInjectTest { - - public static class Traversals extends InjectTest { - @Override - public Traversal get_g_VX1X_out_injectXv2X_name(final Object v1Id, final Object v2Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out.inject(g.V(v2Id).next()).name", "v1Id", v1Id, "v2Id", v2Id); - } - - @Override - public Traversal get_g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path(final Object v1Id) { - new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out().name.inject('daniel').as('a').map { it.length() }.path", "v1Id", v1Id); - } - } -}