TINKERPOP-1784 Added feature tests for AddEdge Minor refactoring to test language around result counts
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dc973fff Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dc973fff Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dc973fff Branch: refs/heads/TINKERPOP-1784 Commit: dc973fff86bbc28a7e9d3a6736311fbd2d7db5ba Parents: a898322 Author: Stephen Mallette <sp...@genoprime.com> Authored: Wed Nov 1 15:36:23 2017 -0400 Committer: Stephen Mallette <sp...@genoprime.com> Committed: Fri Nov 10 19:55:21 2017 -0500 ---------------------------------------------------------------------- .../src/main/jython/radish/feature_steps.py | 7 +- gremlin-test/features/branch/Local.feature | 12 +- gremlin-test/features/branch/Repeat.feature | 2 +- gremlin-test/features/filter/Dedup.feature | 2 +- gremlin-test/features/filter/Range.feature | 14 +- gremlin-test/features/filter/Sample.feature | 6 +- gremlin-test/features/map/AddEdge.feature | 307 +++++++++++++++++++ gremlin-test/features/sideEffect/Group.feature | 4 +- 8 files changed, 331 insertions(+), 23 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-python/src/main/jython/radish/feature_steps.py ---------------------------------------------------------------------- diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py index b8b31ce..b7050e9 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -108,13 +108,14 @@ def assert_side_effects(step, count, traversal_string): if step.context.ignore: return - t = _make_traversal(step.context.g, traversal_string, {}) + t = _make_traversal(step.context.g, traversal_string.replace('\\"', '"'), + step.context.traversal_params if hasattr(step.context, "traversal_params") else {}) assert_that(count, equal_to(t.count().next())) -@then("should have a result count of {count:d}") +@then("the result should have a count of {count:d}") def assert_count(step, count): - assert_that(count, equal_to(len(step.context.result))) + assert_that(len(step.context.result), equal_to(count)) @then("nothing should happen because") http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/branch/Local.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/branch/Local.feature b/gremlin-test/features/branch/Local.feature index 4b33d62..fbc0dec 100644 --- a/gremlin-test/features/branch/Local.feature +++ b/gremlin-test/features/branch/Local.feature @@ -77,7 +77,7 @@ Feature: Step - local() | result | | vadas | | josh | - And should have a result count of 1 + And the result should have a count of 1 Scenario: g_V_localXbothEXcreatedX_limitX1XX_otherV_name Given the modern graph @@ -93,7 +93,7 @@ Feature: Step - local() | ripple | | josh | | peter | - And should have a result count of 5 + And the result should have a count of 5 Scenario: g_VX4X_localXbothEX1_createdX_limitX1XX Given the modern graph @@ -107,7 +107,7 @@ Feature: Step - local() | result | | e[josh-created->lop] | | e[josh-created->ripple] | - And should have a result count of 1 + And the result should have a count of 1 Scenario: g_VX4X_localXbothEXknows_createdX_limitX1XX Given the modern graph @@ -122,7 +122,7 @@ Feature: Step - local() | e[marko-knows->josh] | | e[josh-created->lop] | | e[josh-created->ripple] | - And should have a result count of 1 + And the result should have a count of 1 Scenario: g_VX4X_localXbothE_limitX1XX_otherV_name Given the modern graph @@ -137,7 +137,7 @@ Feature: Step - local() | marko | | ripple | | lop | - And should have a result count of 1 + And the result should have a count of 1 Scenario: g_VX4X_localXbothE_limitX2XX_otherV_name Given the modern graph @@ -152,7 +152,7 @@ Feature: Step - local() | marko | | ripple | | lop | - And should have a result count of 2 + And the result should have a count of 2 Scenario: g_V_localXinEXknowsX_limitX2XX_outV_name Given the modern graph http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/branch/Repeat.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/branch/Repeat.feature b/gremlin-test/features/branch/Repeat.feature index 082a3c6..1a76452 100644 --- a/gremlin-test/features/branch/Repeat.feature +++ b/gremlin-test/features/branch/Repeat.feature @@ -72,7 +72,7 @@ Feature: Step - repeat() | v[lop] | | v[josh] | | v[vadas] | - And should have a result count of 8 + And the result should have a count of 8 Scenario: g_VX1X_timesX2X_repeatXoutX_name Given the modern graph http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/filter/Dedup.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/filter/Dedup.feature b/gremlin-test/features/filter/Dedup.feature index a19a0bf..805497f 100644 --- a/gremlin-test/features/filter/Dedup.feature +++ b/gremlin-test/features/filter/Dedup.feature @@ -129,7 +129,7 @@ Feature: Step - dedup() g.V().both().both().dedup().by(T.label) """ When iterated to list - Then should have a result count of 2 + Then the result should have a count of 2 Scenario: g_V_group_byXlabelX_byXbothE_weight_dedup_foldX Given the modern graph http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/filter/Range.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/filter/Range.feature b/gremlin-test/features/filter/Range.feature index da02849..42e2f9a 100644 --- a/gremlin-test/features/filter/Range.feature +++ b/gremlin-test/features/filter/Range.feature @@ -30,7 +30,7 @@ Feature: Step - range() | v[josh] | | v[vadas] | | v[lop] | - And should have a result count of 2 + And the result should have a count of 2 Scenario: g_V_localXoutE_limitX1X_inVX_limitX3X Given the modern graph @@ -45,7 +45,7 @@ Feature: Step - range() | v[vadas] | | v[lop] | | v[ripple] | - And should have a result count of 3 + And the result should have a count of 3 Scenario: g_VX1X_outXknowsX_outEXcreatedX_rangeX0_1X_inV Given the modern graph @@ -59,7 +59,7 @@ Feature: Step - range() | result | | v[lop] | | v[ripple] | - And should have a result count of 1 + And the result should have a count of 1 Scenario: g_VX1X_outXknowsX_outXcreatedX_rangeX0_1X Given the modern graph @@ -73,7 +73,7 @@ Feature: Step - range() | result | | v[lop] | | v[ripple] | - And should have a result count of 1 + And the result should have a count of 1 Scenario: g_VX1X_outXcreatedX_inXcreatedX_rangeX1_3X Given the modern graph @@ -88,7 +88,7 @@ Feature: Step - range() | v[marko] | | v[josh] | | v[peter] | - And should have a result count of 2 + And the result should have a count of 2 Scenario: get_g_VX1X_outXcreatedX_inEXcreatedX_rangeX1_3X_outV Given the modern graph @@ -103,7 +103,7 @@ Feature: Step - range() | v[marko] | | v[josh] | | v[peter] | - And should have a result count of 2 + And the result should have a count of 2 Scenario: get_g_V_repeatXbothX_timesX3X_rangeX5_11X Given the modern graph @@ -120,7 +120,7 @@ Feature: Step - range() | v[lop] | | v[vadas] | | v[ripple] | - And should have a result count of 6 + And the result should have a count of 6 Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_limitXlocal_2X Given the modern graph http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/filter/Sample.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/filter/Sample.feature b/gremlin-test/features/filter/Sample.feature index 0f30527..ab3a9ae 100644 --- a/gremlin-test/features/filter/Sample.feature +++ b/gremlin-test/features/filter/Sample.feature @@ -24,7 +24,7 @@ Feature: Step - sample() g.E().sample(1) """ When iterated to list - Then should have a result count of 1 + Then the result should have a count of 1 Scenario: g_E_sampleX2X_byXweightX Given the modern graph @@ -34,7 +34,7 @@ Feature: Step - sample() g.E().sample(2).by("weight") """ When iterated to list - Then should have a result count of 2 + Then the result should have a count of 2 Scenario: g_V_localXoutE_sampleX1X_byXweightXX Given the modern graph @@ -43,7 +43,7 @@ Feature: Step - sample() g.V().local(__.outE().sample(1).by("weight")) """ When iterated to list - Then should have a result count of 3 + Then the result should have a count of 3 Scenario: g_V_group_byXlabelX_byXbothE_weight_sampleX2X_foldX Given the modern graph http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/map/AddEdge.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/AddEdge.feature b/gremlin-test/features/map/AddEdge.feature new file mode 100644 index 0000000..f3a55bb --- /dev/null +++ b/gremlin-test/features/map/AddEdge.feature @@ -0,0 +1,307 @@ +# 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 - addE() + + Scenario: g_VX1X_asXaX_outXcreatedX_addOutEXcreatedBy_aX + Given an unsupported test + Then nothing should happen because + """ + This test is deprecated. + """ + + Scenario: g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX + Given the empty graph + And the graph initializer of + """ + g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko"). + addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas"). + addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop"). + addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh"). + addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple"). + addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter'). + addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5). + addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0). + addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4). + addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0). + addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4). + addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2) + """ + And using the parameter v1Id defined as "v[marko].id" + And the traversal of + """ + g.V(v1Id).as("a").out("created").addE("createdBy").to("a") + """ + When iterated to list + Then the result should have a count of 1 + And the graph should return 7 for count of "g.E()" + And the graph should return 1 for count of "g.V(v1Id).inE()" + + Scenario: g_VX1X_asXaX_outXcreatedX_addOutEXcreatedBy_a_weight_2X + Given an unsupported test + Then nothing should happen because + """ + This test is deprecated. + """ + + Scenario: g_VX1X_asXaX_outXcreatedX_addEXcreatedByX_toXaX_propertyXweight_2X + Given the empty graph + And the graph initializer of + """ + g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko"). + addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas"). + addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop"). + addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh"). + addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple"). + addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter'). + addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5). + addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0). + addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4). + addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0). + addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4). + addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2) + """ + And using the parameter v1Id defined as "v[marko].id" + And the traversal of + """ + g.V(v1Id).as("a").out("created").addE("createdBy").to("a").property("weight", 2.0) + """ + When iterated to list + Then the result should have a count of 1 + And the graph should return 7 for count of "g.E()" + And the graph should return 4 for count of "g.V(v1Id).bothE()" + And the graph should return 1 for count of "g.V(v1Id).inE().has(\"weight\", 2.0)" + + Scenario: g_withSideEffectXx__g_V_toListX_addOutEXexistsWith_x_time_nowX + Given an unsupported test + Then nothing should happen because + """ + This test is marked as @Ignored in the test suite. + """ + + Scenario: g_V_aggregateXxX_asXaX_selectXxX_unfold_addEXexistsWithX_toXaX_propertyXtime_nowX + Given the empty graph + And the graph initializer of + """ + g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko"). + addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas"). + addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop"). + addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh"). + addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple"). + addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter'). + addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5). + addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0). + addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4). + addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0). + addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4). + addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2) + """ + And using the parameter v1Id defined as "v[marko].id" + And using the parameter v2Id defined as "v[vadas].id" + And using the parameter v3Id defined as "v[lop].id" + And using the parameter v4Id defined as "v[josh].id" + And using the parameter v5Id defined as "v[ripple].id" + And using the parameter v6Id defined as "v[peter].id" + And the traversal of + """ + g.V().aggregate("x").as("a").select("x").unfold().addE("existsWith").to("a").property("time", "now") + """ + When iterated to list + Then the result should have a count of 36 + And the graph should return 42 for count of "g.E()" + And the graph should return 15 for count of "g.V(v1Id).bothE()" + And the graph should return 6 for count of "g.V(v1Id).inE(\"existsWith\")" + And the graph should return 6 for count of "g.V(v1Id).outE(\"existsWith\")" + And the graph should return 12 for count of "g.V(v1Id).bothE(\"existsWith\").has(\"time\",\"now\")" + And the graph should return 13 for count of "g.V(v2Id).bothE()" + And the graph should return 6 for count of "g.V(v2Id).inE(\"existsWith\")" + And the graph should return 6 for count of "g.V(v2Id).outE(\"existsWith\")" + And the graph should return 12 for count of "g.V(v2Id).bothE(\"existsWith\").has(\"time\",\"now\")" + And the graph should return 15 for count of "g.V(v3Id).bothE()" + And the graph should return 6 for count of "g.V(v3Id).inE(\"existsWith\")" + And the graph should return 6 for count of "g.V(v3Id).outE(\"existsWith\")" + And the graph should return 12 for count of "g.V(v3Id).bothE(\"existsWith\").has(\"time\",\"now\")" + And the graph should return 15 for count of "g.V(v4Id).bothE()" + And the graph should return 6 for count of "g.V(v4Id).inE(\"existsWith\")" + And the graph should return 6 for count of "g.V(v4Id).outE(\"existsWith\")" + And the graph should return 12 for count of "g.V(v4Id).bothE(\"existsWith\").has(\"time\",\"now\")" + And the graph should return 13 for count of "g.V(v5Id).bothE()" + And the graph should return 6 for count of "g.V(v5Id).inE(\"existsWith\")" + And the graph should return 6 for count of "g.V(v5Id).outE(\"existsWith\")" + And the graph should return 12 for count of "g.V(v5Id).bothE(\"existsWith\").has(\"time\",\"now\")" + And the graph should return 13 for count of "g.V(v6Id).bothE()" + And the graph should return 6 for count of "g.V(v6Id).inE(\"existsWith\")" + And the graph should return 6 for count of "g.V(v6Id).outE(\"existsWith\")" + And the graph should return 12 for count of "g.V(v6Id).bothE(\"existsWith\").has(\"time\",\"now\")" + + Scenario: g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_selectXa_bX_addInEXa_codeveloper_b_year_2009X + Given an unsupported test + Then nothing should happen because + """ + This test is deprecated. + """ + + Scenario: g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_addEXcodeveloperX_fromXaX_toXbX_propertyXyear_2009X + Given the empty graph + And the graph initializer of + """ + g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko"). + addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas"). + addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop"). + addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh"). + addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple"). + addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter'). + addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5). + addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0). + addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4). + addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0). + addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4). + addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2) + """ + And using the parameter v1Id defined as "v[marko].id" + And using the parameter v2Id defined as "v[vadas].id" + And using the parameter v4Id defined as "v[josh].id" + And using the parameter v6Id defined as "v[peter].id" + And the traversal of + """ + g.V().as("a").out("created").in("created").where(P.neq("a")).as("b").addE("codeveloper").from("a").to("b").property("year", 2009) + """ + When iterated to list + Then the result should have a count of 6 + And the graph should return 12 for count of "g.E()" + And the graph should return 7 for count of "g.V(v1Id).bothE()" + And the graph should return 2 for count of "g.V(v1Id).inE(\"codeveloper\")" + And the graph should return 2 for count of "g.V(v1Id).outE(\"codeveloper\")" + And the graph should return 4 for count of "g.V(v1Id).bothE(\"codeveloper\").has(\"year\",2009)" + And the graph should return 1 for count of "g.V(v2Id).bothE()" + And the graph should return 7 for count of "g.V(v4Id).bothE()" + And the graph should return 2 for count of "g.V(v4Id).inE(\"codeveloper\")" + And the graph should return 2 for count of "g.V(v4Id).outE(\"codeveloper\")" + And the graph should return 4 for count of "g.V(v4Id).bothE(\"codeveloper\").has(\"year\",2009)" + And the graph should return 5 for count of "g.V(v6Id).bothE()" + And the graph should return 2 for count of "g.V(v6Id).inE(\"codeveloper\")" + And the graph should return 2 for count of "g.V(v6Id).outE(\"codeveloper\")" + And the graph should return 4 for count of "g.V(v6Id).bothE(\"codeveloper\").has(\"year\",2009)" + + Scenario: g_V_asXaX_inXcreatedX_addEXcreatedByX_fromXaX_propertyXyear_2009X_propertyXacl_publicX + Given the empty graph + And the graph initializer of + """ + g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko"). + addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas"). + addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop"). + addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh"). + addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple"). + addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter'). + addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5). + addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0). + addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4). + addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0). + addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4). + addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2) + """ + And using the parameter v1Id defined as "v[marko].id" + And using the parameter v2Id defined as "v[vadas].id" + And using the parameter v3Id defined as "v[lop].id" + And using the parameter v4Id defined as "v[josh].id" + And using the parameter v5Id defined as "v[ripple].id" + And using the parameter v6Id defined as "v[peter].id" + And the traversal of + """ + g.V().as("a").in("created").addE("createdBy").from("a").property("year", 2009).property("acl", "public") + """ + When iterated to list + Then the result should have a count of 4 + And the graph should return 10 for count of "g.E()" + And the graph should return 4 for count of "g.V(v1Id).bothE()" + And the graph should return 1 for count of "g.V(v1Id).inE(\"createdBy\")" + And the graph should return 0 for count of "g.V(v1Id).outE(\"createdBy\")" + And the graph should return 1 for count of "g.V(v1Id).bothE(\"createdBy\").has(\"year\",2009).has(\"acl\", \"public\")" + And the graph should return 1 for count of "g.V(v2Id).bothE()" + And the graph should return 6 for count of "g.V(v3Id).bothE()" + And the graph should return 0 for count of "g.V(v3Id).inE(\"createdBy\")" + And the graph should return 3 for count of "g.V(v3Id).outE(\"createdBy\")" + And the graph should return 3 for count of "g.V(v3Id).bothE(\"createdBy\").has(\"year\",2009).has(\"acl\", \"public\")" + And the graph should return 5 for count of "g.V(v4Id).bothE()" + And the graph should return 2 for count of "g.V(v4Id).inE(\"createdBy\")" + And the graph should return 0 for count of "g.V(v4Id).outE(\"createdBy\")" + And the graph should return 2 for count of "g.V(v4Id).bothE(\"createdBy\").has(\"year\",2009).has(\"acl\", \"public\")" + And the graph should return 2 for count of "g.V(v5Id).bothE()" + And the graph should return 0 for count of "g.V(v5Id).inE(\"createdBy\")" + And the graph should return 1 for count of "g.V(v5Id).outE(\"createdBy\")" + And the graph should return 1 for count of "g.V(v5Id).bothE(\"createdBy\").has(\"year\",2009).has(\"acl\", \"public\")" + And the graph should return 2 for count of "g.V(v6Id).bothE()" + And the graph should return 1 for count of "g.V(v6Id).inE(\"createdBy\")" + And the graph should return 0 for count of "g.V(v6Id).outE(\"createdBy\")" + And the graph should return 1 for count of "g.V(v6Id).bothE(\"createdBy\").has(\"year\",2009).has(\"acl\", \"public\")" + + Scenario: g_V_asXaX_inXcreatedX_addInEXcreatedBy_a_year_2009_acl_publicX + Given an unsupported test + Then nothing should happen because + """ + This test is deprecated. + """ + + Scenario: g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X + Given the empty graph + And the graph initializer of + """ + g.addV("person").property(T.id, 1).property("name", "marko").property("age", 29).as("marko"). + addV("person").property(T.id, 2).property("name", "vadas").property("age", 27).as("vadas"). + addV("software").property(T.id, 3).property("name", "lop").property("lang", "java").as("lop"). + addV("person").property(T.id, 4).property("name","josh").property("age", 32).as("josh"). + addV("software").property(T.id, 5).property("name", "ripple").property("lang", "java").as("ripple"). + addV("person").property(T.id, 6).property("name", "peter").property("age", 35).as('peter'). + addE("knows").from("marko").to("vadas").property(T.id, 7).property("weight", 0.5). + addE("knows").from("marko").to("josh").property(T.id, 8).property("weight", 1.0). + addE("created").from("marko").to("lop").property(T.id, 9).property("weight", 0.4). + addE("created").from("josh").to("ripple").property(T.id, 10).property("weight", 1.0). + addE("created").from("josh").to("lop").property(T.id, 11).property("weight", 0.4). + addE("created").from("peter").to("lop").property(T.id, 12).property("weight", 0.2) + """ + And using the parameter v1 defined as "v[marko]" + And using the parameter v6 defined as "v[peter]" + And the traversal of + """ + g.withSideEffect("b", v6).V(v1).addE("knows").to("b").property("weight", 0.5) + """ + When iterated to list + Then the result should have a count of 1 + And the graph should return 7 for count of "g.E()" + And the graph should return 4 for count of "g.V(v1).bothE()" + And the graph should return 0 for count of "g.V(v1).inE(\"knows\")" + And the graph should return 3 for count of "g.V(v1).outE(\"knows\")" + And the graph should return 2 for count of "g.V(v1).bothE(\"knows\").has(\"weight\",0.5)" + And the graph should return 2 for count of "g.V(v6).bothE()" + And the graph should return 1 for count of "g.V(v6).inE(\"knows\")" + And the graph should return 0 for count of "g.V(v6).outE(\"knows\")" + And the graph should return 1 for count of "g.V(v6).bothE(\"knows\").has(\"weight\",0.5)" + + Scenario: g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX + Given the empty graph + And the traversal of + """ + g.addV().as("first").repeat(__.addE("next").to(__.addV()).inV()).times(5).addE("next").to(__.select("first")) + """ + When iterated to list + Then the result should have a count of 1 + And the graph should return 6 for count of "g.V()" + And the graph should return 6 for count of "g.E()" + And the graph should return 6 for count of "g.E().hasLabel(\"next\")" + And the graph should return 2 for count of "g.V().limit(1).bothE()" + And the graph should return 1 for count of "g.V().limit(1).inE()" + And the graph should return 1 for count of "g.V().limit(1).outE()" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dc973fff/gremlin-test/features/sideEffect/Group.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/sideEffect/Group.feature b/gremlin-test/features/sideEffect/Group.feature index 9ba57ec..ac89e7d 100644 --- a/gremlin-test/features/sideEffect/Group.feature +++ b/gremlin-test/features/sideEffect/Group.feature @@ -169,7 +169,7 @@ Feature: Step - group() g.V().hasLabel("song").group().by("name").by(__.properties().groupCount().by(T.label)) """ When iterated next - Then should have a result count of 584 + Then the result should have a count of 584 Scenario: g_V_hasLabelXsongX_groupXaX_byXnameX_byXproperties_groupCount_byXlabelXX_out_capXaX Given the grateful graph @@ -178,7 +178,7 @@ Feature: Step - group() g.V().hasLabel("song").group("a").by("name").by(__.properties().groupCount().by(T.label)).out().cap("a") """ When iterated next - Then should have a result count of 584 + Then the result should have a count of 584 Scenario: g_V_repeatXunionXoutXknowsX_groupXaX_byXageX__outXcreatedX_groupXbX_byXnameX_byXcountXX_groupXaX_byXnameXX_timesX2X_capXa_bX Given an unsupported test