TINKERPOP-1784 Added feature tests for loop() and map()
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8f0b8f7a Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8f0b8f7a Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8f0b8f7a Branch: refs/heads/tp32 Commit: 8f0b8f7a7c4455f92cd1384720262f068c8f8be6 Parents: 75d1e27 Author: Stephen Mallette <[email protected]> Authored: Thu Nov 2 11:59:10 2017 -0400 Committer: Stephen Mallette <[email protected]> Committed: Tue Nov 21 15:52:52 2017 -0500 ---------------------------------------------------------------------- gremlin-test/features/map/Loop.feature | 68 ++++++++++++++++++ gremlin-test/features/map/Map.feature | 108 ++++++++++++++++++++++++++++ 2 files changed, 176 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f0b8f7a/gremlin-test/features/map/Loop.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/Loop.feature b/gremlin-test/features/map/Loop.feature new file mode 100644 index 0000000..efd439f --- /dev/null +++ b/gremlin-test/features/map/Loop.feature @@ -0,0 +1,68 @@ +# 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. + +Feature: Step - loop() + + Scenario: g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_or_loops_isX3XX_hasXname_peterX_path_byXnameX + Given the modern graph + And using the parameter v1Id defined as "v[marko].id" + And the traversal of + """ + g.V(v1Id).repeat(__.both().simplePath()).until(__.has("name", "peter").or().loops().is(3)).has("name", "peter").path().by("name") + """ + When iterated to list + Then the result should be unordered + | result | + | p[marko,lop,peter] | + | p[marko,josh,lop,peter] | + + Scenario: g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_or_loops_isX2XX_hasXname_peterX_path_byXnameX + Given the modern graph + And using the parameter v1Id defined as "v[marko].id" + And the traversal of + """ + g.V(v1Id).repeat(__.both().simplePath()).until(__.has("name", "peter").or().loops().is(2)).has("name", "peter").path().by("name") + """ + When iterated to list + Then the result should be unordered + | result | + | p[marko,lop,peter] | + + Scenario: g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_and_loops_isX3XX_hasXname_peterX_path_byXnameX + Given the modern graph + And using the parameter v1Id defined as "v[marko].id" + And the traversal of + """ + g.V(v1Id).repeat(__.both().simplePath()).until(__.has("name", "peter").and().loops().is(3)).has("name", "peter").path().by("name") + """ + When iterated to list + Then the result should be unordered + | result | + | p[marko,josh,lop,peter] | + + Scenario: g_V_emitXhasXname_markoX_or_loops_isX2XX_repeatXoutX_valuesXnameX + Given the modern graph + And the traversal of + """ + g.V().emit(__.has("name", "marko").or().loops().is(2)).repeat(__.out()).values("name") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | ripple | + | lop | http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f0b8f7a/gremlin-test/features/map/Map.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/Map.feature b/gremlin-test/features/map/Map.feature new file mode 100644 index 0000000..573b404 --- /dev/null +++ b/gremlin-test/features/map/Map.feature @@ -0,0 +1,108 @@ +# 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. + +Feature: Step - map() + + Scenario: g_VX1X_mapXnameX + Given the modern graph + And using the parameter v1Id defined as "v[marko].id" + And using the parameter l defined as "c[it.get().value('name')]" + And the traversal of + """ + g.V(v1Id).map(l) + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + + Scenario: g_VX1X_outE_label_mapXlengthX + Given the modern graph + And using the parameter v1Id defined as "v[marko].id" + And using the parameter l defined as "c[it.get().length()]" + And the traversal of + """ + g.V(v1Id).outE().label().map(l) + """ + When iterated to list + Then the result should be unordered + | result | + | d[7] | + | d[5] | + | d[5] | + + Scenario: g_VX1X_out_mapXnameX_mapXlengthX + Given the modern graph + And using the parameter v1Id defined as "v[marko].id" + And using the parameter l1 defined as "c[it.get().value('name')]" + And using the parameter l2 defined as "c[it.get().toString().length()]" + And the traversal of + """ + g.V(v1Id).out().map(l1).map(l2) + """ + When iterated to list + Then the result should be unordered + | result | + | d[3] | + | d[5] | + | d[4] | + + Scenario: g_withPath_V_asXaX_out_mapXa_nameX + Given the modern graph + And using the parameter l defined as "c[it.path('a').value('name')]" + And the traversal of + """ + g.withPath().V().as("a").out().map(l) + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | marko | + | marko | + | josh | + | josh | + | peter | + + Scenario: g_withPath_V_asXaX_out_out_mapXa_name_it_nameX + Given the modern graph + And using the parameter l defined as "c[it.path('a').value('name') + it.get().value('name')]" + And the traversal of + """ + g.withPath().V().as("a").out().out().map(l) + """ + When iterated to list + Then the result should be unordered + | result | + | markoripple | + | markolop | + + Scenario: g_V_mapXselectXaXX + Given the modern graph + And the traversal of + """ + g.V().as("a").map(__.select("a")) + """ + When iterated to list + Then the result should be unordered + | result | + | v[marko] | + | v[vadas] | + | v[lop] | + | v[josh] | + | v[ripple] | + | v[peter] |
