Repository: tinkerpop Updated Branches: refs/heads/master 1c49c274f -> ab566c951
Big fixup of brokeness on master Lots of missing gherkin tests. Not sure how those were missing. Perhaps certain PRs were rebased or perhaps I'd needed to rebase when i merged the master PR that had the full GLV suite in place. Anyway, should all pass now. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ab566c95 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ab566c95 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ab566c95 Branch: refs/heads/master Commit: ab566c951c12d204cb7950f9683afdbceda39372 Parents: 1c49c27 Author: Stephen Mallette <[email protected]> Authored: Thu Feb 22 17:23:33 2018 -0500 Committer: Stephen Mallette <[email protected]> Committed: Thu Feb 22 17:23:33 2018 -0500 ---------------------------------------------------------------------- gremlin-test/features/branch/Optional.feature | 28 +++++ gremlin-test/features/filter/Range.feature | 96 +++++++++++++++- gremlin-test/features/filter/Tail.feature | 47 +++++++- gremlin-test/features/map/AddEdge.feature | 122 ++++++++++++++++++++- gremlin-test/features/map/AddVertex.feature | 52 +++++++++ gremlin-test/features/map/Properties.feature | 9 +- gremlin-test/features/map/ValueMap.feature | 15 ++- 7 files changed, 364 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/branch/Optional.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/branch/Optional.feature b/gremlin-test/features/branch/Optional.feature index 5d2be8d..b69fe13 100644 --- a/gremlin-test/features/branch/Optional.feature +++ b/gremlin-test/features/branch/Optional.feature @@ -79,3 +79,31 @@ Feature: Step - choose() | p[v[josh],v[lop]] | | p[v[ripple]] | | p[v[peter],v[lop]] | + + Scenario: g_VX1X_optionalXaddVXdogXX_label + 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).optional(__.addV("dog")).label() + """ + When iterated to list + Then the result should be unordered + | result | + | dog | + And the graph should return 7 for count of "g.V()" http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/filter/Range.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/filter/Range.feature b/gremlin-test/features/filter/Range.feature index 907e421..fd3c63f 100644 --- a/gremlin-test/features/filter/Range.feature +++ b/gremlin-test/features/filter/Range.feature @@ -168,4 +168,98 @@ Feature: Step - range() Then the result should be unordered | result | | m[{"b":"josh"}] | - | m[{"b":"josh"}] | \ No newline at end of file + | m[{"b":"josh"}] | + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_3X + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).range(Scope.local, 1, 3) + """ + When iterated to list + Then the result should be unordered + | result | + | l[josh,ripple] | + | l[josh,lop] | + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_1_2X + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).range(Scope.local, 1, 2) + """ + When iterated to list + Then the result should be unordered + | result | + | josh | + | josh | + + Scenario: g_V_hasLabelXpersonX_order_byXageX_skipX1X_valuesXnameX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").order().by("age").skip(1).values("name") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | josh | + | peter | + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_rangeXlocal_4_5X + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).range(Scope.local, 4, 5) + """ + When iterated to list + Then the result should be empty + + Scenario: g_V_outE_valuesXweightX_fold_orderXlocalX_skipXlocal_2X + Given the modern graph + And the traversal of + """ + g.V().outE().values("weight").fold().order(Scope.local).skip(Scope.local, 2) + """ + When iterated to list + Then the result should be unordered + | result | + | l[d[0.4].d,d[0.5].d,d[1.0].d,d[1.0].d] | + + Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_1X + Given the modern graph + And the traversal of + """ + g.V().as("a").in().as("a").in().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).limit(Scope.local, 1) + """ + When iterated to list + Then the result should be unordered + | result | + | lop | + | ripple | + + Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_limitXlocal_2X + Given the modern graph + And the traversal of + """ + g.V().as("a").in().as("a").in().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).limit(Scope.local, 2) + """ + When iterated to list + Then the result should be unordered + | result | + | l[lop,josh] | + | l[ripple,josh] | + + Scenario: g_V_hasLabelXpersonX_order_byXageX_valuesXnameX_skipX1X + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").order().by("age").values("name").skip(1) + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | josh | + | peter | \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/filter/Tail.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/filter/Tail.feature b/gremlin-test/features/filter/Tail.feature index ef0643e..2db579c 100644 --- a/gremlin-test/features/filter/Tail.feature +++ b/gremlin-test/features/filter/Tail.feature @@ -142,4 +142,49 @@ Feature: Step - tail() Then the result should be unordered | result | | m[{"c":"ripple"}] | - | m[{"c":"lop"}] | \ No newline at end of file + | m[{"c":"lop"}] | + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_tailXlocal_1X + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).tail(Scope.local, 1) + """ + When iterated to list + Then the result should be unordered + | result | + | ripple | + | lop | + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_tailXlocalX + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).tail(Scope.local) + """ + When iterated to list + Then the result should be unordered + | result | + | ripple | + | lop | + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXlimitXlocal_0XX_tailXlocal_1X + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.limit(Scope.local, 0)).tail(Scope.local, 1) + """ + When iterated to list + Then the result should be empty + + Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXmixed_aX_byXunfold_valuesXnameX_foldX_tailXlocal_2X + Given the modern graph + And the traversal of + """ + g.V().as("a").out().as("a").out().as("a").select(Pop.mixed, "a").by(__.unfold().values("name").fold()).tail(Scope.local, 2) + """ + When iterated to list + Then the result should be unordered + | result | + | l[josh,ripple] | + | l[josh,lop] | \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/map/AddEdge.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/AddEdge.feature b/gremlin-test/features/map/AddEdge.feature index f3a55bb..69c24c2 100644 --- a/gremlin-test/features/map/AddEdge.feature +++ b/gremlin-test/features/map/AddEdge.feature @@ -304,4 +304,124 @@ Feature: Step - addE() 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 + And the graph should return 1 for count of "g.V().limit(1).outE()" + + Scenario: g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_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 v1 defined as "v[marko]" + And the traversal of + """ + g.V().has("name", "marko").as("a").outE("created").as("b").inV().addE(__.select("b").label()).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 4 for count of "g.V(v1).bothE()" + And the graph should return 1 for count of "g.V(v1).inE(\"created\")" + And the graph should return 1 for count of "g.V(v1).in(\"created\").has(\"name\",\"lop\")" + And the graph should return 1 for count of "g.V(v1).outE(\"created\")" + + Scenario: g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_decrX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX + 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 v2 defined as "v[vadas]" + And the traversal of + """ + g.addE(__.V().outE().label().groupCount().order(Scope.local).by(Column.values, Order.decr).select(Column.keys).unfold().limit(1)).from(__.V().has("name", "vadas")).to(__.V().has("name", "lop")) + """ + 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 2 for count of "g.V(v2).bothE()" + And the graph should return 1 for count of "g.V(v2).inE(\"knows\")" + And the graph should return 1 for count of "g.V(v2).outE(\"created\")" + And the graph should return 1 for count of "g.V(v2).out(\"created\").has(\"name\",\"lop\")" + + Scenario: g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X + 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 using the parameter dotOne defined as "d[0.1].d" + And the traversal of + """ + g.addE("knows").from(v1).to(v6).property("weight", dotOne) + """ + 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 3 for count of "g.V(v1).outE(\"knows\")" + And the graph should return 1 for count of "g.V(v1).out(\"knows\").has(\"name\",\"peter\")" + + Scenario: g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X + 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 using the parameter dotOne defined as "d[0.1].d" + And the traversal of + """ + g.V(v1).addE("knows").to(v6).property("weight", dotOne) + """ + 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 3 for count of "g.V(v1).outE(\"knows\")" + And the graph should return 1 for count of "g.V(v1).out(\"knows\").has(\"name\",\"peter\")" \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/map/AddVertex.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/AddVertex.feature b/gremlin-test/features/map/AddVertex.feature index 2813733..e58040c 100644 --- a/gremlin-test/features/map/AddVertex.feature +++ b/gremlin-test/features/map/AddVertex.feature @@ -308,3 +308,55 @@ Feature: Step - addV() | result | | m[{"temp": ["test"], "name": ["lop"]}] | | m[{"temp": ["test"], "name": ["ripple"]}] | + + Scenario: g_V_asXaX_hasXname_markoX_outXcreatedX_asXbX_addVXselectXaX_labelX_propertyXtest_selectXbX_labelX_valueMapXtrueX + 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 the traversal of + """ + g.V().as("a").has("name", "marko").out("created").as("b").addV(__.select("a").label()).property("test", __.select("b").label()).valueMap(true) + """ + When iterated to list + Then the result should have a count of 1 + And the graph should return 1 for count of "g.V().has(\"person\",\"test\",\"software\")" + + Scenario: g_addVXV_hasXname_markoX_propertiesXnameX_keyX_label + 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 the traversal of + """ + g.addV(__.V().has("name", "marko").properties("name").key()).label() + """ + When iterated to list + Then the result should be unordered + | result | + | name | + http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/map/Properties.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/Properties.feature b/gremlin-test/features/map/Properties.feature index 3c926fa..dafb13e 100644 --- a/gremlin-test/features/map/Properties.feature +++ b/gremlin-test/features/map/Properties.feature @@ -51,4 +51,11 @@ Feature: Step - properties() | josh | | d[32].i | | peter | - | d[35].i | \ No newline at end of file + | d[35].i | + + Scenario: g_injectXg_VX1X_propertiesXnameX_nextX_value + Given an unsupported test + Then nothing should happen because + """ + The test suite doesn't do well with vertex property values. + """ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ab566c95/gremlin-test/features/map/ValueMap.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/ValueMap.feature b/gremlin-test/features/map/ValueMap.feature index c851e53..109318f 100644 --- a/gremlin-test/features/map/ValueMap.feature +++ b/gremlin-test/features/map/ValueMap.feature @@ -91,4 +91,17 @@ Feature: Step - valueMap() When iterated to list Then the result should be unordered | result | - | m[{"name": ["lop"], "lang": ["java"]}] | \ No newline at end of file + | m[{"name": ["lop"], "lang": ["java"]}] | + + Scenario: g_V_hasLabelXpersonX_filterXoutEXcreatedXX_valueMapXtrueX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").filter(__.outE("created")).valueMap(true) + """ + When iterated to list + Then the result should be unordered + | result | + | m[{"name": ["marko"], "age": [29], "t[label]":"person", "t[id]":"v[marko].id"}] | + | m[{"name": ["josh"], "age": [32], "t[label]":"person", "t[id]":"v[josh].id"}] | + | m[{"name": ["peter"], "age": [35], "t[label]":"person", "t[id]":"v[peter].id"}] | \ No newline at end of file
