TINKERPOP-1784 Define traversals without shorthand Sorta made the decision to be explicit in how traversals are defined in .feature files. Shying away from using shorthand static imports which will make it more explicit for those trying to implement the tests.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a1a07134 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a1a07134 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a1a07134 Branch: refs/heads/TINKERPOP-1784 Commit: a1a07134f57e5bb165157907352de468b04c6bf2 Parents: bd5e028 Author: Stephen Mallette <[email protected]> Authored: Tue Oct 10 15:18:55 2017 -0400 Committer: Stephen Mallette <[email protected]> Committed: Mon Oct 16 11:19:31 2017 -0400 ---------------------------------------------------------------------- gremlin-python/src/main/jython/radish/feature_steps.py | 13 +++---------- gremlin-test/features/branch/Branch.feature | 6 +++--- gremlin-test/features/map/Count.feature | 8 ++++---- gremlin-test/features/map/Select.feature | 2 +- gremlin-test/features/sideEffect/GroupCount.feature | 8 ++++---- 5 files changed, 15 insertions(+), 22 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1a07134/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 0d52d75..3c25258 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -58,17 +58,10 @@ def translate_traversal(step): "Column": Column, "Direction": Direction, "Order": Order, - "P": P, "gt": P.gt, - "Pick": Pick, "any": Pick.any, + "P": P, + "Pick": Pick, "Scope": Scope, - "T": T, - "as_": __.as_, - "bothE": __.bothE, - "in_": __.in_, - "label": __.label, - "out": __.out, - "repeat": __.repeat, - "values": __.values} + "T": T} if hasattr(step.context, "traversal_params"): b.update(step.context.traversal_params) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1a07134/gremlin-test/features/branch/Branch.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/branch/Branch.feature b/gremlin-test/features/branch/Branch.feature index d12fc0f..93562c8 100644 --- a/gremlin-test/features/branch/Branch.feature +++ b/gremlin-test/features/branch/Branch.feature @@ -22,7 +22,7 @@ Feature: Step - branch() And using the parameter l1 is "c[it.get().label() == 'person' ? 'a' : 'b']" And the traversal of """ - g.V().branch(l1).option("a", values("age")).option("b", values("lang")).option("b", values("name")) + g.V().branch(l1).option("a", __.values("age")).option("b", __.values("lang")).option("b", __.values("name")) """ When iterated to list Then the result should be unordered @@ -39,7 +39,7 @@ Feature: Step - branch() Given the modern graph And the traversal of """ - g.V().branch(label().is("person").count()).option(1L, values("age")).option(0L, values("lang")).option(0L, values("name")) + g.V().branch(__.label().is("person").count()).option(1L, __.values("age")).option(0L, __.values("lang")).option(0L, __.values("name")) """ When iterated to list Then the result should be unordered @@ -56,7 +56,7 @@ Feature: Step - branch() Given the modern graph And the traversal of """ - g.V().branch(label().is("person").count()).option(1L, values("age")).option(0L, values("lang")).option(0L, values("name")).option(any, label()) + g.V().branch(__.label().is("person").count()).option(1L, __.values("age")).option(0L, __.values("lang")).option(0L, __.values("name")).option(Pick.any, __.label()) """ When iterated to list Then the result should be unordered http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1a07134/gremlin-test/features/map/Count.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/Count.feature b/gremlin-test/features/map/Count.feature index 5faa975..6053605 100644 --- a/gremlin-test/features/map/Count.feature +++ b/gremlin-test/features/map/Count.feature @@ -71,7 +71,7 @@ Feature: Step - count() Given the modern graph And the traversal of """ - g.V().where(in("knows").out("created").count().is(0)).values("name") + g.V().where(__.in("knows").out("created").count().is(0)).values("name") """ When iterated to list Then the result should be unordered @@ -84,7 +84,7 @@ Feature: Step - count() Given the grateful graph And the traversal of """ - g.V().repeat(out()).times(8).count() + g.V().repeat(__.out()).times(8).count() """ When iterated to list Then the result should be ordered @@ -94,7 +94,7 @@ Feature: Step - count() Given the grateful graph And the traversal of """ - g.V().repeat(out()).times(5).as("a").out("writtenBy").as("b").select("a", "b").count() + g.V().repeat(__.out()).times(5).as("a").out("writtenBy").as("b").select("a", "b").count() """ When iterated to list Then the result should be ordered @@ -104,7 +104,7 @@ Feature: Step - count() Given the grateful graph And the traversal of """ - g.V().repeat(out()).times(3).count() + g.V().repeat(__.out()).times(3).count() """ When iterated to list Then the result should be ordered http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1a07134/gremlin-test/features/map/Select.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature index 9df72a8..f29a436 100644 --- a/gremlin-test/features/map/Select.feature +++ b/gremlin-test/features/map/Select.feature @@ -260,7 +260,7 @@ Feature: Step - select() Given the modern graph And the traversal of """ - 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") + 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") """ When iterated to list Then the result should be unordered http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a1a07134/gremlin-test/features/sideEffect/GroupCount.feature ---------------------------------------------------------------------- diff --git a/gremlin-test/features/sideEffect/GroupCount.feature b/gremlin-test/features/sideEffect/GroupCount.feature index b767001..28eb675 100644 --- a/gremlin-test/features/sideEffect/GroupCount.feature +++ b/gremlin-test/features/sideEffect/GroupCount.feature @@ -61,7 +61,7 @@ Feature: Step - groupCount() Given the modern graph And the traversal of """ - g.V().repeat(out().groupCount("a").by("name")).times(2).cap("a") + g.V().repeat(__.out().groupCount("a").by("name")).times(2).cap("a") """ When iterated to list Then the result should be ordered @@ -71,7 +71,7 @@ Feature: Step - groupCount() Given the modern graph And the traversal of """ - g.V().both().groupCount("a").by(T.label).as("b").barrier().where(__.select("a").select("software").is(gt(2))).select("b").values("name") + g.V().both().groupCount("a").by(T.label).as("b").barrier().where(__.select("a").select("software").is(P.gt(2))).select("b").values("name") """ When iterated to list Then the result should be unordered @@ -92,7 +92,7 @@ Feature: Step - groupCount() Given the modern graph And the traversal of """ - g.V().union(out("knows"), out("created").in("created")).groupCount().select(Column.values).unfold().sum() + g.V().union(__.out("knows"), __.out("created").in("created")).groupCount().select(Column.values).unfold().sum() """ When iterated to list Then the result should be ordered @@ -122,7 +122,7 @@ Feature: Step - groupCount() Given the modern graph And the traversal of """ - g.V().union(repeat(out()).times(2).groupCount("m").by("lang"),repeat(in()).times(2).groupCount("m").by("name")).cap("m") + g.V().union(__.repeat(__.out()).times(2).groupCount("m").by("lang"),__.repeat(__.in()).times(2).groupCount("m").by("name")).cap("m") """ When iterated to list Then the result should be ordered
