You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/11/11 00:56:05 UTC

[01/50] tinkerpop git commit: TINKERPOP-1784 Added support for path() testing [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1784 d821d537d -> 4f17a8ab6 (forced update)


TINKERPOP-1784 Added support for path() testing


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/04d90466
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/04d90466
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/04d90466

Branch: refs/heads/TINKERPOP-1784
Commit: 04d90466ae0901e1ae794d3fff565889f4f71ded
Parents: 0558b87
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Oct 12 11:26:41 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:19 2017 -0500

----------------------------------------------------------------------
 gremlin-python/pom.xml                          |  2 +-
 .../src/main/jython/radish/feature_steps.py     | 29 ++++--
 gremlin-test/features/map/Path.feature          | 98 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    | 10 +-
 4 files changed, 130 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04d90466/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index d1a4a76..67cc35b 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -449,7 +449,7 @@ limitations under the License.
                                         <exec executable="env/bin/radish" dir="${project.build.directory}/python2"
                                               failonerror="true">
                                             <env key="PYTHONPATH" value=""/>
-                                            <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/"/> <!-- -no-line-jump -->
+                                            <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --no-line-jump"/> <!-- -no-line-jump -->
                                         </exec>                                                                  
                                     </target>
                                 </configuration>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04d90466/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 1876f5b..859d809 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -27,8 +27,11 @@ from hamcrest import *
 
 regex_and = re.compile(r"([(.,\s])and\(")
 regex_as = re.compile(r"([(.,\s])as\(")
+regex_from = re.compile(r"([(.,\s])from\(")
 regex_in = re.compile(r"([(.,\s])in\(")
 regex_is = re.compile(r"([(.,\s])is\(")
+regex_not = re.compile(r"([(.,\s])not\(")
+regex_or = re.compile(r"([(.,\s])or\(")
 
 
 @given("the {graph_name:w} graph")
@@ -67,13 +70,13 @@ def translate_traversal(step):
     if hasattr(step.context, "traversal_params"):
         b.update(step.context.traversal_params)
 
-    print _translate(step.text + " - " + str(b))
+    # print _translate(step.text + " - " + str(b))
     step.context.traversal = eval(_translate(step.text), b)
 
 
 @when("iterated to list")
 def iterate_the_traversal(step):
-    step.context.result = step.context.traversal.toList()
+    step.context.result = map(lambda x: _convert_results(x), step.context.traversal.toList())
 
 
 @then("the result should be {characterized_as:w}")
@@ -99,7 +102,7 @@ def _convert(val, ctx):
         for key, value in val.items():
             n[_convert(key, ctx)] = _convert(value, ctx)
         return n
-    elif isinstance(val, unicode):                                    # stupid unicode/string nonsense in py 2/x
+    elif isinstance(val, unicode):                                    # convert annoying python 2.x unicode nonsense
         return _convert(val.encode('utf-8'), ctx)
     elif isinstance(val, str) and re.match("^l\[.*\]$", val):         # parse list
         return list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
@@ -121,14 +124,21 @@ def _convert(val, ctx):
         return _convert(json.loads(val[2:-1]), ctx)
     elif isinstance(val, str) and re.match("^p\[.*\]$", val):         # parse path
         path_objects = list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
-        labels = [set([]) for i in range(len(path_objects))]
-        return Path(labels, path_objects)
+        return Path([set([])], path_objects)
     elif isinstance(val, str) and re.match("^c\[.*\]$", val):         # parse lambda/closure
         return lambda: (val[2:-1], "gremlin-groovy")
     else:
         return val
 
 
+def _convert_results(val):
+    if isinstance(val, Path):
+        # kill out labels as they aren't in the assertion logic
+        return Path([set([])], map(lambda p: p.encode("utf-8") if isinstance(p, unicode) else p, val.objects))
+    else:
+        return val
+
+
 def _table_assertion(data, result, ctx, ordered):
     # results from traversal should have the same number of entries as the feature data table
     assert_that(len(result), equal_to(len(data)))
@@ -139,10 +149,14 @@ def _table_assertion(data, result, ctx, ordered):
     # from the list - in the end there should be no items left over and each will have been asserted
     for ix, line in enumerate(data):
         val = _convert(line[0], ctx)
+
+        # clear the labels since we don't define them in .feature files
+        if isinstance(val, Path):
+            val.labels = [set([])]
+
         if ordered:
             assert_that(results_to_test[ix], equal_to(val))
         else:
-            print str(type(val)) + "---------" + str(type(results_to_test[0]))
             assert_that(val, is_in(results_to_test))
         results_to_test.remove(val)
 
@@ -152,6 +166,9 @@ def _table_assertion(data, result, ctx, ordered):
 def _translate(traversal):
     replaced = traversal.replace("\n", "")
     replaced = regex_and.sub(r"\1and_(", replaced)
+    replaced = regex_from.sub(r"\1from_(", replaced)
     replaced = regex_as.sub(r"\1as_(", replaced)
     replaced = regex_is.sub(r"\1is_(", replaced)
+    replaced = regex_not.sub(r"\1not_(", replaced)
+    replaced = regex_or.sub(r"\1or_(", replaced)
     return regex_in.sub(r"\1in_(", replaced)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04d90466/gremlin-test/features/map/Path.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Path.feature b/gremlin-test/features/map/Path.feature
new file mode 100644
index 0000000..350e6c6
--- /dev/null
+++ b/gremlin-test/features/map/Path.feature
@@ -0,0 +1,98 @@
+# 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 - count()
+
+  Scenario: g_VX1X_name_path
+    Given the modern graph
+    And using the parameter v1Id is "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).values("name").path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],marko] |
+
+  Scenario: g_VX1X_out_path_byXageX_byXnameX
+    Given the modern graph
+    And using the parameter v1Id is "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out().path().by("age").by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[d[29],lop] |
+      | p[d[29],vadas] |
+      | p[d[29],josh] |
+
+  Scenario: g_V_repeatXoutX_timesX2X_path_by_byXnameX_byXlangX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.out()).times(2).path().by().by("name").by("lang")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],josh,java] |
+      | p[v[marko],josh,java] |
+
+  Scenario: g_V_out_out_path_byXnameX_byXageX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().out().out().path().by("name").by("age")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[marko,d[32],ripple] |
+      | p[marko,d[32],lop] |
+
+  Scenario: g_V_asXaX_hasXname_markoX_asXbX_hasXage_29X_asXcX_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").has("name", "marko").as("b").has("age", 29).as("c").path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko]] |
+
+  Scenario: g_VX1X_outEXcreatedX_inV_inE_outV_path
+    Given the modern graph
+    And using the parameter v1Id is "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).outE("created").inV().inE().outV().path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],e[marko-created->lop],v[lop],e[marko-created->lop],v[marko]] |
+      | p[v[marko],e[marko-created->lop],v[lop],e[josh-created->lop],v[josh]] |
+      | p[v[marko],e[marko-created->lop],v[lop],e[peter-created->lop],v[peter]] |
+
+  Scenario: g_V_asXaX_out_asXbX_out_asXcX_path_fromXbX_toXcX_byXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("b").out().as("c").path().from("b").to("c").by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[josh,ripple] |
+      | p[josh,lop] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04d90466/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 1ac9ed8..c3b46be 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
 import org.junit.Test;
@@ -59,13 +60,18 @@ public class FeatureCoverageTest {
 
         // TEMPORARY while test framework is under development - all tests should ultimately be included
         final List<Class<?>> temp = Arrays.asList(
+                // branch
                 BranchTest.class,
                 ChooseTest.class,
                 OptionalTest.class,
+                // filter
                 CoinTest.class,
+                // map
                 CountTest.class,
-                GroupCountTest.class,
-                VertexTest.class);
+                PathTest.class,
+                VertexTest.class,
+                // sideEffect
+                GroupCountTest.class);
 
         final Field field = ProcessStandardSuite.class.getDeclaredField("testsToEnforce");
         field.setAccessible(true);


[36/50] tinkerpop git commit: TINKERPOP-1784 Added properties() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added properties() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/28c4b1c9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/28c4b1c9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/28c4b1c9

Branch: refs/heads/TINKERPOP-1784
Commit: 28c4b1c9ab49873423296c27c5303475a93647ea
Parents: b41ba18
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 14:31:20 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Properties.feature | 68 +++++++++++++++++++++++
 1 file changed, 68 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/28c4b1c9/gremlin-test/features/map/Properties.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Properties.feature b/gremlin-test/features/map/Properties.feature
new file mode 100644
index 0000000..35ccd77
--- /dev/null
+++ b/gremlin-test/features/map/Properties.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 - properties()
+
+  Scenario: g_V_hasXageX_propertiesXname_ageX_value
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("age").properties("name", "age").value()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | marko |
+      | d[29] |
+      | vadas |
+      | d[27] |
+      | josh  |
+      | d[32] |
+      | peter |
+      | d[35] |
+
+  Scenario: g_V_hasXageX_propertiesXage_nameX_value
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("age").properties("age", "name").value()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | marko |
+      | d[29] |
+      | vadas |
+      | d[27] |
+      | josh  |
+      | d[32] |
+      | peter |
+      | d[35] |
+
+  Scenario: g_V_hasXageX_properties_hasXid_nameIdX_value
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      There is no way to currently get property identifiers on elements.
+      """
+
+  Scenario: g_V_hasXageX_propertiesXnameX
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      There is no way to currently assert property elements in the test logic.
+      """


[43/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for order()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for order()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/25771f7c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/25771f7c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/25771f7c

Branch: refs/heads/TINKERPOP-1784
Commit: 25771f7c3fbe8d714b2c76a096586800b981dd8c
Parents: d554861
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 14:15:28 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Order.feature | 132 +++++++++++++++++++++++++++
 1 file changed, 132 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25771f7c/gremlin-test/features/map/Order.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Order.feature b/gremlin-test/features/map/Order.feature
new file mode 100644
index 0000000..9005465
--- /dev/null
+++ b/gremlin-test/features/map/Order.feature
@@ -0,0 +1,132 @@
+# 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 - order()
+
+  Scenario: g_V_name_order
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("name").order()
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | josh |
+      | lop  |
+      | marko |
+      | peter |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_name_order_byXa1_b1X_byXb2_a2X
+    Given the modern graph
+    And using the parameter l1 defined as "c[a, b -> a.substring(1, 2).compareTo(b.substring(1, 2))]"
+    And using the parameter l2 defined as "c[a, b -> b.substring(2, 3).compareTo(a.substring(2, 3))]"
+    And the traversal of
+      """
+      g.V().values("name").order().by(l1).by(l2)
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | marko  |
+      | vadas  |
+      | peter  |
+      | ripple |
+      | josh   |
+      | lop    |
+
+  Scenario: g_V_order_byXname_incrX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().order().by("name", Order.incr).values("name")
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | josh |
+      | lop  |
+      | marko |
+      | peter |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_order_byXnameX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().order().by("name").values("name")
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | josh |
+      | lop  |
+      | marko |
+      | peter |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_outE_order_byXweight_decrX_weight
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().outE().order().by("weight", Order.decr).values("weight")
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | d[1.0] |
+      | d[1.0] |
+      | d[0.5] |
+      | d[0.4] |
+      | d[0.4] |
+      | d[0.2] |
+
+  Scenario: g_V_order_byXname_a1_b1X_byXname_b2_a2X_name
+    Given the modern graph
+    And using the parameter l1 defined as "c[a, b -> a.substring(1, 2).compareTo(b.substring(1, 2))]"
+    And using the parameter l2 defined as "c[a, b -> b.substring(2, 3).compareTo(a.substring(2, 3))]"
+    And the traversal of
+      """
+      g.V().order().by("name", l1).by("name", l2).values("name")
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | marko  |
+      | vadas  |
+      | peter  |
+      | ripple |
+      | josh   |
+      | lop    |
+
+  Scenario: g_V_asXaX_outXcreatedX_asXbX_order_byXshuffleX_selectXa_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out("created").as("b").order().by(Order.shuffle).select("a", "b")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[lop]"}] |
+      | m[{"a":"v[peter]","b":"v[lop]"}] |
+      | m[{"a":"v[josh]","b":"v[ripple]"}] |
+      | m[{"a":"v[josh]","b":"v[lop]"}] |


[37/50] tinkerpop git commit: TINKERPOP-1784 Fixed some badly named feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Fixed some badly named feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b41ba184
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b41ba184
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b41ba184

Branch: refs/heads/TINKERPOP-1784
Commit: b41ba1840aedb297d0578c997d6d3a10972a5d6d
Parents: 25771f7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 14:31:01 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Max.feature | 2 +-
 gremlin-test/features/map/Min.feature | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b41ba184/gremlin-test/features/map/Max.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Max.feature b/gremlin-test/features/map/Max.feature
index 24cb81a..bb7e3d4 100644
--- a/gremlin-test/features/map/Max.feature
+++ b/gremlin-test/features/map/Max.feature
@@ -39,7 +39,7 @@ Feature: Step - max()
       | result |
       | d[35] |
 
-  Scenario: get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_maxX
+  Scenario: g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_maxX
     Given the modern graph
     And the traversal of
       """

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b41ba184/gremlin-test/features/map/Min.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Min.feature b/gremlin-test/features/map/Min.feature
index 172fbaf..c4b86c6 100644
--- a/gremlin-test/features/map/Min.feature
+++ b/gremlin-test/features/map/Min.feature
@@ -39,7 +39,7 @@ Feature: Step - min()
       | result |
       | d[27] |
 
-  Scenario: get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_minX
+  Scenario: g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_minX
     Given the modern graph
     And the traversal of
       """


[49/50] tinkerpop git commit: TINKERPOP-1784 Updated changelog

Posted by sp...@apache.org.
TINKERPOP-1784 Updated changelog


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d65d6fab
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d65d6fab
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d65d6fab

Branch: refs/heads/TINKERPOP-1784
Commit: d65d6fab5a5e01acde52047b026a198ebc6db8ed
Parents: 628322f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 15:17:03 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:47 2017 -0500

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d65d6fab/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index ffd9de5..7860929 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Fixed an `ArrayOutOfBoundsException` in `hasId()` for the rare situation when the provided collection is empty.
 * Bump to Netty 4.0.52
 * `TraversalVertexProgram` `profile()` now accounts for worker iteration in `GraphComputer` OLAP.
+* Added test framework for GLVs.
+* `TraversalVertexProgram` ``profile()` now accounts for worker iteration in `GraphComputer` OLAP.
 * Added a test for self-edges and fixed `Neo4jVertex` to provided repeated self-edges on `BOTH`.
 * Better respected permissions on the `plugins.txt` file and prevented writing if marked as read-only.
 * Added getters for the lambdas held by `LambdaCollectingBarrierStep`, `LambdaFlatMapStep` and `LambdaSideEffectStep`.


[50/50] tinkerpop git commit: TINKERPOP-1784 Added sack() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added sack() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e1a67f13
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e1a67f13
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e1a67f13

Branch: refs/heads/TINKERPOP-1784
Commit: e1a67f13c405dbd489c3ebd9b63e1ddfea00ef13
Parents: d65d6fa
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 15:17:20 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:47 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/sideEffect/Sack.feature | 71 ++++++++++++++++++++++
 1 file changed, 71 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1a67f13/gremlin-test/features/sideEffect/Sack.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Sack.feature b/gremlin-test/features/sideEffect/Sack.feature
new file mode 100644
index 0000000..b0d4cc0
--- /dev/null
+++ b/gremlin-test/features/sideEffect/Sack.feature
@@ -0,0 +1,71 @@
+# 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 - sack()
+
+  Scenario: g_withSackXhelloX_V_outE_sackXassignX_byXlabelX_inV_sack
+    Given the modern graph
+    And the traversal of
+      """
+      g.withSack("hello").V().outE().sack(Operator.assign).by(T.label).inV().sack()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | created |
+      | knows |
+      | knows |
+      | created |
+      | created |
+      | created |
+
+  Scenario: g_withSackX0X_V_outE_sackXsumX_byXweightX_inV_sack_sum
+    Given the modern graph
+    And the traversal of
+      """
+      g.withSack(0.0).V().outE().sack(Operator.sum).by("weight").inV().sack().sum()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[3.5] |
+
+  Scenario: g_withSackX0X_V_repeatXoutE_sackXsumX_byXweightX_inVX_timesX2X_sack
+    Given the modern graph
+    And the traversal of
+      """
+      g.withSack(0.0).V().repeat(__.outE().sack(Operator.sum).by("weight").inV()).times(2).sack()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[2.0] |
+      | d[1.4] |
+
+  Scenario: g_withSackX0X_V_outE_sackXsum_weightX_inV_sack_sum
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      This API is deprecated - will not test.
+      """
+
+  Scenario: g_withSackX0X_V_repeatXoutE_sackXsum_weightX_inVX_timesX2X_sack
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      This API is deprecated - will not test.
+      """
\ No newline at end of file


[40/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for constant()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for constant()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2ab8f26e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2ab8f26e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2ab8f26e

Branch: refs/heads/TINKERPOP-1784
Commit: 2ab8f26e8595d167cc5791a44017f63debe94902
Parents: e0ba493
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 15:42:29 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Constant.feature | 50 +++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2ab8f26e/gremlin-test/features/map/Constant.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Constant.feature b/gremlin-test/features/map/Constant.feature
new file mode 100644
index 0000000..f4ff337
--- /dev/null
+++ b/gremlin-test/features/map/Constant.feature
@@ -0,0 +1,50 @@
+# 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 - constant()
+
+  Scenario: g_V_constantX123X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V().constant(123)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[123] |
+      | d[123] |
+      | d[123] |
+      | d[123] |
+      | d[123] |
+      | d[123] |
+
+  Scenario: g_V_chooseXhasLabelXpersonX_valuesXnameX_constantXinhumanXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.hasLabel("person"), __.values("name"), __.constant("inhuman"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | vadas |
+      | inhuman |
+      | josh |
+      | inhuman |
+      | peter |
+


[22/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for or()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for or()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/13dce477
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/13dce477
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/13dce477

Branch: refs/heads/TINKERPOP-1784
Commit: 13dce477c3c3485af992af7080ff27d83a3381d4
Parents: 0e22934
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 20 14:06:15 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Or.feature         | 59 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 2 files changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/13dce477/gremlin-test/features/filter/Or.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Or.feature b/gremlin-test/features/filter/Or.feature
new file mode 100644
index 0000000..111315a
--- /dev/null
+++ b/gremlin-test/features/filter/Or.feature
@@ -0,0 +1,59 @@
+# 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 - or()
+
+  Scenario: g_V_orXhasXage_gt_27X__outE_count_gte_2X_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().or(__.has("age", P.gt(27)), __.outE().count().is(P.gte(2l))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | josh  |
+      | peter |
+
+  Scenario: g_V_orXoutEXknowsX__hasXlabel_softwareX_or_hasXage_gte_35XX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().or(__.outE("knows"), __.has(T.label, "software").or().has("age", P.gte(35))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | ripple |
+      | lop  |
+      | peter |
+
+  Scenario: g_V_asXaX_orXselectXaX_selectXaXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").or(__.select("a"), __.select("a"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[vadas] |
+      | v[lop] |
+      | v[josh] |
+      | v[ripple] |
+      | v[peter]  |
+

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/13dce477/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 97f1fd6..282d8a8 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest;
@@ -75,6 +76,7 @@ public class FeatureCoverageTest {
                 CoinTest.class,
                 DropTest.class,
                 IsTest.class,
+                OrTest.class,
                 // map
                 CountTest.class,
                 PathTest.class,


[42/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for loop() and map()

Posted by sp...@apache.org.
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/178ce1b5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/178ce1b5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/178ce1b5

Branch: refs/heads/TINKERPOP-1784
Commit: 178ce1b50a808a0f551e156b0a2c248992b701f8
Parents: da49b9e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 2 11:59:10 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 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/178ce1b5/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/178ce1b5/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]  |


[27/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for match()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for match()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/984decf1
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/984decf1
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/984decf1

Branch: refs/heads/TINKERPOP-1784
Commit: 984decf1aa8ad30ce976c3ec3b74c38bf1a71aed
Parents: 178ce1b
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 9 12:50:52 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Match.feature | 80 ++++++++++++++++++++++++++++
 1 file changed, 80 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/984decf1/gremlin-test/features/map/Match.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Match.feature b/gremlin-test/features/map/Match.feature
new file mode 100644
index 0000000..59c56fd
--- /dev/null
+++ b/gremlin-test/features/map/Match.feature
@@ -0,0 +1,80 @@
+# 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 - match()
+
+  Scenario: g_V_valueMap_matchXa_selectXnameX_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().valueMap().match(__.as("a").select("name").as("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":{"name":["marko"],"age":[29]},"b":["marko"]}] |
+      | m[{"a":{"name":["vadas"],"age":[27]},"b":["vadas"]}] |
+      | m[{"a":{"name":["lop"],"lang":["java"]},"b":["lop"]}] |
+      | m[{"a":{"name":["josh"],"age":[32]},"b":["josh"]}] |
+      | m[{"a":{"name":["ripple"],"lang":["java"]},"b":["ripple"]}] |
+      | m[{"a":{"name":["peter"],"age":[35]},"b":["peter"]}] |
+
+  Scenario: g_V_matchXa_out_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().match(__.as("a").out().as("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[lop]"}] |
+      | m[{"a":"v[marko]","b":"v[vadas]"}] |
+      | m[{"a":"v[marko]","b":"v[josh]"}] |
+      | m[{"a":"v[josh]","b":"v[ripple]"}] |
+      | m[{"a":"v[josh]","b":"v[lop]"}] |
+      | m[{"a":"v[peter]","b":"v[lop]"}] |
+
+  Scenario: g_V_matchXa_out_bX_selectXb_idX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().match(__.as("a").out().as("b")).select("b").by(T.id)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[3] |
+      | d[2] |
+      | d[4] |
+      | d[5] |
+      | d[3] |
+      | d[3] |
+
+  Scenario: g_V_matchXa_knows_b__b_created_cX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().match(__.as("a").out("knows").as("b"),
+                  __.as("b").out("created").as("c"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[josh]", "c":"v[ripple]"}] |
+      | m[{"a":"v[marko]","b":"v[josh]", "c":"v[lop]"}] |
+


[17/50] tinkerpop git commit: TINKERPOP-1784 Add tests for inject() and provide method for ignoring tests

Posted by sp...@apache.org.
TINKERPOP-1784 Add tests for inject() and provide method for ignoring tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/90cdc0c5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/90cdc0c5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/90cdc0c5

Branch: refs/heads/TINKERPOP-1784
Commit: 90cdc0c569be46fc004ce2e28524c5d0feb2c3dd
Parents: 4748de8
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 18 14:36:25 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     | 11 +++++
 gremlin-test/features/filter/Coin.feature       |  1 -
 gremlin-test/features/sideEffect/Inject.feature | 49 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  4 +-
 4 files changed, 63 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/90cdc0c5/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 a0fcd9b..f348ccb 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -34,6 +34,9 @@ regex_not = re.compile(r"([(.,\s])not\(")
 regex_or = re.compile(r"([(.,\s])or\(")
 
 
+ignores = ["g.V(v1Id).out().inject(v2).values(\"name\")"]
+
+
 @given("the {graph_name:w} graph")
 def choose_graph(step, graph_name):
     step.context.g = Graph().traversal().withRemote(step.context.remote_conn[graph_name])
@@ -65,6 +68,7 @@ def add_parameter(step, param_name, param):
 
 @given("the traversal of")
 def translate_traversal(step):
+    step.context.ignore = ignores.__contains__(step.text)
     step.context.traversal = _make_traversal(
         step.context.g, step.text,
         step.context.traversal_params if hasattr(step.context, "traversal_params") else {})
@@ -72,6 +76,7 @@ def translate_traversal(step):
 
 @when("iterated to list")
 def iterate_the_traversal(step):
+    print str(step.context.traversal.bytecode)
     step.context.result = map(lambda x: _convert_results(x), step.context.traversal.toList())
 
 
@@ -82,6 +87,9 @@ def next_the_traversal(step):
 
 @then("the result should be {characterized_as:w}")
 def assert_result(step, characterized_as):
+    if step.context.ignore:
+        return
+
     if characterized_as == "empty":
         assert_that(len(step.context.result), equal_to(0))
     elif characterized_as == "ordered":
@@ -94,6 +102,9 @@ def assert_result(step, characterized_as):
 
 @then("the graph should return {count:d} for count of {traversal_string:QuotedString}")
 def assert_side_effects(step, count, traversal_string):
+    if step.context.ignore:
+        return
+
     t = _make_traversal(step.context.g, traversal_string, {})
     assert_that(count, equal_to(t.count().next()))
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/90cdc0c5/gremlin-test/features/filter/Coin.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Coin.feature b/gremlin-test/features/filter/Coin.feature
index d1acc46..569f1db 100644
--- a/gremlin-test/features/filter/Coin.feature
+++ b/gremlin-test/features/filter/Coin.feature
@@ -32,7 +32,6 @@ Feature: Step - coin()
       | v[ripple] |
       | v[peter]  |
 
-
   Scenario: g_V_coinX0X
     Given the modern graph
     And the traversal of

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/90cdc0c5/gremlin-test/features/sideEffect/Inject.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Inject.feature b/gremlin-test/features/sideEffect/Inject.feature
new file mode 100644
index 0000000..fcb5ff4
--- /dev/null
+++ b/gremlin-test/features/sideEffect/Inject.feature
@@ -0,0 +1,49 @@
+# 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 - inject()
+
+  Scenario: g_VX1X_out_injectXv2X_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v2 defined as "v[vadas]"
+    And the traversal of
+      """
+      g.V(v1Id).out().inject(v2).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | vadas |
+      | lop   |
+      | vadas |
+      | josh  |
+
+
+  Scenario: g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter c defined as "c[it.get().length()]"
+    And the traversal of
+      """
+      g.V(v1Id).out().values("name").inject("daniel").as("a").map(c).path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[daniel,d[6]] |
+      | p[v[marko],v[lop],lop,d[3]] |
+      | p[v[marko],v[vadas],vadas,d[5]] |
+      | p[v[marko],v[josh],josh,d[4]] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/90cdc0c5/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index bb2c483..d8ffc53 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -29,6 +29,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectTest;
 import org.junit.Test;
 
 import java.io.BufferedReader;
@@ -77,7 +78,8 @@ public class FeatureCoverageTest {
                 VertexTest.class,
                 // sideEffect
                 AggregateTest.class,
-                GroupCountTest.class);
+                GroupCountTest.class,
+                InjectTest.class);
 
         final Field field = ProcessStandardSuite.class.getDeclaredField("testsToEnforce");
         field.setAccessible(true);


[13/50] tinkerpop git commit: TINKERPOP-1784 Added sample() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added sample() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e7c8835e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e7c8835e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e7c8835e

Branch: refs/heads/TINKERPOP-1784
Commit: e7c8835e6e8a2bdf3ca684b6bd6bc70ef2088ca5
Parents: 5676913
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 12:35:59 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Sample.feature | 75 ++++++++++++++++++++++++
 1 file changed, 75 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e7c8835e/gremlin-test/features/filter/Sample.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Sample.feature b/gremlin-test/features/filter/Sample.feature
new file mode 100644
index 0000000..0f30527
--- /dev/null
+++ b/gremlin-test/features/filter/Sample.feature
@@ -0,0 +1,75 @@
+# 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 - sample()
+
+  Scenario: g_E_sampleX1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.E().sample(1)
+      """
+    When iterated to list
+    Then should have a result count of 1
+
+  Scenario: g_E_sampleX2X_byXweightX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.E().sample(2).by("weight")
+      """
+    When iterated to list
+    Then should have a result count of 2
+
+  Scenario: g_V_localXoutE_sampleX1X_byXweightXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.outE().sample(1).by("weight"))
+      """
+    When iterated to list
+    Then should have a result count of 3
+
+  Scenario: g_V_group_byXlabelX_byXbothE_weight_sampleX2X_foldX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by(T.label).by(__.bothE().values("weight").sample(2).fold())
+      """
+    When iterated to list
+    Then nothing should happen because
+      """
+      The return value of this traversal is a map of samples weights in a list for each key which makes it
+      especially hard to assert with the current test language established and the non-deterministic outcomes
+      of sample().
+      """
+
+  Scenario: g_V_group_byXlabelX_byXbothE_weight_fold_sampleXlocal_5XX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by(T.label).by(__.bothE().values("weight").fold().sample(Scope.local, 5))
+      """
+    When iterated to list
+    Then nothing should happen because
+      """
+      The return value of this traversal is a map of samples weights in a list for each key which makes it
+      especially hard to assert with the current test language established and the non-deterministic outcomes
+      of sample().
+      """
+


[46/50] tinkerpop git commit: TINKERPOP-1784 Added sum() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added sum() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e7ea6a1d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e7ea6a1d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e7ea6a1d

Branch: refs/heads/TINKERPOP-1784
Commit: e7ea6a1d36889b6a919b7e493e54b90780ae4d8c
Parents: 28c4b1c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 14:36:03 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:22 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Sum.feature | 40 ++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e7ea6a1d/gremlin-test/features/map/Sum.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Sum.feature b/gremlin-test/features/map/Sum.feature
new file mode 100644
index 0000000..35571fa
--- /dev/null
+++ b/gremlin-test/features/map/Sum.feature
@@ -0,0 +1,40 @@
+# 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 - sum()
+
+  Scenario: g_V_valuesXageX_sum
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").sum()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[123] |
+
+  Scenario: g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_sumX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("software").group().by("name").by(__.bothE().values("weight").sum())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":1.0,"lop":1.0}] |
\ No newline at end of file


[44/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for coalesce()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for coalesce()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/83a683af
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/83a683af
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/83a683af

Branch: refs/heads/TINKERPOP-1784
Commit: 83a683afe90e2bffff8f164535307c6d7af57253
Parents: dc973ff
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 2 07:52:49 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Coalesce.feature | 78 +++++++++++++++++++++++++
 1 file changed, 78 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/83a683af/gremlin-test/features/map/Coalesce.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Coalesce.feature b/gremlin-test/features/map/Coalesce.feature
new file mode 100644
index 0000000..f7786ff
--- /dev/null
+++ b/gremlin-test/features/map/Coalesce.feature
@@ -0,0 +1,78 @@
+# 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 - coalesce()
+
+  Scenario: g_V_coalesceXoutXfooX_outXbarXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().coalesce(__.out("foo"), __.out("bar"))
+      """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_VX1X_coalesceXoutXknowsX_outXcreatedXX_valuesXnameX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).coalesce(__.out("knows"), __.out("created")).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | vadas |
+      | josh |
+
+  Scenario: g_VX1X_coalesceXoutXcreatedX_outXknowsXX_valuesXnameX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).coalesce(__.out("created"), __.out("knows")).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | lop |
+
+  Scenario: g_V_coalesceXoutXlikesX_outXknowsX_inXcreatedXX_groupCount_byXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().coalesce(__.out("likes"), __.out("knows"), __.out("created")).groupCount().by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":1, "vadas":1, "josh":1, "lop":2}] |
+
+  Scenario: g_V_coalesceXoutEXknowsX_outEXcreatedXX_otherV_path_byXnameX_byXlabelX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().coalesce(__.outE("knows"), __.outE("created")).otherV().path().by("name").by(T.label)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | p[marko,knows,vadas] |
+      | p[marko,knows,josh] |
+      | p[josh,created,ripple] |
+      | p[josh,created,lop] |
+      | p[peter,created,lop] |


[20/50] tinkerpop git commit: TINKERPOP-1784 Added test for drop() and graph init language

Posted by sp...@apache.org.
TINKERPOP-1784 Added test for drop() and graph init language

Graph init language provides a way to add data to an empty graph as part of a scenario.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d74d6a6f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d74d6a6f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d74d6a6f

Branch: refs/heads/TINKERPOP-1784
Commit: d74d6a6f66498d564cbee003ecb4cf93dd27606c
Parents: dd9d1ba
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 17 15:20:28 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     | 53 ++++++++++------
 gremlin-test/features/filter/Drop.feature       | 63 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 3 files changed, 101 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74d6a6f/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 5040896..a0fcd9b 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -36,10 +36,19 @@ regex_or = re.compile(r"([(.,\s])or\(")
 
 @given("the {graph_name:w} graph")
 def choose_graph(step, graph_name):
-    # only have modern atm but graphName would be used to select the right one
     step.context.g = Graph().traversal().withRemote(step.context.remote_conn[graph_name])
 
 
+@given("the graph initializer of")
+def initialize_graph(step):
+    traversal = _make_traversal(step.context.g, step.text, {})
+
+    # just be sure that the traversal returns something to prove that it worked to some degree. probably
+    # is overkill to try to assert the complete success of this init operation. presumably the test
+    # suite would fail elsewhere if this didn't work which would help identify a problem.
+    assert len(traversal.toList()) > 0
+
+
 @given("an unsupported test")
 def unsupported_scenario(step):
     # this is a do nothing step as the test can't be supported for whatever reason
@@ -56,22 +65,9 @@ def add_parameter(step, param_name, param):
 
 @given("the traversal of")
 def translate_traversal(step):
-    g = step.context.g
-    b = {"g": g,
-         "__": __,
-         "Column": Column,
-         "Direction": Direction,
-         "Order": Order,
-         "P": P,
-         "Pick": Pick,
-         "Scope": Scope,
-         "T": T}
-
-    if hasattr(step.context, "traversal_params"):
-        b.update(step.context.traversal_params)
-
-    # print _translate(step.text + " - " + str(b))
-    step.context.traversal = eval(_translate(step.text), b)
+    step.context.traversal = _make_traversal(
+        step.context.g, step.text,
+        step.context.traversal_params if hasattr(step.context, "traversal_params") else {})
 
 
 @when("iterated to list")
@@ -96,6 +92,12 @@ def assert_result(step, characterized_as):
         raise ValueError("unknown data characterization of " + characterized_as)
 
 
+@then("the graph should return {count:d} for count of {traversal_string:QuotedString}")
+def assert_side_effects(step, count, traversal_string):
+    t = _make_traversal(step.context.g, traversal_string, {})
+    assert_that(count, equal_to(t.count().next()))
+
+
 @then("nothing should happen because")
 def nothing_happening(step):
     return
@@ -177,3 +179,20 @@ def _translate(traversal):
     replaced = regex_not.sub(r"\1not_(", replaced)
     replaced = regex_or.sub(r"\1or_(", replaced)
     return regex_in.sub(r"\1in_(", replaced)
+
+
+def _make_traversal(g, traversal_string, params):
+    b = {"g": g,
+         "__": __,
+         "Column": Column,
+         "Direction": Direction,
+         "Order": Order,
+         "P": P,
+         "Pick": Pick,
+         "Scope": Scope,
+         "T": T}
+
+    b.update(params)
+
+    # print _translate(step.text + " - " + str(b))
+    return eval(_translate(traversal_string), b)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74d6a6f/gremlin-test/features/filter/Drop.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Drop.feature b/gremlin-test/features/filter/Drop.feature
new file mode 100644
index 0000000..753b377
--- /dev/null
+++ b/gremlin-test/features/filter/Drop.feature
@@ -0,0 +1,63 @@
+# 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 - drop()
+
+  Scenario: g_V_drop
+    Given the empty graph
+    And the graph initializer of
+      """
+      g.addV().as("a").addV().as("b").addE("knows").to("a")
+      """
+    And the traversal of
+      """
+      g.V().drop()
+      """
+    When iterated to list
+    Then the result should be empty
+    And the graph should return 0 for count of "g.V()"
+    And the graph should return 0 for count of "g.E()"
+
+  Scenario: g_V_outE_drop
+    Given the empty graph
+    And the graph initializer of
+      """
+      g.addV().as("a").addV().as("b").addE("knows").to("a")
+      """
+    And the traversal of
+      """
+      g.V().outE().drop()
+      """
+    When iterated to list
+    Then the result should be empty
+    And the graph should return 2 for count of "g.V()"
+    And the graph should return 0 for count of "g.E()"
+
+  Scenario: g_V_properties_drop
+    Given the empty graph
+    And the graph initializer of
+      """
+      g.addV().property("name","bob").addV().property("name","alice")
+      """
+    And the traversal of
+      """
+      g.V().properties().drop()
+      """
+    When iterated to list
+    Then the result should be empty
+    And the graph should return 2 for count of "g.V()"
+    And the graph should return 0 for count of "g.V().properties()"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d74d6a6f/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 7c53cb9..1f52581 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -22,6 +22,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
@@ -67,6 +68,7 @@ public class FeatureCoverageTest {
                 OptionalTest.class,
                 // filter
                 CoinTest.class,
+                DropTest.class,
                 // map
                 CountTest.class,
                 PathTest.class,


[45/50] tinkerpop git commit: TINKERPOP-1784 radish bumped version and broke stuff

Posted by sp...@apache.org.
TINKERPOP-1784 radish bumped version and broke stuff

Tables now return a list of maps that required a header so all feature files needed header.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e90faa15
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e90faa15
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e90faa15

Branch: refs/heads/TINKERPOP-1784
Commit: e90faa151a63613d8e5a9b2a076eb491afda4f26
Parents: 2ab8f26
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 31 08:24:28 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  4 +--
 gremlin-python/src/main/jython/setup.py         |  2 +-
 gremlin-test/features/branch/Branch.feature     |  3 ++
 gremlin-test/features/branch/Choose.feature     |  6 ++++
 gremlin-test/features/branch/Local.feature      | 11 +++++++
 gremlin-test/features/branch/Optional.feature   |  4 +++
 gremlin-test/features/branch/Repeat.feature     | 13 ++++++++
 gremlin-test/features/branch/Union.feature      |  7 ++++
 gremlin-test/features/filter/And.feature        |  4 +++
 gremlin-test/features/filter/Coin.feature       |  1 +
 gremlin-test/features/filter/CyclicPath.feature |  2 ++
 gremlin-test/features/filter/Dedup.feature      | 15 +++++++++
 gremlin-test/features/filter/Filter.feature     |  5 +++
 gremlin-test/features/filter/Has.feature        |  2 ++
 gremlin-test/features/filter/Is.feature         |  5 +++
 gremlin-test/features/filter/Or.feature         |  3 ++
 gremlin-test/features/filter/Range.feature      | 15 +++++++++
 gremlin-test/features/filter/SimplePath.feature |  7 ++--
 gremlin-test/features/map/Constant.feature      |  2 ++
 gremlin-test/features/map/Count.feature         |  9 ++++++
 gremlin-test/features/map/Max.feature           |  3 ++
 gremlin-test/features/map/Min.feature           |  3 ++
 gremlin-test/features/map/Path.feature          |  7 ++++
 gremlin-test/features/map/Project.feature       |  2 ++
 gremlin-test/features/map/Select.feature        | 20 ++++++++++++
 gremlin-test/features/map/ValueMap.feature      |  3 ++
 gremlin-test/features/map/Vertex.feature        | 34 +++++++++++++++++++-
 .../features/sideEffect/Aggregate.feature       |  4 +++
 .../features/sideEffect/GroupCount.feature      | 10 ++++++
 gremlin-test/features/sideEffect/Inject.feature |  2 ++
 gremlin-test/features/sideEffect/Store.feature  |  3 ++
 31 files changed, 205 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/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 14a0153..b48b7ef 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -168,7 +168,7 @@ def _convert_results(val):
 
 
 def _any_assertion(data, result, ctx):
-    converted = [_convert(line[0], ctx) for line in data]
+    converted = [_convert(line['result'], ctx) for line in data]
     for r in result:
         assert_that(r, is_in(converted))
 
@@ -182,7 +182,7 @@ def _table_assertion(data, result, ctx, ordered):
     # finds a match in the results for each line of data to assert and then removes that item
     # from the list - in the end there should be no items left over and each will have been asserted
     for ix, line in enumerate(data):
-        val = _convert(line[0], ctx)
+        val = _convert(line['result'], ctx)
 
         # clear the labels since we don't define them in .feature files
         if isinstance(val, Path):

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-python/src/main/jython/setup.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/setup.py b/gremlin-python/src/main/jython/setup.py
index 9a66c81..c72a4d3 100644
--- a/gremlin-python/src/main/jython/setup.py
+++ b/gremlin-python/src/main/jython/setup.py
@@ -71,7 +71,7 @@ setup(
     tests_require=[
         'pytest',
         'mock',
-        'radish-bdd',
+        'radish-bdd==0.8.0',
         'PyHamcrest'
     ],
     install_requires=install_requires,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/branch/Branch.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Branch.feature b/gremlin-test/features/branch/Branch.feature
index d306c3b..b8690c6 100644
--- a/gremlin-test/features/branch/Branch.feature
+++ b/gremlin-test/features/branch/Branch.feature
@@ -30,6 +30,7 @@ Feature: Step - branch()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | java |
       | java |
       | lop |
@@ -51,6 +52,7 @@ Feature: Step - branch()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | java |
       | java |
       | lop |
@@ -73,6 +75,7 @@ Feature: Step - branch()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | java |
       | java |
       | lop |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/branch/Choose.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Choose.feature b/gremlin-test/features/branch/Choose.feature
index 0b5f00d..aa5a545 100644
--- a/gremlin-test/features/branch/Choose.feature
+++ b/gremlin-test/features/branch/Choose.feature
@@ -27,6 +27,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"name":["marko"], "age":[29]}] |
       | josh |
 
@@ -39,6 +40,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | josh |
       | vadas |
       | josh |
@@ -57,6 +59,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | ripple |
       | josh |
@@ -75,6 +78,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | peter |
@@ -92,6 +96,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | vadas |
       | josh |
       | vadas |
@@ -111,6 +116,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"p1":"marko", "p2":"vadas"}] |
       | m[{"p1":"marko", "p2":"josh"}] |
       | m[{"p1":"vadas", "p2":"vadas"}] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/branch/Local.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Local.feature b/gremlin-test/features/branch/Local.feature
index fa12d8c..4b33d62 100644
--- a/gremlin-test/features/branch/Local.feature
+++ b/gremlin-test/features/branch/Local.feature
@@ -25,6 +25,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | brussels       |
       | san diego      |
       | centreville    |
@@ -42,6 +43,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a":"marko","b":3}] |
       | m[{"a":"josh","b":5}]  |
       | m[{"a":"josh","b":3}]  |
@@ -55,6 +57,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[3] |
       | d[0] |
       | d[0] |
@@ -71,6 +74,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | vadas |
       | josh  |
     And should have a result count of 1
@@ -83,6 +87,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | marko  |
       | lop    |
       | ripple |
@@ -99,6 +104,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | e[josh-created->lop]    |
       | e[josh-created->ripple] |
     And should have a result count of 1
@@ -112,6 +118,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | e[marko-knows->josh]    |
       | e[josh-created->lop]    |
       | e[josh-created->ripple] |
@@ -126,6 +133,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | marko  |
       | ripple |
       | lop    |
@@ -140,6 +148,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | marko  |
       | ripple |
       | lop    |
@@ -153,6 +162,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | marko |
 
@@ -166,6 +176,7 @@ Feature: Step - local()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"name":"marko","project":"lop"}]   |
       | m[{"name":"josh","project":"lop"}]    |
       | m[{"name":"peter","project":"lop"}]   |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/branch/Optional.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Optional.feature b/gremlin-test/features/branch/Optional.feature
index 258230c..5d2be8d 100644
--- a/gremlin-test/features/branch/Optional.feature
+++ b/gremlin-test/features/branch/Optional.feature
@@ -26,6 +26,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
 
   Scenario: g_VX2X_optionalXinXknowsXX
@@ -37,6 +38,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
 
   Scenario: g_V_hasLabelXpersonX_optionalXoutXknowsX_optionalXoutXcreatedXXX_path
@@ -50,6 +52,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[vadas]] |
       | p[v[marko],v[josh],v[ripple]] |
       | p[v[marko],v[josh],v[lop]] |
@@ -65,6 +68,7 @@ Feature: Step - choose()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[lop]] |
       | p[v[marko],v[vadas]] |
       | p[v[marko],v[josh],v[ripple]] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/branch/Repeat.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Repeat.feature b/gremlin-test/features/branch/Repeat.feature
index 6d97fc0..082a3c6 100644
--- a/gremlin-test/features/branch/Repeat.feature
+++ b/gremlin-test/features/branch/Repeat.feature
@@ -25,6 +25,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[lop]] |
       | p[v[marko],v[vadas]] |
       | p[v[marko],v[josh]] |
@@ -42,6 +43,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | marko |
 
@@ -53,6 +55,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[ripple] |
       | v[lop] |
 
@@ -64,6 +67,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[ripple] |
       | v[lop] |
       | v[josh] |
@@ -79,6 +83,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | ripple |
       | lop |
 
@@ -90,6 +95,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko]] |
       | p[v[marko],v[lop]] |
       | p[v[marko],v[vadas]] |
@@ -113,6 +119,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko]] |
       | p[v[marko],v[lop]] |
       | p[v[marko],v[vadas]] |
@@ -137,6 +144,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | josh  |
@@ -149,6 +157,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"ripple":2,"peter":1,"vadas":2,"josh":2,"lop":4,"marko":1}] |
 
   Scenario: g_VX1X_repeatXgroupCountXmX_byXloopsX_outX_timesX3X_capXmX
@@ -174,6 +183,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[43958] |
 
   Scenario: g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name
@@ -185,6 +195,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | vadas |
       | ripple  |
@@ -200,6 +211,7 @@ Feature: Step - repeat()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"ripple":3,"vadas":3,"josh":4,"lop":10,"marko":4}] |
 
   Scenario: g_V_hasXname_markoX_repeatXoutE_inV_simplePathX_untilXhasXname_rippleXX_path_byXnameX_byXlabelX
@@ -210,6 +222,7 @@ Feature: Step - repeat()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | marko |
       | knows |
       | josh  |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/branch/Union.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Union.feature b/gremlin-test/features/branch/Union.feature
index 938f51a..6178092 100644
--- a/gremlin-test/features/branch/Union.feature
+++ b/gremlin-test/features/branch/Union.feature
@@ -25,6 +25,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | vadas |
       | josh |
@@ -47,6 +48,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | ripple |
       | lop |
       | lop   |
@@ -61,6 +63,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | java   |
       | lop    |
       | vadas  |
@@ -84,6 +87,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"java":4,"ripple":1,"person":4,"vadas":1,"josh":1,"lop":3}] |
 
   Scenario: g_V_unionXrepeatXunionXoutXcreatedX__inXcreatedXX_timesX2X__repeatXunionXinXcreatedX__outXcreatedXX_timesX2XX_label_groupCount
@@ -99,6 +103,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"software":12,"person":20}] |
 
   Scenario: g_VX1_2X_unionXoutE_count__inE_count__outE_weight_sumX
@@ -111,6 +116,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[3]   |
       | d[1.9] |
       | d[1]   |
@@ -125,6 +131,7 @@ Feature: Step - union()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[3]   |
       | d[0]   |
       | d[1.9] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/And.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/And.feature b/gremlin-test/features/filter/And.feature
index c47ec6e..1e8732e 100644
--- a/gremlin-test/features/filter/And.feature
+++ b/gremlin-test/features/filter/And.feature
@@ -25,6 +25,7 @@ Feature: Step - and()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | josh |
 
@@ -36,6 +37,7 @@ Feature: Step - and()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | josh |
       | peter  |
 
@@ -47,6 +49,7 @@ Feature: Step - and()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
 
   Scenario: g_V_asXaX_andXselectXaX_selectXaXX
@@ -57,6 +60,7 @@ Feature: Step - and()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[vadas] |
       | v[lop] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Coin.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Coin.feature b/gremlin-test/features/filter/Coin.feature
index 569f1db..b9e8ac8 100644
--- a/gremlin-test/features/filter/Coin.feature
+++ b/gremlin-test/features/filter/Coin.feature
@@ -25,6 +25,7 @@ Feature: Step - coin()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[vadas] |
       | v[lop] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/CyclicPath.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/CyclicPath.feature b/gremlin-test/features/filter/CyclicPath.feature
index d07e4ad..bfbb3a9 100644
--- a/gremlin-test/features/filter/CyclicPath.feature
+++ b/gremlin-test/features/filter/CyclicPath.feature
@@ -26,6 +26,7 @@ Feature: Step - cyclicPath()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
 
   Scenario: g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path
@@ -37,6 +38,7 @@ Feature: Step - cyclicPath()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[lop],v[marko]] |
 
   Scenario: g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Dedup.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Dedup.feature b/gremlin-test/features/filter/Dedup.feature
index 7433da2..a19a0bf 100644
--- a/gremlin-test/features/filter/Dedup.feature
+++ b/gremlin-test/features/filter/Dedup.feature
@@ -25,6 +25,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | josh  |
       | peter |
@@ -37,6 +38,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"x":"lop","y":"marko"}] |
       | m[{"x":"lop","y":"josh"}] |
       | m[{"x":"lop","y":"peter"}] |
@@ -52,6 +54,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | vadas |
       | josh  |
@@ -67,6 +70,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
 
   Scenario: g_V_both_name_order_byXa_bX_dedup_value
@@ -78,6 +82,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | josh |
       | lop  |
       | marko |
@@ -93,6 +98,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | josh |
       | lop  |
       | marko |
@@ -108,6 +114,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[josh] |
       | v[lop]  |
       | v[marko] |
@@ -132,6 +139,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"software":[1.0,0.4,0.2],"person":[0.5,1.0,0.4,0.2]}] |
 
   Scenario: g_V_asXaX_both_asXbX_dedupXa_bX_byXlabelX_selectXa_bX
@@ -142,6 +150,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a":"v[marko]","b":"v[lop]"}] |
       | m[{"a":"v[marko]","b":"v[vadas]"}] |
       | m[{"a":"v[lop]","b":"v[marko]"}] |
@@ -154,6 +163,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[lop],v[marko]] |
       | p[v[josh],v[ripple],v[josh]] |
       | p[v[josh],v[lop],v[marko]] |
@@ -167,6 +177,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | vadas |
       | josh |
@@ -180,6 +191,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | josh |
       | peter |
@@ -193,6 +205,7 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[1] |
 
   Scenario: g_V_asXaX_repeatXbothX_timesX3X_emit_name_asXbX_group_byXselectXaXX_byXselectXbX_dedup_order_foldX_selectXvaluesX_unfold_dedup
@@ -203,6 +216,7 @@ Feature: Step - dedup()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | josh |
       | lop  |
       | marko |
@@ -218,5 +232,6 @@ Feature: Step - dedup()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[0] |
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Filter.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Filter.feature b/gremlin-test/features/filter/Filter.feature
index 05e7cea..76a5d7d 100644
--- a/gremlin-test/features/filter/Filter.feature
+++ b/gremlin-test/features/filter/Filter.feature
@@ -36,6 +36,7 @@ Feature: Step - filter()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[vadas] |
       | v[lop] |
@@ -52,6 +53,7 @@ Feature: Step - filter()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[ripple] |
       | v[lop]  |
 
@@ -65,6 +67,7 @@ Feature: Step - filter()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[josh] |
 
   Scenario: g_V_filterXname_startsWith_m_OR_name_startsWith_pX
@@ -76,6 +79,7 @@ Feature: Step - filter()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[peter]  |
 
@@ -98,6 +102,7 @@ Feature: Step - filter()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-created->lop] |
       | e[marko-knows->josh] |
       | e[marko-knows->vadas] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Has.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature
index fb140a9..797a1ec 100644
--- a/gremlin-test/features/filter/Has.feature
+++ b/gremlin-test/features/filter/Has.feature
@@ -25,6 +25,7 @@ Feature: Step - has()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[josh] |
       | v[peter] |
 
@@ -37,6 +38,7 @@ Feature: Step - has()
     """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[josh] |
       | v[josh] |
       | v[peter] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Is.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Is.feature b/gremlin-test/features/filter/Is.feature
index 9a00945..5ed0485 100644
--- a/gremlin-test/features/filter/Is.feature
+++ b/gremlin-test/features/filter/Is.feature
@@ -25,6 +25,7 @@ Feature: Step - coin()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[32] |
 
   Scenario: g_V_valuesXageX_isXlte_30X
@@ -35,6 +36,7 @@ Feature: Step - coin()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[27] |
       | d[29] |
 
@@ -46,6 +48,7 @@ Feature: Step - coin()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[29] |
       | d[32] |
 
@@ -57,6 +60,7 @@ Feature: Step - coin()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | ripple |
 
   Scenario: g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX
@@ -67,4 +71,5 @@ Feature: Step - coin()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Or.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Or.feature b/gremlin-test/features/filter/Or.feature
index 111315a..7f4782d 100644
--- a/gremlin-test/features/filter/Or.feature
+++ b/gremlin-test/features/filter/Or.feature
@@ -25,6 +25,7 @@ Feature: Step - or()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | josh  |
       | peter |
@@ -37,6 +38,7 @@ Feature: Step - or()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | ripple |
       | lop  |
@@ -50,6 +52,7 @@ Feature: Step - or()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[vadas] |
       | v[lop] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/Range.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Range.feature b/gremlin-test/features/filter/Range.feature
index d5ea3bc..da02849 100644
--- a/gremlin-test/features/filter/Range.feature
+++ b/gremlin-test/features/filter/Range.feature
@@ -26,6 +26,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[josh] |
       | v[vadas] |
       | v[lop] |
@@ -39,6 +40,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[josh] |
       | v[vadas] |
       | v[lop] |
@@ -54,6 +56,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[lop] |
       | v[ripple] |
     And should have a result count of 1
@@ -67,6 +70,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[lop] |
       | v[ripple] |
     And should have a result count of 1
@@ -80,6 +84,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[marko] |
       | v[josh] |
       | v[peter] |
@@ -94,6 +99,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[marko] |
       | v[josh] |
       | v[peter] |
@@ -107,6 +113,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be of
+      | result |
       | v[marko] |
       | v[josh] |
       | v[peter] |
@@ -123,6 +130,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | l[lop,josh] |
       | l[ripple,josh] |
 
@@ -134,6 +142,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | ripple |
 
@@ -145,6 +154,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | l[josh,ripple] |
       | l[josh,lop] |
 
@@ -156,6 +166,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | josh |
       | josh |
 
@@ -176,6 +187,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a":"lop","b":"josh"}] |
       | m[{"a":"ripple","b":"josh"}] |
 
@@ -187,6 +199,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a":"lop"}] |
       | m[{"a":"ripple"}] |
 
@@ -198,6 +211,7 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"b":"josh","c":"lop"}] |
       | m[{"b":"josh","c":"ripple"}] |
 
@@ -209,5 +223,6 @@ Feature: Step - range()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"b":"josh"}] |
       | m[{"b":"josh"}] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/filter/SimplePath.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/SimplePath.feature b/gremlin-test/features/filter/SimplePath.feature
index c8091af..ed66e8b 100644
--- a/gremlin-test/features/filter/SimplePath.feature
+++ b/gremlin-test/features/filter/SimplePath.feature
@@ -26,10 +26,11 @@ Feature: Step - simplePath()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[josh] |
       | v[peter] |
 
-  Scenario: get_g_V_repeatXboth_simplePathX_timesX3X_path
+  Scenario: g_V_repeatXboth_simplePathX_timesX3X_path
     Given the modern graph
     And the traversal of
       """
@@ -37,6 +38,7 @@ Feature: Step - simplePath()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[lop],v[josh],v[ripple]] |
       | p[v[marko],v[josh],v[lop],v[peter]] |
       | p[v[vadas],v[marko],v[lop],v[josh]] |
@@ -56,7 +58,7 @@ Feature: Step - simplePath()
       | p[v[peter],v[lop],v[josh],v[ripple]] |
       | p[v[peter],v[lop],v[josh],v[marko]] |
 
-  Scenario: get_g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX
+  Scenario: g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX
     Given the modern graph
     And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
@@ -65,5 +67,6 @@ Feature: Step - simplePath()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[marko,josh,ripple] |
       | p[marko,josh,lop]    |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Constant.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Constant.feature b/gremlin-test/features/map/Constant.feature
index f4ff337..9fb3dfb 100644
--- a/gremlin-test/features/map/Constant.feature
+++ b/gremlin-test/features/map/Constant.feature
@@ -26,6 +26,7 @@ Feature: Step - constant()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[123] |
       | d[123] |
       | d[123] |
@@ -41,6 +42,7 @@ Feature: Step - constant()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | inhuman |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Count.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Count.feature b/gremlin-test/features/map/Count.feature
index 7f708ee..1d98464 100644
--- a/gremlin-test/features/map/Count.feature
+++ b/gremlin-test/features/map/Count.feature
@@ -25,6 +25,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[6] |
 
   Scenario: g_V_out_count
@@ -35,6 +36,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[6] |
 
   Scenario: g_V_both_both_count
@@ -45,6 +47,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[30] |
 
   Scenario: g_V_fold_countXlocalX
@@ -55,6 +58,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[6] |
 
   Scenario: g_V_hasXnoX_count
@@ -65,6 +69,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[0] |
 
   Scenario: g_V_whereXinXkknowsX_outXcreatedX_count_is_0XX_name
@@ -75,6 +80,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | lop  |
       | ripple |
@@ -88,6 +94,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[2505037961767380] |
 
   Scenario: g_V_repeatXoutX_timesX5X_asXaX_outXwrittenByX_asXbX_selectXa_bX_count
@@ -103,6 +110,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[24309134024] |
 
   Scenario: g_V_repeatXoutX_timesX3X_count
@@ -113,4 +121,5 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[14465066] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Max.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Max.feature b/gremlin-test/features/map/Max.feature
index c36177d..24cb81a 100644
--- a/gremlin-test/features/map/Max.feature
+++ b/gremlin-test/features/map/Max.feature
@@ -25,6 +25,7 @@ Feature: Step - max()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[35] |
 
   Scenario: g_V_repeatXbothX_timesX5X_age_max
@@ -35,6 +36,7 @@ Feature: Step - max()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[35] |
 
   Scenario: get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_maxX
@@ -45,4 +47,5 @@ Feature: Step - max()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"ripple":1.0,"lop":0.4}] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Min.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Min.feature b/gremlin-test/features/map/Min.feature
index 48ceeb9..172fbaf 100644
--- a/gremlin-test/features/map/Min.feature
+++ b/gremlin-test/features/map/Min.feature
@@ -25,6 +25,7 @@ Feature: Step - min()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[27] |
 
   Scenario: g_V_repeatXbothX_timesX5X_age_min
@@ -35,6 +36,7 @@ Feature: Step - min()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | d[27] |
 
   Scenario: get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_minX
@@ -45,4 +47,5 @@ Feature: Step - min()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"ripple":1.0,"lop":0.2}] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Path.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Path.feature b/gremlin-test/features/map/Path.feature
index 2126138..ea98a7a 100644
--- a/gremlin-test/features/map/Path.feature
+++ b/gremlin-test/features/map/Path.feature
@@ -26,6 +26,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],marko] |
 
   Scenario: g_VX1X_out_path_byXageX_byXnameX
@@ -37,6 +38,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[d[29],lop] |
       | p[d[29],vadas] |
       | p[d[29],josh] |
@@ -49,6 +51,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],josh,java] |
       | p[v[marko],josh,java] |
 
@@ -60,6 +63,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[marko,d[32],ripple] |
       | p[marko,d[32],lop] |
 
@@ -71,6 +75,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko]] |
 
   Scenario: g_VX1X_outEXcreatedX_inV_inE_outV_path
@@ -82,6 +87,7 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],e[marko-created->lop],v[lop],e[marko-created->lop],v[marko]] |
       | p[v[marko],e[marko-created->lop],v[lop],e[josh-created->lop],v[josh]] |
       | p[v[marko],e[marko-created->lop],v[lop],e[peter-created->lop],v[peter]] |
@@ -94,5 +100,6 @@ Feature: Step - count()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[josh,ripple] |
       | p[josh,lop] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Project.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Project.feature b/gremlin-test/features/map/Project.feature
index 3d8b9cc..8a781f2 100644
--- a/gremlin-test/features/map/Project.feature
+++ b/gremlin-test/features/map/Project.feature
@@ -28,6 +28,7 @@ Feature: Step - project()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a":3, "b":29}] |
       | m[{"a":0, "b":27}] |
       | m[{"a":2, "b":32}] |
@@ -47,6 +48,7 @@ Feature: Step - project()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | lop |
       | lop |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Select.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature
index 317dad8..538a734 100644
--- a/gremlin-test/features/map/Select.feature
+++ b/gremlin-test/features/map/Select.feature
@@ -26,6 +26,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a": "v[marko]", "b": "v[vadas]"}] |
       | m[{"a": "v[marko]", "b": "v[josh]"}] |
 
@@ -39,6 +40,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a": "marko", "b": "vadas"}] |
       | m[{"a": "marko", "b": "josh"}] |
 
@@ -51,6 +53,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[marko] |
 
@@ -64,6 +67,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | marko |
 
@@ -76,6 +80,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a": "marko", "b": "lop"}] |
       | m[{"a": "marko", "b": "vadas"}] |
       | m[{"a": "marko", "b": "josh"}] |
@@ -92,6 +97,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a": "marko", "b": "lop"}] |
       | m[{"a": "marko", "b": "vadas"}] |
       | m[{"a": "marko", "b": "josh"}] |
@@ -111,6 +117,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a": "marko", "b": "marko"}] |
       | m[{"a": "vadas", "b": "vadas"}] |
       | m[{"a": "josh", "b": "josh"}] |
@@ -132,6 +139,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"a": 3, "b": "matthias"}] |
       | m[{"a": 4, "b": "marko"}] |
       | m[{"a": 5, "b": "stephen"}] |
@@ -145,6 +153,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
 
   Scenario: g_V_label_groupCount_asXxX_selectXxX
@@ -155,6 +164,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"software": 2, "person": 4}] |
 
   Scenario: g_V_hasLabelXpersonX_asXpX_mapXbothE_label_groupCountX_asXrX_selectXp_rX
@@ -167,6 +177,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"p": "v[marko]", "r": {"created": 1, "knows": 2}}] |
       | m[{"p": "v[vadas]", "r": {"knows": 1}}] |
       | m[{"p": "v[josh]", "r": {"created": 2, "knows": 1}}] |
@@ -185,6 +196,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[vadas] |
       | v[lop] |
@@ -201,6 +213,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[marko] |
       | v[marko] |
@@ -214,6 +227,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[josh] |
       | v[josh] |
 
@@ -228,6 +242,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | ripple |
       | lop |
 
@@ -242,6 +257,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-knows->vadas] |
 
   Scenario: g_VX1X_outEXknowsX_hasXweight_1X_asXhereX_inV_hasXname_joshX_selectXhereX
@@ -256,6 +272,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-knows->josh] |
 
   Scenario: g_VX1X_outEXknowsX_asXhereX_hasXweight_1X_asXfakeX_inV_hasXname_joshX_selectXhereX
@@ -270,6 +287,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-knows->josh] |
 
   Scenario: g_V_asXhereXout_name_selectXhereX
@@ -282,6 +300,7 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[marko] |
       | v[marko] |
@@ -301,4 +320,5 @@ Feature: Step - select()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"ripple": 1, "lop": 6}] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/ValueMap.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/ValueMap.feature b/gremlin-test/features/map/ValueMap.feature
index 0a2220e..2390512 100644
--- a/gremlin-test/features/map/ValueMap.feature
+++ b/gremlin-test/features/map/ValueMap.feature
@@ -25,6 +25,7 @@ Feature: Step - valueMap()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"name": ["marko"], "age": [29]}] |
       | m[{"name": ["josh"], "age": [32]}] |
       | m[{"name": ["peter"], "age": [35]}] |
@@ -40,6 +41,7 @@ Feature: Step - valueMap()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | m[{"name": ["marko"], "age": [29]}] |
       | m[{"name": ["josh"], "age": [32]}] |
       | m[{"name": ["peter"], "age": [35]}] |
@@ -56,4 +58,5 @@ 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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/map/Vertex.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Vertex.feature b/gremlin-test/features/map/Vertex.feature
index 9dff917..569fb6f 100644
--- a/gremlin-test/features/map/Vertex.feature
+++ b/gremlin-test/features/map/Vertex.feature
@@ -26,6 +26,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | lop |
@@ -39,6 +40,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | lop |
@@ -51,6 +53,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[vadas] |
       | v[lop] |
@@ -67,6 +70,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[lop] |
       | v[josh] |
@@ -80,6 +84,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
 
   Scenario: g_VX4X_both
@@ -91,6 +96,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[lop] |
       | v[ripple] |
@@ -103,6 +109,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-created->lop] |
       | e[marko-knows->josh] |
       | e[marko-knows->vadas] |
@@ -119,6 +126,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[josh-created->lop] |
 
   Scenario: g_EX11AsStringX
@@ -130,6 +138,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[josh-created->lop] |
 
   Scenario: g_VX1X_outE
@@ -141,6 +150,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-created->lop] |
       | e[marko-knows->josh] |
       | e[marko-knows->vadas] |
@@ -154,6 +164,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-knows->vadas] |
 
   Scenario: g_VX4X_bothEXcreatedX
@@ -165,6 +176,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[josh-created->lop] |
       | e[josh-created->ripple] |
 
@@ -177,6 +189,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[josh-created->lop] |
       | e[josh-created->ripple] |
       | e[marko-knows->josh] |
@@ -190,6 +203,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
       | v[lop] |
@@ -203,6 +217,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
 
   Scenario: g_V_outE_hasXweight_1X_outV
@@ -213,6 +228,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[josh] |
 
@@ -224,6 +240,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | marko |
       | marko |
@@ -244,6 +261,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | marko |
       | marko |
       | josh |
@@ -258,6 +276,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
       | v[lop] |
@@ -271,6 +290,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[marko] |
       | v[ripple] |
       | v[lop] |
@@ -284,6 +304,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[lop] |
 
   Scenario: g_VX2X_inE
@@ -295,6 +316,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | e[marko-knows->vadas] |
 
   Scenario: get_g_VX1X_outE_otherV
@@ -306,7 +328,8 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
-      | v[vadas] |                               
+      | result |
+      | v[vadas] |
       | v[josh] |
       | v[lop] |
 
@@ -319,6 +342,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
 
@@ -331,6 +355,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
 
@@ -343,6 +368,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
       | v[lop] |
@@ -356,6 +382,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
 
@@ -368,6 +395,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
       | v[lop] |
@@ -380,6 +408,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[ripple] |
       | v[lop] |
 
@@ -402,6 +431,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | vadas |
       | josh |
       | lop |
@@ -415,6 +445,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | v[vadas] |
       | v[josh] |
 
@@ -433,6 +464,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | lop |
       | lop |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/sideEffect/Aggregate.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Aggregate.feature b/gremlin-test/features/sideEffect/Aggregate.feature
index 1a5634d..52454f4 100644
--- a/gremlin-test/features/sideEffect/Aggregate.feature
+++ b/gremlin-test/features/sideEffect/Aggregate.feature
@@ -25,6 +25,7 @@ Feature: Step - aggregate()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | marko |
       | josh |
       | peter |
@@ -40,6 +41,7 @@ Feature: Step - aggregate()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | marko |
       | josh |
       | peter |
@@ -55,6 +57,7 @@ Feature: Step - aggregate()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[v[marko],v[lop]] |
       | p[v[marko],v[vadas]] |
       | p[v[marko],v[josh]] |
@@ -70,6 +73,7 @@ Feature: Step - aggregate()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | d[29] |
       | d[27] |
       | d[32] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/sideEffect/GroupCount.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/GroupCount.feature b/gremlin-test/features/sideEffect/GroupCount.feature
index 35ac8d3..8803722 100644
--- a/gremlin-test/features/sideEffect/GroupCount.feature
+++ b/gremlin-test/features/sideEffect/GroupCount.feature
@@ -25,6 +25,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{"ripple": 1, "lop": 3}] |
 
   Scenario: g_V_outXcreatedX_name_groupCount
@@ -35,6 +36,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{"ripple": 1, "lop": 3}] |
 
   Scenario: g_V_outXcreatedX_groupCountXaX_byXnameX_capXaX
@@ -48,6 +50,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{"ripple": 1, "lop": 3}] |
 
   Scenario: g_V_outXcreatedX_name_groupCountXaX_capXaX
@@ -60,6 +63,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{"ripple": 1, "lop": 3}] |
 
   Scenario: g_V_repeatXout_groupCountXaX_byXnameXX_timesX2X_capXaX
@@ -73,6 +77,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{"ripple":2, "lop": 4, "josh": 1, "vadas": 1}] |
 
   Scenario: g_V_both_groupCountXaX_byXlabelX_asXbX_barrier_whereXselectXaX_selectXsoftwareX_isXgtX2XXX_selectXbX_name
@@ -90,6 +95,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | lop |
       | lop |
       | lop |
@@ -116,6 +122,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | d[12] |
 
   Scenario: g_V_hasXnoX_groupCount
@@ -126,6 +133,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{}] |
 
   Scenario: g_V_hasXnoX_groupCountXaX_capXaX
@@ -136,6 +144,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{}] |
 
   Scenario: g_V_unionXrepeatXoutX_timesX2X_groupCountXmX_byXlangXX__repeatXinX_timesX2X_groupCountXmX_byXnameXX_capXmX
@@ -147,6 +156,7 @@ Feature: Step - groupCount()
       """
     When iterated to list
     Then the result should be ordered
+      | result |
       | m[{"marko": 2, "java": 2}] |
 
   Scenario: g_V_outXcreatedX_groupCountXxX_capXxX

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/sideEffect/Inject.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Inject.feature b/gremlin-test/features/sideEffect/Inject.feature
index fcb5ff4..532dbe1 100644
--- a/gremlin-test/features/sideEffect/Inject.feature
+++ b/gremlin-test/features/sideEffect/Inject.feature
@@ -27,6 +27,7 @@ Feature: Step - inject()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | vadas |
       | lop   |
       | vadas |
@@ -43,6 +44,7 @@ Feature: Step - inject()
       """
     When iterated to list
     Then the result should be unordered
+      | result |
       | p[daniel,d[6]] |
       | p[v[marko],v[lop],lop,d[3]] |
       | p[v[marko],v[vadas],vadas,d[5]] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e90faa15/gremlin-test/features/sideEffect/Store.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Store.feature b/gremlin-test/features/sideEffect/Store.feature
index ef66c5e..2cb7faf 100644
--- a/gremlin-test/features/sideEffect/Store.feature
+++ b/gremlin-test/features/sideEffect/Store.feature
@@ -25,6 +25,7 @@ Feature: Step - store()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | lop |
@@ -41,6 +42,7 @@ Feature: Step - store()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | marko |
       | vadas |
       | lop |
@@ -74,6 +76,7 @@ Feature: Step - store()
       """
     When iterated next
     Then the result should be unordered
+      | result |
       | d[1] |
       | d[1] |
       | d[0] |


[04/50] tinkerpop git commit: TINKERPOP-1784 Added support for testing branch() with gherkin

Posted by sp...@apache.org.
TINKERPOP-1784 Added support for testing branch() with gherkin


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/918a56ec
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/918a56ec
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/918a56ec

Branch: refs/heads/TINKERPOP-1784
Commit: 918a56ec6877d75fe348d8e7a5ce4dc66706ca7a
Parents: 47e6c53
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 10 13:17:55 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:19 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     | 12 ++--
 gremlin-test/features/branch/Branch.feature     | 76 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 3 files changed, 86 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918a56ec/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 a2efb67..0d52d75 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -21,7 +21,7 @@ import json
 import re
 from gremlin_python.structure.graph import Graph
 from gremlin_python.process.graph_traversal import __
-from gremlin_python.process.traversal import P, Scope, Column, Order, Direction, T
+from gremlin_python.process.traversal import P, Scope, Column, Order, Direction, T, Pick
 from radish import given, when, then
 from hamcrest import *
 
@@ -58,15 +58,17 @@ def translate_traversal(step):
          "Column": Column,
          "Direction": Direction,
          "Order": Order,
-         "P": P,
-         "gt": P.gt,
+         "P": P, "gt": P.gt,
+         "Pick": Pick, "any": Pick.any,
          "Scope": Scope,
          "T": T,
          "as_": __.as_,
          "bothE": __.bothE,
          "in_": __.in_,
+         "label": __.label,
          "out": __.out,
-         "repeat": __.repeat}
+         "repeat": __.repeat,
+         "values": __.values}
 
     if hasattr(step.context, "traversal_params"):
         b.update(step.context.traversal_params)
@@ -123,6 +125,8 @@ def __convert(val, ctx):
         return ctx.lookup_e["modern"][val[2:-1]]
     elif isinstance(val, str) and re.match("^m\[.*\]$", val):         # parse json as a map
         return __convert(json.loads(val[2:-1]), ctx)
+    elif isinstance(val, str) and re.match("^c\[.*\]$", val):         # parse lambda
+        return lambda: (val[2:-1], "gremlin-groovy")
     else:
         return val
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918a56ec/gremlin-test/features/branch/Branch.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Branch.feature b/gremlin-test/features/branch/Branch.feature
new file mode 100644
index 0000000..d12fc0f
--- /dev/null
+++ b/gremlin-test/features/branch/Branch.feature
@@ -0,0 +1,76 @@
+# 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 - branch()
+
+  Scenario: g_V_branchXlabel_eq_person__a_bX_optionXa__ageX_optionXb__langX_optionXb__nameX
+    Given the modern graph
+    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"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | java |
+      | java |
+      | lop |
+      | ripple |
+      | d[29] |
+      | d[27] |
+      | d[32] |
+      | d[35] |
+
+  Scenario: g_V_branchXlabel_isXpersonX_countX_optionX1__ageX_optionX0__langX_optionX0__nameX
+    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"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | java |
+      | java |
+      | lop |
+      | ripple |
+      | d[29] |
+      | d[27] |
+      | d[32] |
+      | d[35] |
+
+  Scenario: g_V_branchXlabel_isXpersonX_countX_optionX1__ageX_optionX0__langX_optionX0__nameX_optionXany__labelX
+    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())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | java |
+      | java |
+      | lop |
+      | ripple |
+      | d[29] |
+      | d[27] |
+      | d[32] |
+      | d[35] |
+      | person |
+      | person |
+      | person |
+      | person |
+      | software |
+      | software |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/918a56ec/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index ce66889..be01613 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process;
 
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
@@ -56,6 +57,7 @@ public class FeatureCoverageTest {
 
         // TEMPORARY while test framework is under development - all tests should ultimately be included
         final List<Class<?>> temp = Arrays.asList(
+                BranchTest.class,
                 CoinTest.class,
                 CountTest.class,
                 GroupCountTest.class,


[07/50] tinkerpop git commit: TINKERPOP-1784 Added range() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added range() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/56769136
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/56769136
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/56769136

Branch: refs/heads/TINKERPOP-1784
Commit: 56769136420fe197267a867d8f3dc81b7022b46d
Parents: 7307df0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 12:17:43 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Range.feature | 213 ++++++++++++++++++++++++
 1 file changed, 213 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/56769136/gremlin-test/features/filter/Range.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Range.feature b/gremlin-test/features/filter/Range.feature
new file mode 100644
index 0000000..d5ea3bc
--- /dev/null
+++ b/gremlin-test/features/filter/Range.feature
@@ -0,0 +1,213 @@
+# 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 - range()
+
+  Scenario: g_VX1X_out_limitX2X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out().limit(2)
+      """
+    When iterated to list
+    Then the result should be of
+      | v[josh] |
+      | v[vadas] |
+      | v[lop] |
+    And should have a result count of 2
+
+  Scenario: g_V_localXoutE_limitX1X_inVX_limitX3X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.outE().limit(1)).inV().limit(3)
+      """
+    When iterated to list
+    Then the result should be of
+      | v[josh] |
+      | v[vadas] |
+      | v[lop] |
+      | v[ripple] |
+    And should have a result count of 3
+
+  Scenario: g_VX1X_outXknowsX_outEXcreatedX_rangeX0_1X_inV
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("knows").outE("created").range(0, 1).inV()
+      """
+    When iterated to list
+    Then the result should be of
+      | v[lop] |
+      | v[ripple] |
+    And should have a result count of 1
+
+  Scenario: g_VX1X_outXknowsX_outXcreatedX_rangeX0_1X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("knows").out("created").range(0, 1)
+      """
+    When iterated to list
+    Then the result should be of
+      | v[lop] |
+      | v[ripple] |
+    And should have a result count of 1
+
+  Scenario: g_VX1X_outXcreatedX_inXcreatedX_rangeX1_3X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("created").in("created").range(1, 3)
+      """
+    When iterated to list
+    Then the result should be of
+      | v[marko] |
+      | v[josh] |
+      | v[peter] |
+    And should have a result count of 2
+
+  Scenario: get_g_VX1X_outXcreatedX_inEXcreatedX_rangeX1_3X_outV
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("created").inE("created").range(1, 3).outV()
+      """
+    When iterated to list
+    Then the result should be of
+      | v[marko] |
+      | v[josh] |
+      | v[peter] |
+    And should have a result count of 2
+
+  Scenario: get_g_V_repeatXbothX_timesX3X_rangeX5_11X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.both()).times(3).range(5, 11)
+      """
+    When iterated to list
+    Then the result should be of
+      | v[marko] |
+      | v[josh] |
+      | v[peter] |
+      | v[lop] |
+      | v[vadas] |
+      | v[ripple] |
+    And should have a result count of 6
+
+  Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_limitXlocal_2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").in().as("a").in().as("a").select("a").by(__.unfold().values("name").fold()).limit(Scope.local, 2)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | l[lop,josh] |
+      | l[ripple,josh] |
+
+  Scenario: g_V_asXaX_in_asXaX_in_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_limitXlocal_1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").in().as("a").in().as("a").select("a").by(__.unfold().values("name").fold()).limit(Scope.local, 1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | ripple |
+
+  Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXaX_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("a").by(__.unfold().values("name").fold()).range(Scope.local, 1, 3)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | l[josh,ripple] |
+      | l[josh,lop] |
+
+  Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXaX_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("a").by(__.unfold().values("name").fold()).range(Scope.local, 1, 2)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | josh |
+      | josh |
+
+  Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXaX_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("a").by(__.unfold().values("name").fold()).range(Scope.local, 4, 5)
+      """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_V_asXaX_in_asXbX_in_asXcX_selectXa_b_cX_byXnameX_limitXlocal_2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").in().as("b").in().as("c").select("a","b","c").by("name").limit(Scope.local, 2)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"a":"lop","b":"josh"}] |
+      | m[{"a":"ripple","b":"josh"}] |
+
+  Scenario: g_V_asXaX_in_asXbX_in_asXcX_selectXa_b_cX_byXnameX_limitXlocal_1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").in().as("b").in().as("c").select("a","b","c").by("name").limit(Scope.local, 1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"a":"lop"}] |
+      | m[{"a":"ripple"}] |
+
+  Scenario: g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_3X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("b").out().as("c").select("a","b","c").by("name").range(Scope.local, 1, 3)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"b":"josh","c":"lop"}] |
+      | m[{"b":"josh","c":"ripple"}] |
+
+  Scenario: g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_rangeXlocal_1_2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("b").out().as("c").select("a","b","c").by("name").range(Scope.local, 1, 2)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"b":"josh"}] |
+      | m[{"b":"josh"}] |
\ No newline at end of file


[02/50] tinkerpop git commit: TINKERPOP-1784 Added multi-line support in the .feature files

Posted by sp...@apache.org.
TINKERPOP-1784 Added multi-line support in the .feature files


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4a6772c6
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4a6772c6
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4a6772c6

Branch: refs/heads/TINKERPOP-1784
Commit: 4a6772c6755a791992747bd4ff9e1c2b9ac80fac
Parents: 39b8417
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 10 15:39:40 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:19 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  3 +-
 gremlin-test/features/branch/Branch.feature     | 19 +++++-
 gremlin-test/features/map/Count.feature         |  7 ++-
 gremlin-test/features/map/Select.feature        | 65 +++++++++++++++-----
 .../features/sideEffect/GroupCount.feature      | 33 ++++++++--
 5 files changed, 102 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a6772c6/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 3c25258..68eeeaf 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -144,6 +144,7 @@ def __table_assertion(data, result, ctx, ordered):
 
 
 def __translate(traversal):
-    replaced = regex_as.sub(r"\1as_(", traversal)
+    replaced = traversal.replace("\n", "")
+    replaced = regex_as.sub(r"\1as_(", replaced)
     replaced = regex_is.sub(r"\1is_(", replaced)
     return regex_in.sub(r"\1in_(", replaced)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a6772c6/gremlin-test/features/branch/Branch.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Branch.feature b/gremlin-test/features/branch/Branch.feature
index 93562c8..49864e0 100644
--- a/gremlin-test/features/branch/Branch.feature
+++ b/gremlin-test/features/branch/Branch.feature
@@ -22,7 +22,11 @@ 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 +43,11 @@ 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 +64,12 @@ 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(Pick.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/4a6772c6/gremlin-test/features/map/Count.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Count.feature b/gremlin-test/features/map/Count.feature
index 6053605..7f708ee 100644
--- a/gremlin-test/features/map/Count.feature
+++ b/gremlin-test/features/map/Count.feature
@@ -94,7 +94,12 @@ 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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a6772c6/gremlin-test/features/map/Select.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature
index f29a436..74cd4ec 100644
--- a/gremlin-test/features/map/Select.feature
+++ b/gremlin-test/features/map/Select.feature
@@ -34,7 +34,8 @@ Feature: Step - select()
     And using the parameter v1Id is "v[marko].id"
     And the traversal of
       """
-      g.V(v1Id).as("a").out("knows").as("b").select("a", "b").by("name")
+      g.V(v1Id).as("a").out("knows").as("b").
+        select("a", "b").by("name")
       """
     When iterated to list
     Then the result should be unordered
@@ -58,7 +59,8 @@ Feature: Step - select()
     And using the parameter v1Id is "v[marko].id"
     And the traversal of
       """
-      g.V(v1Id).as("a").out("knows").as("b").select("a").by("name")
+      g.V(v1Id).as("a").out("knows").as("b").
+        select("a").by("name")
       """
     When iterated to list
     Then the result should be unordered
@@ -69,7 +71,8 @@ Feature: Step - select()
     Given the modern graph
     And the traversal of
       """
-      g.V().as("a").out().as("b").select("a", "b").by("name")
+      g.V().as("a").out().as("b").
+        select("a", "b").by("name")
       """
     When iterated to list
     Then the result should be unordered
@@ -84,7 +87,8 @@ Feature: Step - select()
     Given the modern graph
     And the traversal of
       """
-      g.V().as("a").out().aggregate("x").as("b").select("a", "b").by("name")
+      g.V().as("a").out().aggregate("x").as("b").
+        select("a", "b").by("name")
       """
     When iterated to list
     Then the result should be unordered
@@ -99,7 +103,11 @@ Feature: Step - select()
     Given the modern graph
     And the traversal of
       """
-      g.V().as("a").values("name").order().as("b").select("a", "b").by("name").by()
+      g.V().as("a").
+        values("name").
+        order().as("b").
+        select("a", "b").
+          by("name").by()
       """
     When iterated to list
     Then the result should be unordered
@@ -114,7 +122,13 @@ Feature: Step - select()
     Given the crew graph
     And the traversal of
       """
-      g.V().has("name", "gremlin").inE("uses").order().by("skill", Order.incr).as("a").outV().as("b").select("a", "b").by("skill").by("name")
+      g.V().has("name", "gremlin").
+        inE("uses").
+        order().by("skill", Order.incr).as("a").
+        outV().as("b").
+        select("a", "b").
+          by("skill").
+          by("name")
       """
     When iterated to list
     Then the result should be unordered
@@ -147,7 +161,9 @@ Feature: Step - select()
     Given the modern graph
     And the traversal of
       """
-      g.V().hasLabel("person").as("p").map(__.bothE().label().groupCount()).as("r").select("p", "r")
+      g.V().hasLabel("person").as("p").
+        map(__.bothE().label().groupCount()).as("r").
+        select("p", "r")
       """
     When iterated to list
     Then the result should be unordered
@@ -160,7 +176,12 @@ Feature: Step - select()
     Given the modern graph
     And the traversal of
       """
-      g.V().choose(__.outE().count().is(0L), __.as("a"), __.as("b")).choose(__.select("a"), __.select("a"), __.select("b"))
+      g.V().choose(__.outE().count().is(0L),
+                   __.as("a"),
+                   __.as("b")).
+            choose(__.select("a"),
+                   __.select("a"),
+                   __.select("b"))
       """
     When iterated to list
     Then the result should be unordered
@@ -201,7 +222,9 @@ Feature: Step - select()
     And using the parameter v4Id is "v[josh].id"
     And the traversal of
       """
-      g.V(v4Id).out().as("here").has("lang", "java").select("here").values("name")
+      g.V(v4Id).out().as("here").
+        has("lang", "java").
+        select("here").values("name")
       """
     When iterated to list
     Then the result should be unordered
@@ -213,7 +236,9 @@ Feature: Step - select()
     And using the parameter v1Id is "v[marko].id"
     And the traversal of
       """
-      g.V(v1Id).outE().as("here").inV().has("name", "vadas").select("here")
+      g.V(v1Id).outE().as("here").
+        inV().has("name", "vadas").
+        select("here")
       """
     When iterated to list
     Then the result should be unordered
@@ -224,7 +249,10 @@ Feature: Step - select()
     And using the parameter v1Id is "v[marko].id"
     And the traversal of
       """
-      g.V(v1Id).outE("knows").has("weight", 1.0).as("here").inV().has("name", "josh").select("here")
+      g.V(v1Id).outE("knows").
+        has("weight", 1.0).as("here").
+        inV().has("name", "josh").
+        select("here")
       """
     When iterated to list
     Then the result should be unordered
@@ -235,7 +263,10 @@ Feature: Step - select()
     And using the parameter v1Id is "v[marko].id"
     And the traversal of
       """
-      g.V(v1Id).outE("knows").as("here").has("weight", 1.0).as("fake").inV().has("name", "josh").select("here")
+      g.V(v1Id).outE("knows").as("here").
+        has("weight", 1.0).as("fake").
+        inV().has("name", "josh").
+        select("here")
       """
     When iterated to list
     Then the result should be unordered
@@ -245,7 +276,9 @@ Feature: Step - select()
     Given the modern graph
     And the traversal of
       """
-      g.V().as("here").out().values("name").select("here")
+      g.V().as("here").
+        out().values("name").
+        select("here")
       """
     When iterated to list
     Then the result should be unordered
@@ -260,7 +293,11 @@ 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/4a6772c6/gremlin-test/features/sideEffect/GroupCount.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/GroupCount.feature b/gremlin-test/features/sideEffect/GroupCount.feature
index 28eb675..35ac8d3 100644
--- a/gremlin-test/features/sideEffect/GroupCount.feature
+++ b/gremlin-test/features/sideEffect/GroupCount.feature
@@ -41,7 +41,10 @@ Feature: Step - groupCount()
     Given the modern graph
     And the traversal of
       """
-      g.V().out("created").groupCount("a").by("name").cap("a")
+      g.V().out("created").
+        groupCount("a").
+          by("name").
+        cap("a")
       """
     When iterated to list
     Then the result should be ordered
@@ -51,7 +54,9 @@ Feature: Step - groupCount()
     Given the modern graph
     And the traversal of
       """
-      g.V().out("created").values("name").groupCount("a").cap("a")
+      g.V().out("created").values("name").
+        groupCount("a").
+        cap("a")
       """
     When iterated to list
     Then the result should be ordered
@@ -61,7 +66,10 @@ 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 +79,14 @@ 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(P.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 +107,12 @@ 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 +142,8 @@ 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


[47/50] tinkerpop git commit: TINKERPOP-1784 Added unfold() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added unfold() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/628322f8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/628322f8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/628322f8

Branch: refs/heads/TINKERPOP-1784
Commit: 628322f880b1cb9179fbf82e2bc82e3bde53baba
Parents: e7ea6a1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 14:50:32 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:22 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Unfold.feature | 76 +++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/628322f8/gremlin-test/features/map/Unfold.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Unfold.feature b/gremlin-test/features/map/Unfold.feature
new file mode 100644
index 0000000..3a20d08
--- /dev/null
+++ b/gremlin-test/features/map/Unfold.feature
@@ -0,0 +1,76 @@
+# 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 - unfold()
+
+  Scenario: g_V_localXoutE_foldX_unfold
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.outE().fold()).unfold()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | e[marko-created->lop] |
+      | e[marko-knows->vadas] |
+      | e[marko-knows->josh] |
+      | e[josh-created->ripple] |
+      | e[josh-created->lop] |
+      | e[peter-created->lop] |
+
+  Scenario: g_V_valueMap_unfold_mapXkeyX
+    Given the modern graph
+    And using the parameter l defined as "c[it.get().getKey()]"
+    And the traversal of
+      """
+      g.V().valueMap().unfold().map(l)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | name   |
+      | age    |
+      | name   |
+      | age    |
+      | name   |
+      | lang   |
+      | lang   |
+      | name   |
+      | age    |
+      | name   |
+      | name   |
+      | age    |
+
+  Scenario: g_VX1X_repeatXboth_simplePathX_untilXhasIdX6XX_path_byXnameX_unfold
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v6Id defined as "v[peter].id"
+    And the traversal of
+      """
+      g.V(v1Id).repeat(__.both().simplePath()).until(__.hasId(v6Id)).path().by("name").unfold()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | marko |
+      | lop  |
+      | peter |
+      | marko |
+      | josh  |
+      | lop   |
+      | peter |
\ No newline at end of file


[11/50] tinkerpop git commit: TINKERPOP-1784 Changed language of parameters

Posted by sp...@apache.org.
TINKERPOP-1784 Changed language of parameters

Used "defined as" instead of "is" since the line reads more clearly with the former.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dd9d1ba3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dd9d1ba3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dd9d1ba3

Branch: refs/heads/TINKERPOP-1784
Commit: dd9d1ba31e5db9b17193a943b5634ebc5137a61e
Parents: 1ab6a86
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Oct 16 12:16:36 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  2 +-
 gremlin-test/features/branch/Branch.feature     |  2 +-
 gremlin-test/features/branch/Choose.feature     |  2 +-
 gremlin-test/features/branch/Optional.feature   |  4 +-
 gremlin-test/features/filter/Has.feature        |  2 +-
 gremlin-test/features/map/Path.feature          |  6 +--
 gremlin-test/features/map/Select.feature        | 20 ++++----
 gremlin-test/features/map/Vertex.feature        | 54 ++++++++++----------
 8 files changed, 46 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/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 c753323..5040896 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -46,7 +46,7 @@ def unsupported_scenario(step):
     return
 
 
-@given("using the parameter {param_name:w} is {param:QuotedString}")
+@given("using the parameter {param_name:w} defined as {param:QuotedString}")
 def add_parameter(step, param_name, param):
     if not hasattr(step.context, "traversal_params"):
         step.context.traversal_params = {}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/branch/Branch.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Branch.feature b/gremlin-test/features/branch/Branch.feature
index 49864e0..d306c3b 100644
--- a/gremlin-test/features/branch/Branch.feature
+++ b/gremlin-test/features/branch/Branch.feature
@@ -19,7 +19,7 @@ Feature: Step - branch()
 
   Scenario: g_V_branchXlabel_eq_person__a_bX_optionXa__ageX_optionXb__langX_optionXb__nameX
     Given the modern graph
-    And using the parameter l1 is "c[it.get().label() == 'person' ? 'a' : 'b']"
+    And using the parameter l1 defined as "c[it.get().label() == 'person' ? 'a' : 'b']"
     And the traversal of
       """
       g.V().

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/branch/Choose.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Choose.feature b/gremlin-test/features/branch/Choose.feature
index de70485..0b5f00d 100644
--- a/gremlin-test/features/branch/Choose.feature
+++ b/gremlin-test/features/branch/Choose.feature
@@ -32,7 +32,7 @@ Feature: Step - choose()
 
   Scenario: g_V_chooseXlabel_eqXpersonX__outXknowsX__inXcreatedXX_name
     Given the modern graph
-    And using the parameter l1 is "c[it.label() == 'person']"
+    And using the parameter l1 defined as "c[it.label() == 'person']"
     And the traversal of
       """
       g.V().choose(l1, __.out("knows"), __.in("created")).values("name")

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/branch/Optional.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Optional.feature b/gremlin-test/features/branch/Optional.feature
index ebd0de2..258230c 100644
--- a/gremlin-test/features/branch/Optional.feature
+++ b/gremlin-test/features/branch/Optional.feature
@@ -19,7 +19,7 @@ Feature: Step - choose()
 
   Scenario: g_VX2X_optionalXoutXknowsXX
     Given the modern graph
-    And using the parameter v2Id is "v[vadas].id"
+    And using the parameter v2Id defined as "v[vadas].id"
     And the traversal of
       """
       g.V(v2Id).optional(__.out("knows"))
@@ -30,7 +30,7 @@ Feature: Step - choose()
 
   Scenario: g_VX2X_optionalXinXknowsXX
     Given the modern graph
-    And using the parameter v2Id is "v[vadas].id"
+    And using the parameter v2Id defined as "v[vadas].id"
     And the traversal of
       """
       g.V(v2Id).optional(__.in("knows"))

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/filter/Has.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature
index 8ff3a2b..fb140a9 100644
--- a/gremlin-test/features/filter/Has.feature
+++ b/gremlin-test/features/filter/Has.feature
@@ -30,7 +30,7 @@ Feature: Step - has()
 
   Scenario: Use hasId() with P
     Given the modern graph
-    And using the parameter v1 is "v[marko].id"
+    And using the parameter v1 defined as "v[marko].id"
     And the traversal of
     """
     g.V().in().hasId(P.neq(v1))

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/map/Path.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Path.feature b/gremlin-test/features/map/Path.feature
index e7904db..2126138 100644
--- a/gremlin-test/features/map/Path.feature
+++ b/gremlin-test/features/map/Path.feature
@@ -19,7 +19,7 @@ Feature: Step - count()
 
   Scenario: g_VX1X_name_path
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).values("name").path()
@@ -30,7 +30,7 @@ Feature: Step - count()
 
   Scenario: g_VX1X_out_path_byXageX_byXnameX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).out().path().by("age").by("name")
@@ -75,7 +75,7 @@ Feature: Step - count()
 
   Scenario: g_VX1X_outEXcreatedX_inV_inE_outV_path
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE("created").inV().inE().outV().path()

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/map/Select.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature
index 74cd4ec..317dad8 100644
--- a/gremlin-test/features/map/Select.feature
+++ b/gremlin-test/features/map/Select.feature
@@ -19,7 +19,7 @@ Feature: Step - select()
 
   Scenario: get_g_VX1X_asXaX_outXknowsX_asXbX_selectXa_bX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).as("a").out("knows").as("b").select("a", "b")
@@ -31,7 +31,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_asXaX_outXknowsX_asXbX_selectXa_bX_byXnameX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).as("a").out("knows").as("b").
@@ -44,7 +44,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_asXaX_outXknowsX_asXbX_selectXaX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).as("a").out("knows").as("b").select("a")
@@ -56,7 +56,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_asXaX_outXknowsX_asXbX_selectXaX_byXnameX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).as("a").out("knows").as("b").
@@ -194,7 +194,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_asXhereX_out_selectXhereX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).as("here").out().select("here")
@@ -207,7 +207,7 @@ Feature: Step - select()
 
   Scenario: g_VX4X_out_asXhereX_hasXlang_javaX_selectXhereX
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
       """
       g.V(v4Id).as("here").out().select("here")
@@ -219,7 +219,7 @@ Feature: Step - select()
 
   Scenario: g_VX4X_out_asXhereX_hasXlang_javaX_selectXhereX_name
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
       """
       g.V(v4Id).out().as("here").
@@ -233,7 +233,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_outE_asXhereX_inV_hasXname_vadasX_selectXhereX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE().as("here").
@@ -246,7 +246,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_outEXknowsX_hasXweight_1X_asXhereX_inV_hasXname_joshX_selectXhereX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE("knows").
@@ -260,7 +260,7 @@ Feature: Step - select()
 
   Scenario: g_VX1X_outEXknowsX_asXhereX_hasXweight_1X_asXfakeX_inV_hasXname_joshX_selectXhereX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE("knows").as("here").

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dd9d1ba3/gremlin-test/features/map/Vertex.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Vertex.feature b/gremlin-test/features/map/Vertex.feature
index 1c9849e..9dff917 100644
--- a/gremlin-test/features/map/Vertex.feature
+++ b/gremlin-test/features/map/Vertex.feature
@@ -19,7 +19,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VXlistX1_2_3XX_name
     Given the modern graph
-    And using the parameter vx is "l[v[marko].id,v[vadas].id,v[lop].id]"
+    And using the parameter vx defined as "l[v[marko].id,v[vadas].id,v[lop].id]"
     And the traversal of
       """
       g.V(vx).values("name")
@@ -32,7 +32,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VXlistXv1_v2_v3XX_name
     Given the modern graph
-    And using the parameter vx is "l[v[marko],v[vadas],v[lop]]"
+    And using the parameter vx defined as "l[v[marko],v[vadas],v[lop]]"
     And the traversal of
       """
       g.V(vx).values("name")
@@ -60,7 +60,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_out
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).out()
@@ -73,7 +73,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX2X_in
     Given the modern graph
-    And using the parameter v2Id is "v[vadas].id"
+    And using the parameter v2Id defined as "v[vadas].id"
     And the traversal of
       """
       g.V(v2Id).in()
@@ -84,7 +84,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX4X_both
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
       """
       g.V(v4Id).both()
@@ -112,7 +112,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_EX11X
     Given the modern graph
-    And using the parameter e11Id is "e[josh-created->lop].id"
+    And using the parameter e11Id defined as "e[josh-created->lop].id"
     And the traversal of
     """
       g.E(e11Id)
@@ -123,7 +123,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_EX11AsStringX
     Given the modern graph
-    And using the parameter e11Id is "e[josh-created->lop].sid"
+    And using the parameter e11Id defined as "e[josh-created->lop].sid"
     And the traversal of
     """
       g.E(e11Id)
@@ -134,7 +134,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outE
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
     """
       g.V(v1Id).outE()
@@ -147,7 +147,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX2X_outE
     Given the modern graph
-    And using the parameter v2Id is "v[vadas].id"
+    And using the parameter v2Id defined as "v[vadas].id"
     And the traversal of
     """
       g.V(v2Id).inE()
@@ -158,7 +158,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX4X_bothEXcreatedX
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
     """
       g.V(v4Id).bothE("created")
@@ -170,7 +170,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX4X_bothE
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
     """
       g.V(v4Id).bothE()
@@ -183,7 +183,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outE_inV
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).both()
@@ -196,7 +196,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX2X_inE_outV
     Given the modern graph
-    And using the parameter v2Id is "v[vadas].id"
+    And using the parameter v2Id defined as "v[vadas].id"
     And the traversal of
       """
       g.V(v2Id).inE().outV()
@@ -237,7 +237,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outEXknowsX_bothV_name
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE("knows").bothV().values("name")
@@ -251,7 +251,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outE_otherV
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE().otherV()
@@ -264,7 +264,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX4X_bothE_otherV
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
       """
       g.V(v4Id).bothE().otherV()
@@ -277,7 +277,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX4X_bothE_hasXweight_lt_1X_otherV
     Given the modern graph
-    And using the parameter v4Id is "v[josh].id"
+    And using the parameter v4Id defined as "v[josh].id"
     And the traversal of
       """
       g.V(v4Id).bothE().has("weight", P.lt(1.0)).otherV()
@@ -288,7 +288,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX2X_inE
     Given the modern graph
-    And using the parameter v2Id is "v[vadas].id"
+    And using the parameter v2Id defined as "v[vadas].id"
     And the traversal of
     """
       g.V(v2Id).bothE()
@@ -299,7 +299,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: get_g_VX1X_outE_otherV
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE().otherV()
@@ -312,7 +312,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outXknowsX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).out("knows")
@@ -324,7 +324,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1AsStringX_outXknowsX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].sid"
+    And using the parameter v1Id defined as "v[marko].sid"
     And the traversal of
       """
       g.V(v1Id).out("knows")
@@ -336,7 +336,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outXknows_createdX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).out("knows","created")
@@ -349,7 +349,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outEXknowsX_inV
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE("knows").inV()
@@ -361,7 +361,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_outEXknows_createdX_inV
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).outE("knows","created").inV()
@@ -385,7 +385,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_out_out_out
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).out().out().out()
@@ -395,7 +395,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_out_name
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).out().values("name")
@@ -408,7 +408,7 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE()
 
   Scenario: g_VX1X_to_XOUT_knowsX
     Given the modern graph
-    And using the parameter v1Id is "v[marko].id"
+    And using the parameter v1Id defined as "v[marko].id"
     And the traversal of
       """
       g.V(v1Id).to(Direction.OUT, "knows")


[18/50] tinkerpop git commit: TINKERPOP-1784 Added aggregate() tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added aggregate() tests

Included option for next() in the test language.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1ab6a86c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1ab6a86c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1ab6a86c

Branch: refs/heads/TINKERPOP-1784
Commit: 1ab6a86c7ac74ded6748108545747beb8b03caac
Parents: 04d9046
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Oct 16 11:16:11 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  5 ++
 gremlin-test/features/map/Path.feature          |  2 +-
 .../features/sideEffect/Aggregate.feature       | 76 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 4 files changed, 84 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1ab6a86c/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 859d809..c753323 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -79,6 +79,11 @@ def iterate_the_traversal(step):
     step.context.result = map(lambda x: _convert_results(x), step.context.traversal.toList())
 
 
+@when("iterated next")
+def next_the_traversal(step):
+    step.context.result = map(lambda x: _convert_results(x), step.context.traversal.next())
+
+
 @then("the result should be {characterized_as:w}")
 def assert_result(step, characterized_as):
     if characterized_as == "empty":

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1ab6a86c/gremlin-test/features/map/Path.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Path.feature b/gremlin-test/features/map/Path.feature
index 350e6c6..e7904db 100644
--- a/gremlin-test/features/map/Path.feature
+++ b/gremlin-test/features/map/Path.feature
@@ -41,7 +41,7 @@ Feature: Step - count()
       | p[d[29],vadas] |
       | p[d[29],josh] |
 
-  Scenario: g_V_repeatXoutX_timesX2X_path_by_byXnameX_byXlangX
+  Scenario: g_V_repeatXoutX_timesX2X_path_byXitX_byXnameX_byXlangX
     Given the modern graph
     And the traversal of
       """

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1ab6a86c/gremlin-test/features/sideEffect/Aggregate.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Aggregate.feature b/gremlin-test/features/sideEffect/Aggregate.feature
new file mode 100644
index 0000000..1a5634d
--- /dev/null
+++ b/gremlin-test/features/sideEffect/Aggregate.feature
@@ -0,0 +1,76 @@
+# 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 - aggregate()
+
+  Scenario: g_V_valueXnameX_aggregateXxX_capXxX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("name").aggregate("x").cap("x")
+      """
+    When iterated next
+    Then the result should be unordered
+      | marko |
+      | josh |
+      | peter |
+      | lop |
+      | vadas |
+      | ripple |
+
+  Scenario: g_V_aggregateXxX_byXnameX_capXxX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().aggregate("x").by("name").cap("x")
+      """
+    When iterated next
+    Then the result should be unordered
+      | marko |
+      | josh |
+      | peter |
+      | lop |
+      | vadas |
+      | ripple |
+
+  Scenario: g_V_out_aggregateXaX_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().out().aggregate("a").path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[lop]] |
+      | p[v[marko],v[vadas]] |
+      | p[v[marko],v[josh]] |
+      | p[v[josh],v[ripple]] |
+      | p[v[josh],v[lop]] |
+      | p[v[peter],v[lop]] |
+
+  Scenario: g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("person").aggregate("x").by("age").cap("x").as("y").select("y")
+      """
+    When iterated next
+    Then the result should be unordered
+      | d[29] |
+      | d[27] |
+      | d[32] |
+      | d[35] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1ab6a86c/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index c3b46be..7c53cb9 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
 import org.junit.Test;
 
@@ -71,6 +72,7 @@ public class FeatureCoverageTest {
                 PathTest.class,
                 VertexTest.class,
                 // sideEffect
+                AggregateTest.class,
                 GroupCountTest.class);
 
         final Field field = ProcessStandardSuite.class.getDeclaredField("testsToEnforce");


[38/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for max()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for max()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e0ba4939
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e0ba4939
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e0ba4939

Branch: refs/heads/TINKERPOP-1784
Commit: e0ba4939596749b37c691d785ac8d3ceb09c2a67
Parents: b6f625f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 13:51:30 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Max.feature | 48 ++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e0ba4939/gremlin-test/features/map/Max.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Max.feature b/gremlin-test/features/map/Max.feature
new file mode 100644
index 0000000..c36177d
--- /dev/null
+++ b/gremlin-test/features/map/Max.feature
@@ -0,0 +1,48 @@
+# 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 - max()
+
+  Scenario: g_V_age_max
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").max()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[35] |
+
+  Scenario: g_V_repeatXbothX_timesX5X_age_max
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.both()).times(5).values("age").max()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[35] |
+
+  Scenario: get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_maxX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("software").group().by("name").by(__.bothE().values("weight").max())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"ripple":1.0,"lop":0.4}] |


[26/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for filter()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for filter()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8955981f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8955981f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8955981f

Branch: refs/heads/TINKERPOP-1784
Commit: 8955981fadafa0e72475a4f8da5c31ab1e5b60b4
Parents: 13dce47
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 20 15:13:06 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Filter.feature     | 106 +++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |   2 +
 2 files changed, 108 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8955981f/gremlin-test/features/filter/Filter.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Filter.feature b/gremlin-test/features/filter/Filter.feature
new file mode 100644
index 0000000..05e7cea
--- /dev/null
+++ b/gremlin-test/features/filter/Filter.feature
@@ -0,0 +1,106 @@
+# 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 - filter()
+
+  Scenario: g_V_filterXfalseX
+    Given the modern graph
+    And using the parameter l1 defined as "c[false]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_V_filterXtrueX
+    Given the modern graph
+    And using the parameter l1 defined as "c[true]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[vadas] |
+      | v[lop] |
+      | v[josh] |
+      | v[ripple] |
+      | v[peter]  |
+
+  Scenario: g_V_filterXlang_eq_javaX
+    Given the modern graph
+    And using the parameter l1 defined as "c[it.get().property('lang').orElse('none').equals('java')]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[ripple] |
+      | v[lop]  |
+
+  Scenario: g_VX1X_out_filterXage_gt_30X
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter l1 defined as "c[it.get().property('age').orElse(0) > 30]"
+    And the traversal of
+      """
+      g.V(v1Id).out().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[josh] |
+
+  Scenario: g_V_filterXname_startsWith_m_OR_name_startsWith_pX
+    Given the modern graph
+    And using the parameter l1 defined as "c[{name = it.get().value('name'); name.startsWith('m') || name.startsWith('p')}]"
+    And the traversal of
+      """
+      g.V().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[peter]  |
+
+  Scenario: g_E_filterXfalseX
+    Given the modern graph
+    And using the parameter l1 defined as "c[false]"
+    And the traversal of
+      """
+      g.E().filter(l1)
+      """
+    When iterated to list
+    Then the result should be empty
+
+  Scenario: g_E_filterXtrueX
+    Given the modern graph
+    And using the parameter l1 defined as "c[true]"
+    And the traversal of
+      """
+      g.E().filter(l1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | e[marko-created->lop] |
+      | e[marko-knows->josh] |
+      | e[marko-knows->vadas] |
+      | e[peter-created->lop] |
+      | e[josh-created->lop] |
+      | e[josh-created->ripple] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8955981f/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 282d8a8..dba865b 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
@@ -75,6 +76,7 @@ public class FeatureCoverageTest {
                 // filter
                 CoinTest.class,
                 DropTest.class,
+                FilterTest.class,
                 IsTest.class,
                 OrTest.class,
                 // map


[24/50] tinkerpop git commit: TINKERPOP-1784 Added valueMap() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added valueMap() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0e229343
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0e229343
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0e229343

Branch: refs/heads/TINKERPOP-1784
Commit: 0e229343d9518a2a147eb34a822254202c221b14
Parents: 8282262
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 20 13:57:59 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/ValueMap.feature      | 59 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 2 files changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0e229343/gremlin-test/features/map/ValueMap.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/ValueMap.feature b/gremlin-test/features/map/ValueMap.feature
new file mode 100644
index 0000000..0a2220e
--- /dev/null
+++ b/gremlin-test/features/map/ValueMap.feature
@@ -0,0 +1,59 @@
+# 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 - valueMap()
+
+  Scenario: g_V_valueMap
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().valueMap()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"name": ["marko"], "age": [29]}] |
+      | m[{"name": ["josh"], "age": [32]}] |
+      | m[{"name": ["peter"], "age": [35]}] |
+      | m[{"name": ["vadas"], "age": [27]}] |
+      | m[{"name": ["lop"], "lang": ["java"]}] |
+      | m[{"name": ["ripple"], "lang": ["java"]}] |
+
+  Scenario: g_V_valueMapXname_ageX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().valueMap("name", "age")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"name": ["marko"], "age": [29]}] |
+      | m[{"name": ["josh"], "age": [32]}] |
+      | m[{"name": ["peter"], "age": [35]}] |
+      | m[{"name": ["vadas"], "age": [27]}] |
+      | m[{"name": ["lop"]}] |
+      | m[{"name": ["ripple"]}] |
+
+  Scenario: g_VX1X_outXcreatedX_valueMap
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("created").valueMap()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"name": ["lop"], "lang": ["java"]}] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0e229343/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index eb62f77..97f1fd6 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.ValueMapTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
@@ -78,6 +79,7 @@ public class FeatureCoverageTest {
                 CountTest.class,
                 PathTest.class,
                 ProjectTest.class,
+                ValueMapTest.class,
                 VertexTest.class,
                 // sideEffect
                 AggregateTest.class,


[06/50] tinkerpop git commit: TINKERPOP-1784 Added Choose tests to .feature files

Posted by sp...@apache.org.
TINKERPOP-1784 Added Choose tests to .feature files


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6d2d8355
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6d2d8355
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6d2d8355

Branch: refs/heads/TINKERPOP-1784
Commit: 6d2d835542a022baca0e6042a48e06811e73dfc2
Parents: 4a6772c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 11 10:52:15 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:19 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |   6 +-
 gremlin-test/features/branch/Choose.feature     | 118 +++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |   2 +
 3 files changed, 124 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d2d8355/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 68eeeaf..a34bb8d 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -25,6 +25,7 @@ from gremlin_python.process.traversal import P, Scope, Column, Order, Direction,
 from radish import given, when, then
 from hamcrest import *
 
+regex_and = re.compile(r"([(.,\s])and\(")
 regex_as = re.compile(r"([(.,\s])as\(")
 regex_in = re.compile(r"([(.,\s])in\(")
 regex_is = re.compile(r"([(.,\s])is\(")
@@ -66,7 +67,7 @@ def translate_traversal(step):
     if hasattr(step.context, "traversal_params"):
         b.update(step.context.traversal_params)
 
-    print __translate(step.text)
+    print __translate(step.text + " - " + str(b))
     step.context.traversal = eval(__translate(step.text), b)
 
 
@@ -118,7 +119,7 @@ def __convert(val, ctx):
         return ctx.lookup_e["modern"][val[2:-1]]
     elif isinstance(val, str) and re.match("^m\[.*\]$", val):         # parse json as a map
         return __convert(json.loads(val[2:-1]), ctx)
-    elif isinstance(val, str) and re.match("^c\[.*\]$", val):         # parse lambda
+    elif isinstance(val, str) and re.match("^c\[.*\]$", val):         # parse lambda/closure
         return lambda: (val[2:-1], "gremlin-groovy")
     else:
         return val
@@ -145,6 +146,7 @@ def __table_assertion(data, result, ctx, ordered):
 
 def __translate(traversal):
     replaced = traversal.replace("\n", "")
+    replaced = regex_and.sub(r"\1and_(", replaced)
     replaced = regex_as.sub(r"\1as_(", replaced)
     replaced = regex_is.sub(r"\1is_(", replaced)
     return regex_in.sub(r"\1in_(", replaced)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d2d8355/gremlin-test/features/branch/Choose.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Choose.feature b/gremlin-test/features/branch/Choose.feature
new file mode 100644
index 0000000..de70485
--- /dev/null
+++ b/gremlin-test/features/branch/Choose.feature
@@ -0,0 +1,118 @@
+# 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 - choose()
+
+  Scenario: g_V_chooseXout_countX_optionX2L__nameX_optionX3L__valueMapX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.out().count()).
+        option(2L, __.values("name")).
+        option(3L, __.valueMap())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"name":["marko"], "age":[29]}] |
+      | josh |
+
+  Scenario: g_V_chooseXlabel_eqXpersonX__outXknowsX__inXcreatedXX_name
+    Given the modern graph
+    And using the parameter l1 is "c[it.label() == 'person']"
+    And the traversal of
+      """
+      g.V().choose(l1, __.out("knows"), __.in("created")).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | josh |
+      | vadas |
+      | josh |
+      | josh |
+      | marko |
+      | peter |
+
+  Scenario: g_V_chooseXhasLabelXpersonX_and_outXcreatedX__outXknowsX__identityX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.hasLabel("person").and().out("created"),
+                   __.out("knows"),
+                   __.identity()).
+        values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | ripple |
+      | josh |
+      | vadas |
+      | vadas |
+
+  Scenario: g_V_chooseXlabelX_optionXblah__outXknowsXX_optionXbleep__outXcreatedXX_optionXnone__identityX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.label()).
+             option("blah", __.out("knows")).
+             option("bleep", __.out("created")).
+             option(Pick.none, __.identity()).
+        values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | vadas |
+      | peter |
+      | josh |
+      | lop |
+      | ripple |
+
+  Scenario: g_V_chooseXoutXknowsX_count_isXgtX0XX__outXknowsXX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.out("knows").count().is(P.gt(0)),
+                   __.out("knows")).
+        values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | vadas |
+      | josh |
+      | vadas |
+      | josh |
+      | peter |
+      | lop  |
+      | ripple |
+
+  Scenario: g_V_hasLabelXpersonX_asXp1X_chooseXoutEXknowsX__outXknowsXX_asXp2X_selectXp1_p2X_byXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("person").as("p1").
+        choose(__.outE("knows"), __.out("knows")).as("p2").
+        select("p1", "p2").
+          by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"p1":"marko", "p2":"vadas"}] |
+      | m[{"p1":"marko", "p2":"josh"}] |
+      | m[{"p1":"vadas", "p2":"vadas"}] |
+      | m[{"p1":"josh", "p2":"josh"}] |
+      | m[{"p1":"peter", "p2":"peter"}] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6d2d8355/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index be01613..4ee540e 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
@@ -58,6 +59,7 @@ public class FeatureCoverageTest {
         // TEMPORARY while test framework is under development - all tests should ultimately be included
         final List<Class<?>> temp = Arrays.asList(
                 BranchTest.class,
+                ChooseTest.class,
                 CoinTest.class,
                 CountTest.class,
                 GroupCountTest.class,


[14/50] tinkerpop git commit: TINKERPOP-1784 Added tests for store()

Posted by sp...@apache.org.
TINKERPOP-1784 Added tests for store()

Needed to account for floats vs longs with d[x]


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/366d9759
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/366d9759
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/366d9759

Branch: refs/heads/TINKERPOP-1784
Commit: 366d9759ea0a093a5a9f11041212ed0a694a0bc3
Parents: 90cdc0c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 18 15:30:16 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  4 +-
 gremlin-test/features/sideEffect/Store.feature  | 84 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  4 +-
 3 files changed, 90 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/366d9759/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 f348ccb..0d71f78 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -124,8 +124,10 @@ def _convert(val, ctx):
         return _convert(val.encode('utf-8'), ctx)
     elif isinstance(val, str) and re.match("^l\[.*\]$", val):         # parse list
         return list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
+    elif isinstance(val, str) and re.match("^s\[.*\]$", val):         # parse set
+        return set(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
     elif isinstance(val, str) and re.match("^d\[.*\]$", val):         # parse numeric
-        return long(val[2:-1])
+        return float(val[2:-1]) if val[2:-1].__contains__(".") else long(val[2:-1])
     elif isinstance(val, str) and re.match("^v\[.*\]\.id$", val):     # parse vertex id
         return ctx.lookup_v["modern"][val[2:-4]].id
     elif isinstance(val, str) and re.match("^v\[.*\]\.sid$", val):    # parse vertex id as string

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/366d9759/gremlin-test/features/sideEffect/Store.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Store.feature b/gremlin-test/features/sideEffect/Store.feature
new file mode 100644
index 0000000..ef66c5e
--- /dev/null
+++ b/gremlin-test/features/sideEffect/Store.feature
@@ -0,0 +1,84 @@
+# 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 - store()
+
+  Scenario: g_V_storeXa_nameX_out_capXaX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().store("a").by("name").out().cap("a")      
+      """
+    When iterated next
+    Then the result should be unordered
+      | marko |
+      | vadas |
+      | lop |
+      | josh |
+      | ripple |
+      | peter  |
+
+  Scenario: g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).store("a").by("name").out().store("a").by("name").values("name").cap("a")
+      """
+    When iterated next
+    Then the result should be unordered
+      | marko |
+      | vadas |
+      | lop |
+      | josh |
+
+  Scenario: g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter initial defined as "s[]"
+    And the traversal of
+      """
+      g.withSideEffect("a", initial).V().both().values("name").store("a").cap("a")
+      """
+    When iterated next
+    Then nothing should happen because
+      """
+      The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+      specifically it requires specification of a Set as a parameter which only becomes available in
+      GraphSON 3.0.
+      """
+
+  Scenario: g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().store("a").
+             by(__.outE("created").count()).
+        out().out().store("a").
+                      by(__.inE("created").values("weight").sum()).
+        cap("a")
+      """
+    When iterated next
+    Then the result should be unordered
+      | d[1] |
+      | d[1] |
+      | d[0] |
+      | d[0] |
+      | d[0] |
+      | d[2] |
+      | d[1.0] |
+      | d[1.0] |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/366d9759/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index d8ffc53..09344b4 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -30,6 +30,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest;
 import org.junit.Test;
 
 import java.io.BufferedReader;
@@ -79,7 +80,8 @@ public class FeatureCoverageTest {
                 // sideEffect
                 AggregateTest.class,
                 GroupCountTest.class,
-                InjectTest.class);
+                InjectTest.class,
+                StoreTest.class);
 
         final Field field = ProcessStandardSuite.class.getDeclaredField("testsToEnforce");
         field.setAccessible(true);


[10/50] tinkerpop git commit: TINKERPOP-1784 Added dedup() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added dedup() feature tests

Reworked test language for asserting counts so that it works better as a standalone assertion.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7307df06
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7307df06
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7307df06

Branch: refs/heads/TINKERPOP-1784
Commit: 7307df063a008299b160091032249e109dc9fe51
Parents: 0310a19
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 11:37:18 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |   2 +-
 gremlin-test/features/branch/Local.feature      |  12 +-
 gremlin-test/features/branch/Repeat.feature     |   2 +-
 gremlin-test/features/filter/Dedup.feature      | 222 +++++++++++++++++++
 4 files changed, 230 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7307df06/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 2d2ae8d..14a0153 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -112,7 +112,7 @@ def assert_side_effects(step, count, traversal_string):
     assert_that(count, equal_to(t.count().next()))
 
 
-@then("only have a result count of {count:d}")
+@then("should have a result count of {count:d}")
 def assert_count(step, count):
     assert_that(count, equal_to(len(step.context.result)))
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7307df06/gremlin-test/features/branch/Local.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Local.feature b/gremlin-test/features/branch/Local.feature
index 53ae3ab..fa12d8c 100644
--- a/gremlin-test/features/branch/Local.feature
+++ b/gremlin-test/features/branch/Local.feature
@@ -73,7 +73,7 @@ Feature: Step - local()
     Then the result should be of
       | vadas |
       | josh  |
-    And only have a result count of 1
+    And should have a result count of 1
 
   Scenario: g_V_localXbothEXcreatedX_limitX1XX_otherV_name
     Given the modern graph
@@ -88,7 +88,7 @@ Feature: Step - local()
       | ripple |
       | josh   |
       | peter  |
-    And only have a result count of 5
+    And should have a result count of 5
 
   Scenario: g_VX4X_localXbothEX1_createdX_limitX1XX
     Given the modern graph
@@ -101,7 +101,7 @@ Feature: Step - local()
     Then the result should be of
       | e[josh-created->lop]    |
       | e[josh-created->ripple] |
-    And only have a result count of 1
+    And should have a result count of 1
 
   Scenario: g_VX4X_localXbothEXknows_createdX_limitX1XX
     Given the modern graph
@@ -115,7 +115,7 @@ Feature: Step - local()
       | e[marko-knows->josh]    |
       | e[josh-created->lop]    |
       | e[josh-created->ripple] |
-    And only have a result count of 1
+    And should have a result count of 1
 
   Scenario: g_VX4X_localXbothE_limitX1XX_otherV_name
     Given the modern graph
@@ -129,7 +129,7 @@ Feature: Step - local()
       | marko  |
       | ripple |
       | lop    |
-    And only have a result count of 1
+    And should have a result count of 1
 
   Scenario: g_VX4X_localXbothE_limitX2XX_otherV_name
     Given the modern graph
@@ -143,7 +143,7 @@ Feature: Step - local()
       | marko  |
       | ripple |
       | lop    |
-    And only have a result count of 2
+    And should have a result count of 2
 
   Scenario: g_V_localXinEXknowsX_limitX2XX_outV_name
     Given the modern graph

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7307df06/gremlin-test/features/branch/Repeat.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Repeat.feature b/gremlin-test/features/branch/Repeat.feature
index e6049b5..6d97fc0 100644
--- a/gremlin-test/features/branch/Repeat.feature
+++ b/gremlin-test/features/branch/Repeat.feature
@@ -68,7 +68,7 @@ Feature: Step - repeat()
       | v[lop] |
       | v[josh] |
       | v[vadas] |
-    And only have a result count of 8
+    And should have a result count of 8
 
   Scenario: g_VX1X_timesX2X_repeatXoutX_name
     Given the modern graph

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7307df06/gremlin-test/features/filter/Dedup.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Dedup.feature b/gremlin-test/features/filter/Dedup.feature
new file mode 100644
index 0000000..7433da2
--- /dev/null
+++ b/gremlin-test/features/filter/Dedup.feature
@@ -0,0 +1,222 @@
+# 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 - dedup()
+
+  Scenario: g_V_out_in_valuesXnameX_fold_dedupXlocalX_unfold
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().out().in().values("name").fold().dedup(Scope.local).unfold()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | josh  |
+      | peter |
+
+  Scenario: g_V_out_asXxX_in_asXyX_selectXx_yX_byXnameX_fold_dedupXlocal_x_yX_unfold
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().out().as("x").in().as("y").select("x", "y").by("name").fold().dedup(Scope.local, "x", "y").unfold()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"x":"lop","y":"marko"}] |
+      | m[{"x":"lop","y":"josh"}] |
+      | m[{"x":"lop","y":"peter"}] |
+      | m[{"x":"vadas","y":"marko"}] |
+      | m[{"x":"josh","y":"marko"}] |
+      | m[{"x":"ripple","y":"josh"}] |
+
+  Scenario: g_V_both_dedup_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().both().dedup().values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | vadas |
+      | josh  |
+      | peter |
+      | marko |
+      | ripple |
+
+  Scenario: g_V_both_hasXlabel_softwareX_dedup_byXlangX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().both().has(T.label, "software").dedup().by("lang").values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+
+  Scenario: g_V_both_name_order_byXa_bX_dedup_value
+    Given the modern graph
+    And using the parameter l defined as "c[a,b -> a.value().compareTo(b.value())]"
+    And the traversal of
+      """
+      g.V().both().properties("name").order().by(l).dedup().value()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | josh |
+      | lop  |
+      | marko |
+      | peter |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_both_both_name_dedup
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().both().both().values("name").dedup()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | josh |
+      | lop  |
+      | marko |
+      | peter |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_both_both_dedup
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().both().both().dedup()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[josh] |
+      | v[lop]  |
+      | v[marko] |
+      | v[peter] |
+      | v[ripple] |
+      | v[vadas]  |
+
+  Scenario: g_V_both_both_dedup_byXlabelX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().both().both().dedup().by(T.label)
+      """
+    When iterated to list
+    Then should have a result count of 2
+
+  Scenario: g_V_group_byXlabelX_byXbothE_weight_dedup_foldX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by(T.label).by(__.bothE().values("weight").dedup().fold())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"software":[1.0,0.4,0.2],"person":[0.5,1.0,0.4,0.2]}] |
+
+  Scenario: g_V_asXaX_both_asXbX_dedupXa_bX_byXlabelX_selectXa_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").both().as("b").dedup("a", "b").by(T.label).select("a", "b")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"a":"v[marko]","b":"v[lop]"}] |
+      | m[{"a":"v[marko]","b":"v[vadas]"}] |
+      | m[{"a":"v[lop]","b":"v[marko]"}] |
+
+  Scenario: g_V_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_dedupXa_bX_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out("created").as("b").in("created").as("c").dedup("a", "b").path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[lop],v[marko]] |
+      | p[v[josh],v[ripple],v[josh]] |
+      | p[v[josh],v[lop],v[marko]] |
+      | p[v[peter],v[lop],v[marko]] |
+
+  Scenario: g_V_outE_asXeX_inV_asXvX_selectXeX_order_byXweight_incrX_selectXvX_valuesXnameX_dedup
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().outE().as("e").inV().as("v").select("e").order().by("weight", Order.incr).select("v").values("name").dedup()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | vadas |
+      | josh |
+      | ripple |
+
+  Scenario: g_V_both_both_dedup_byXoutE_countX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().both().both().dedup().by(__.outE().count()).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | josh |
+      | peter |
+      | ripple |
+
+  Scenario: g_V_groupCount_selectXvaluesX_unfold_dedup
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().groupCount().select(Column.values).unfold().dedup()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[1] |
+
+  Scenario: g_V_asXaX_repeatXbothX_timesX3X_emit_name_asXbX_group_byXselectXaXX_byXselectXbX_dedup_order_foldX_selectXvaluesX_unfold_dedup
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").repeat(__.both()).times(3).emit().values("name").as("b").group().by(__.select("a")).by(__.select("b").dedup().order().fold()).select(Column.values).unfold().dedup()
+      """
+    When iterated next
+    Then the result should be unordered
+      | josh |
+      | lop  |
+      | marko |
+      | peter |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_repeatXdedupX_timesX2X_count
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.dedup()).times(2).count()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[0] |
+


[08/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for cyclicPath()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for cyclicPath()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0310a197
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0310a197
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0310a197

Branch: refs/heads/TINKERPOP-1784
Commit: 0310a197616c53947e90a0daab2c8d4546184e7d
Parents: 1ac72a9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 10:24:40 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/CyclicPath.feature | 50 ++++++++++++++++++++
 1 file changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0310a197/gremlin-test/features/filter/CyclicPath.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/CyclicPath.feature b/gremlin-test/features/filter/CyclicPath.feature
new file mode 100644
index 0000000..d07e4ad
--- /dev/null
+++ b/gremlin-test/features/filter/CyclicPath.feature
@@ -0,0 +1,50 @@
+# 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 - cyclicPath()
+
+  Scenario: g_VX1X_outXcreatedX_inXcreatedX_cyclicPath
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("created").in("created").cyclicPath()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+
+  Scenario: g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("created").in("created").cyclicPath().path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[lop],v[marko]] |
+
+  Scenario: g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).as("a").out("created").as("b").in("created").as("c").cyclicPath().from("a").to("b").path()
+      """
+    When iterated to list
+    Then the result should be empty


[39/50] tinkerpop git commit: TINKERPOP-1784 Added mean() feature test

Posted by sp...@apache.org.
TINKERPOP-1784 Added mean() feature test


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d5548615
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d5548615
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d5548615

Branch: refs/heads/TINKERPOP-1784
Commit: d55486156c495baa401089236b2510a78ffcaea0
Parents: 4923c24
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 13:38:55 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Mean.feature | 40 +++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d5548615/gremlin-test/features/map/Mean.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Mean.feature b/gremlin-test/features/map/Mean.feature
new file mode 100644
index 0000000..22fab7d
--- /dev/null
+++ b/gremlin-test/features/map/Mean.feature
@@ -0,0 +1,40 @@
+# 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 - mean()
+
+  Scenario: g_V_age_mean
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").mean()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[30.75] |
+
+  Scenario: g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_meanX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("software").group().by("name").by(__.bothE().values("weight").mean())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":1.0,"lop":0.3333333333333333}] |
\ No newline at end of file


[33/50] tinkerpop git commit: TINKERPOP-1784 Added tail() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added tail() feature tests

Added fixes to python test logic for the reserved global keyword and fixed ordering test logic a bit.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/18a178a0
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/18a178a0
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/18a178a0

Branch: refs/heads/TINKERPOP-1784
Commit: 18a178a044215135862beb09ea230b7e891599ec
Parents: be1fe03
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 12:05:57 2017 -0500
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/filter/Tail.feature       | 166 +++++++++++++++++++
 2 files changed, 171 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/18a178a0/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 dae6361a..6c72bf1 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -28,6 +28,7 @@ from hamcrest import *
 regex_and = re.compile(r"([(.,\s])and\(")
 regex_as = re.compile(r"([(.,\s])as\(")
 regex_from = re.compile(r"([(.,\s])from\(")
+regex_global = re.compile(r"([(.,\s])global")
 regex_in = re.compile(r"([(.,\s])in\(")
 regex_is = re.compile(r"([(.,\s])is\(")
 regex_not = re.compile(r"([(.,\s])not\(")
@@ -193,15 +194,17 @@ def _table_assertion(data, result, ctx, ordered):
             assert_that(results_to_test[ix], equal_to(val))
         else:
             assert_that(val, is_in(results_to_test))
-        results_to_test.remove(val)
+            results_to_test.remove(val)
 
-    assert_that(len(results_to_test), is_(0))
+    if not ordered:
+        assert_that(len(results_to_test), is_(0))
 
 
 def _translate(traversal):
     replaced = traversal.replace("\n", "")
     replaced = regex_and.sub(r"\1and_(", replaced)
     replaced = regex_from.sub(r"\1from_(", replaced)
+    replaced = regex_global.sub(r"\1global_", replaced)
     replaced = regex_as.sub(r"\1as_(", replaced)
     replaced = regex_is.sub(r"\1is_(", replaced)
     replaced = regex_not.sub(r"\1not_(", replaced)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/18a178a0/gremlin-test/features/filter/Tail.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Tail.feature b/gremlin-test/features/filter/Tail.feature
new file mode 100644
index 0000000..35083ef
--- /dev/null
+++ b/gremlin-test/features/filter/Tail.feature
@@ -0,0 +1,166 @@
+# 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 - tail()
+
+  Scenario: g_V_valuesXnameX_order_tailXglobal_2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("name").order().tail(Scope.global, 2)
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | ripple |
+      | vadas |
+
+  Scenario: g_V_valuesXnameX_order_tailX2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("name").order().tail(2)
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | ripple |
+      | vadas |
+
+  Scenario: g_V_valuesXnameX_order_tail
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("name").order().tail()
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | vadas |
+
+  Scenario: g_V_valuesXnameX_order_tailX7X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("name").order().tail(7)
+      """
+    When iterated to list
+    Then the result should be ordered
+      | result |
+      | josh   |
+      | lop    |
+      | marko  |
+      | peter  |
+      | ripple |
+      | vadas  |
+
+  Scenario: g_V_repeatXbothX_timesX3X_tailX7X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.both()).times(3).tail(7)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | v[peter] |
+      | v[peter] |
+      | v[peter] |
+      | v[peter] |
+      | v[marko] |
+      | v[marko] |
+      | v[marko] |
+
+  Scenario: g_V_repeatXin_outX_timesX3X_tailX7X_count
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.in().out()).times(3).tail(7).count()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[7] |
+
+  Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("a").out().as("a").select("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] |
+
+  Scenario: g_V_asXaX_out_asXaX_out_asXaX_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocal_1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("a").out().as("a").select("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_selectXaX_byXunfold_valuesXnameX_foldX_tailXlocalX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("a").out().as("a").select("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_selectXaX_byXlimitXlocal_0XX_tailXlocal_1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("a").out().as("a").select("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_asXbX_out_asXcX_selectXa_b_cX_byXnameX_tailXlocal_2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("b").out().as("c").select("a","b","c").by("name").tail(Scope.local, 2)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"b":"josh","c":"ripple"}] |
+      | m[{"b":"josh","c":"lop"}] |
+
+  Scenario: g_V_asXaX_out_asXbX_out_asXcX_selectXa_b_cX_byXnameX_tailXlocal_1X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out().as("b").out().as("c").select("a","b","c").by("name").tail(Scope.local, 1)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"c":"ripple"}] |
+      | m[{"c":"lop"}] |
\ No newline at end of file


[09/50] tinkerpop git commit: TINKERPOP-1784 Added and() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added and() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1ac72a95
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1ac72a95
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1ac72a95

Branch: refs/heads/TINKERPOP-1784
Commit: 1ac72a95fde90c5529d096e3ace548fdab60ee8b
Parents: fc1ed8a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 10:14:09 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/And.feature | 65 +++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1ac72a95/gremlin-test/features/filter/And.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/And.feature b/gremlin-test/features/filter/And.feature
new file mode 100644
index 0000000..c47ec6e
--- /dev/null
+++ b/gremlin-test/features/filter/And.feature
@@ -0,0 +1,65 @@
+# 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 - and()
+
+  Scenario: g_V_andXhasXage_gt_27X__outE_count_gte_2X_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().and(__.has("age", P.gt(27)), __.outE().count().is(P.gte(2))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | josh |
+
+  Scenario: g_V_andXoutE__hasXlabel_personX_and_hasXage_gte_32XX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().and(__.outE(), __.has(T.label, "person").and().has("age", P.gte(32))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | josh |
+      | peter  |
+
+  Scenario: g_V_asXaX_outXknowsX_and_outXcreatedX_inXcreatedX_asXaX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out("knows").and().out("created").in("created").as("a").values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+
+  Scenario: g_V_asXaX_andXselectXaX_selectXaXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").and(__.select("a"), __.select("a"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+      | v[vadas] |
+      | v[lop] |
+      | v[josh] |
+      | v[ripple] |
+      | v[peter]  |
\ No newline at end of file


[12/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for simplePath()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for simplePath()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ce0fd3ca
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ce0fd3ca
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ce0fd3ca

Branch: refs/heads/TINKERPOP-1784
Commit: ce0fd3cafb3d559f536883b23f10757f8498392e
Parents: e7c8835
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 12:46:26 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/SimplePath.feature | 69 ++++++++++++++++++++
 1 file changed, 69 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ce0fd3ca/gremlin-test/features/filter/SimplePath.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/SimplePath.feature b/gremlin-test/features/filter/SimplePath.feature
new file mode 100644
index 0000000..c8091af
--- /dev/null
+++ b/gremlin-test/features/filter/SimplePath.feature
@@ -0,0 +1,69 @@
+# 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 - simplePath()
+
+  Scenario: g_VX1X_outXcreatedX_inXcreatedX_simplePath
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).out("created").in("created").simplePath()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[josh] |
+      | v[peter] |
+
+  Scenario: get_g_V_repeatXboth_simplePathX_timesX3X_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.both().simplePath()).times(3).path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[lop],v[josh],v[ripple]] |
+      | p[v[marko],v[josh],v[lop],v[peter]] |
+      | p[v[vadas],v[marko],v[lop],v[josh]] |
+      | p[v[vadas],v[marko],v[lop],v[peter]] |
+      | p[v[vadas],v[marko],v[josh],v[ripple]] |
+      | p[v[vadas],v[marko],v[josh],v[lop]] |
+      | p[v[lop],v[marko],v[josh],v[ripple]] |
+      | p[v[lop],v[josh],v[marko],v[vadas]] |
+      | p[v[josh],v[lop],v[marko],v[vadas]] |
+      | p[v[josh],v[marko],v[lop],v[peter]] |
+      | p[v[ripple],v[josh],v[lop],v[marko]] |
+      | p[v[ripple],v[josh],v[lop],v[peter]] |
+      | p[v[ripple],v[josh],v[marko],v[lop]] |
+      | p[v[ripple],v[josh],v[marko],v[vadas]] |
+      | p[v[peter],v[lop],v[marko],v[vadas]] |
+      | p[v[peter],v[lop],v[marko],v[josh]] |
+      | p[v[peter],v[lop],v[josh],v[ripple]] |
+      | p[v[peter],v[lop],v[josh],v[marko]] |
+
+  Scenario: get_g_V_asXaX_out_asXbX_out_asXcX_simplePath_byXlabelX_fromXbX_toXcX_path_byXnameX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V().as("a").out().as("b").out().as("c").simplePath().by(T.label).from("b").to("c").path().by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[marko,josh,ripple] |
+      | p[marko,josh,lop]    |


[48/50] tinkerpop git commit: TINKERPOP-1784 Removed the linejump option to clean up output to console

Posted by sp...@apache.org.
TINKERPOP-1784 Removed the linejump option to clean up output to console


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4f17a8ab
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4f17a8ab
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4f17a8ab

Branch: refs/heads/TINKERPOP-1784
Commit: 4f17a8ab660c7b83b4ab070bab3e5c1f05eb0480
Parents: e1a67f1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 15:27:45 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:47 2017 -0500

----------------------------------------------------------------------
 gremlin-python/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4f17a8ab/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index 67cc35b..d1a4a76 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -449,7 +449,7 @@ limitations under the License.
                                         <exec executable="env/bin/radish" dir="${project.build.directory}/python2"
                                               failonerror="true">
                                             <env key="PYTHONPATH" value=""/>
-                                            <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/ --no-line-jump"/> <!-- -no-line-jump -->
+                                            <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/"/> <!-- -no-line-jump -->
                                         </exec>                                                                  
                                     </target>
                                 </configuration>


[25/50] tinkerpop git commit: TINKERPOP-1784 Added local() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added local() feature tests

Had to add a way to assert a results that matched any in a set as limit() type steps might force different results depending on the graph being tested.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/51fc4d7b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/51fc4d7b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/51fc4d7b

Branch: refs/heads/TINKERPOP-1784
Commit: 51fc4d7b5b824f6f1a8218ae0636c3d505f36c42
Parents: 8955981
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Oct 23 10:00:34 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  23 ++-
 gremlin-test/features/branch/Local.feature      | 172 +++++++++++++++++++
 2 files changed, 191 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/51fc4d7b/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 f58f0da..2d2ae8d 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -34,7 +34,9 @@ regex_not = re.compile(r"([(.,\s])not\(")
 regex_or = re.compile(r"([(.,\s])or\(")
 
 
-ignores = ["g.V(v1Id).out().inject(v2).values(\"name\")"]
+ignores = [
+    "g.V(v1Id).out().inject(v2).values(\"name\")"  # bug in attachment won't connect v2
+           ]
 
 
 @given("the {graph_name:w} graph")
@@ -89,12 +91,14 @@ def assert_result(step, characterized_as):
     if step.context.ignore:
         return
 
-    if characterized_as == "empty":
+    if characterized_as == "empty":        # no results
         assert_that(len(step.context.result), equal_to(0))
-    elif characterized_as == "ordered":
+    elif characterized_as == "ordered":    # results asserted in the order of the data table
         _table_assertion(step.table, step.context.result, step.context, True)
-    elif characterized_as == "unordered":
+    elif characterized_as == "unordered":  # results asserted in any order
         _table_assertion(step.table, step.context.result, step.context, False)
+    elif characterized_as == "of":         # results may be of any of the specified items in the data table
+        _any_assertion(step.table, step.context.result, step.context)
     else:
         raise ValueError("unknown data characterization of " + characterized_as)
 
@@ -108,6 +112,11 @@ def assert_side_effects(step, count, traversal_string):
     assert_that(count, equal_to(t.count().next()))
 
 
+@then("only have a result count of {count:d}")
+def assert_count(step, count):
+    assert_that(count, equal_to(len(step.context.result)))
+
+
 @then("nothing should happen because")
 def nothing_happening(step):
     return
@@ -158,6 +167,12 @@ def _convert_results(val):
         return val
 
 
+def _any_assertion(data, result, ctx):
+    converted = [_convert(line[0], ctx) for line in data]
+    for r in result:
+        assert_that(r, is_in(converted))
+
+
 def _table_assertion(data, result, ctx, ordered):
     # results from traversal should have the same number of entries as the feature data table
     assert_that(len(result), equal_to(len(data)))

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/51fc4d7b/gremlin-test/features/branch/Local.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Local.feature b/gremlin-test/features/branch/Local.feature
new file mode 100644
index 0000000..53ae3ab
--- /dev/null
+++ b/gremlin-test/features/branch/Local.feature
@@ -0,0 +1,172 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contriAndor license agreements.  See the NOTICE file
+# distriAnded 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 distriAnded under the License is distriAnded 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 - local()
+
+  Scenario: g_V_localXpropertiesXlocationX_order_byXvalueX_limitX2XX_value
+    Given the crew graph
+    And the traversal of
+      """
+      g.V().local(__.properties("location").order().by(T.value, Order.incr).range(0, 2)).value()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | brussels       |
+      | san diego      |
+      | centreville    |
+      | dulles         |
+      | baltimore      |
+      | bremen         |
+      | aachen         |
+      | kaiserslautern |
+
+  Scenario: g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has(T.label, "person").as("a").local(__.out("created").as("b")).select("a", "b").by("name").by(T.id)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"a":"marko","b":3}] |
+      | m[{"a":"josh","b":5}]  |
+      | m[{"a":"josh","b":3}]  |
+      | m[{"a":"peter","b":3}] |
+
+  Scenario: g_V_localXoutE_countX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.outE().count())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[3] |
+      | d[0] |
+      | d[0] |
+      | d[2] |
+      | d[0] |
+      | d[1] |
+
+  Scenario: g_VX1X_localXoutEXknowsX_limitX1XX_inV_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).local(__.outE("knows").limit(1)).inV().values("name")
+      """
+    When iterated to list
+    Then the result should be of
+      | vadas |
+      | josh  |
+    And only have a result count of 1
+
+  Scenario: g_V_localXbothEXcreatedX_limitX1XX_otherV_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.bothE("created").limit(1)).otherV().values("name")
+      """
+    When iterated to list
+    Then the result should be of
+      | marko  |
+      | lop    |
+      | ripple |
+      | josh   |
+      | peter  |
+    And only have a result count of 5
+
+  Scenario: g_VX4X_localXbothEX1_createdX_limitX1XX
+    Given the modern graph
+    And using the parameter v4Id defined as "v[josh].id"
+    And the traversal of
+      """
+      g.V(v4Id).local(__.bothE("created").limit(1))
+      """
+    When iterated to list
+    Then the result should be of
+      | e[josh-created->lop]    |
+      | e[josh-created->ripple] |
+    And only have a result count of 1
+
+  Scenario: g_VX4X_localXbothEXknows_createdX_limitX1XX
+    Given the modern graph
+    And using the parameter v4Id defined as "v[josh].id"
+    And the traversal of
+      """
+      g.V(v4Id).local(__.bothE("knows", "created").limit(1))
+      """
+    When iterated to list
+    Then the result should be of
+      | e[marko-knows->josh]    |
+      | e[josh-created->lop]    |
+      | e[josh-created->ripple] |
+    And only have a result count of 1
+
+  Scenario: g_VX4X_localXbothE_limitX1XX_otherV_name
+    Given the modern graph
+    And using the parameter v4Id defined as "v[josh].id"
+    And the traversal of
+      """
+      g.V(v4Id).local(__.bothE().limit(1)).otherV().values("name")
+      """
+    When iterated to list
+    Then the result should be of
+      | marko  |
+      | ripple |
+      | lop    |
+    And only have a result count of 1
+
+  Scenario: g_VX4X_localXbothE_limitX2XX_otherV_name
+    Given the modern graph
+    And using the parameter v4Id defined as "v[josh].id"
+    And the traversal of
+      """
+      g.V(v4Id).local(__.bothE().limit(2)).otherV().values("name")
+      """
+    When iterated to list
+    Then the result should be of
+      | marko  |
+      | ripple |
+      | lop    |
+    And only have a result count of 2
+
+  Scenario: g_V_localXinEXknowsX_limitX2XX_outV_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.inE("knows").limit(2)).outV().values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | marko |
+
+  Scenario: g_V_localXmatchXproject__created_person__person_name_nameX_selectXname_projectX_by_byXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().local(__.match(
+                    __.as("project").in("created").as("person"),
+                    __.as("person").values("name").as("name"))).select("name", "project").by().by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"name":"marko","project":"lop"}]   |
+      | m[{"name":"josh","project":"lop"}]    |
+      | m[{"name":"peter","project":"lop"}]   |
+      | m[{"name":"josh","project":"ripple"}] |
\ No newline at end of file


[21/50] tinkerpop git commit: TINKERPOP-1784 Add union() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Add union() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/379ef9fd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/379ef9fd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/379ef9fd

Branch: refs/heads/TINKERPOP-1784
Commit: 379ef9fdd81070047ad4072c262adc00863d9c1a
Parents: 51fc4d7
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Oct 23 10:58:36 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/branch/Union.feature | 133 ++++++++++++++++++++++++
 1 file changed, 133 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/379ef9fd/gremlin-test/features/branch/Union.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Union.feature b/gremlin-test/features/branch/Union.feature
new file mode 100644
index 0000000..938f51a
--- /dev/null
+++ b/gremlin-test/features/branch/Union.feature
@@ -0,0 +1,133 @@
+# 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 - union()
+
+  Scenario: g_V_unionXout__inX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().union(__.out(), __.in()).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | vadas |
+      | josh |
+      | marko |
+      | marko |
+      | josh |
+      | peter |
+      | ripple |
+      | lop |
+      | marko |
+      | josh |
+      | lop |
+
+  Scenario: g_VX1X_unionXrepeatXoutX_timesX2X__outX_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).union(__.repeat(__.out()).times(2), __.out()).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | ripple |
+      | lop |
+      | lop   |
+      | vadas |
+      | josh  |
+
+  Scenario: g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.label().is("person"), __.union(__.out().values("lang"), __.out().values("name")), __.in().label())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | java   |
+      | lop    |
+      | vadas  |
+      | josh   |
+      | person |
+      | person |
+      | person |
+      | java   |
+      | java   |
+      | ripple |
+      | lop    |
+      | person |
+      | java   |
+      | lop    |
+
+  Scenario: g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX_groupCount
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().choose(__.label().is("person"), __.union(__.out().values("lang"), __.out().values("name")), __.in().label()).groupCount()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"java":4,"ripple":1,"person":4,"vadas":1,"josh":1,"lop":3}] |
+
+  Scenario: g_V_unionXrepeatXunionXoutXcreatedX__inXcreatedXX_timesX2X__repeatXunionXinXcreatedX__outXcreatedXX_timesX2XX_label_groupCount
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().union(__.repeat(__.union(
+                            __.out("created"),
+                            __.in("created"))).times(2),
+                  __.repeat(__.union(
+                            __.in("created"),
+                            __.out("created"))).times(2)).label().groupCount()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"software":12,"person":20}] |
+
+  Scenario: g_VX1_2X_unionXoutE_count__inE_count__outE_weight_sumX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v2Id defined as "v[vadas].id"
+    And the traversal of
+      """
+      g.V(v1Id, v2Id).union(__.outE().count(), __.inE().count(), __.outE().values("weight").sum())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[3]   |
+      | d[1.9] |
+      | d[1]   |
+
+  Scenario: get_g_VX1_2X_localXunionXoutE_count__inE_count__outE_weight_sumXX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter v2Id defined as "v[vadas].id"
+    And the traversal of
+      """
+      g.V(v1Id, v2Id).local(__.union(__.outE().count(), __.inE().count(), __.outE().values("weight").sum()))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[3]   |
+      | d[0]   |
+      | d[1.9] |
+      | d[0]   |
+      | d[0]   |
+      | d[1]   |
\ No newline at end of file


[03/50] tinkerpop git commit: TINKERPOP-1784 Define traversals without shorthand

Posted by sp...@apache.org.
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/39b84171
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/39b84171
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/39b84171

Branch: refs/heads/TINKERPOP-1784
Commit: 39b8417185292e6f7fb0e3c099439a6d7da94ae8
Parents: 918a56e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 10 15:18:55 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:19 2017 -0500

----------------------------------------------------------------------
 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/39b84171/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/39b84171/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/39b84171/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/39b84171/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/39b84171/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


[35/50] tinkerpop git commit: TINKERPOP-1784 Renamed loops() feature test to match the step name

Posted by sp...@apache.org.
TINKERPOP-1784 Renamed loops() feature test to match the step name


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4923c24f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4923c24f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4923c24f

Branch: refs/heads/TINKERPOP-1784
Commit: 4923c24fafcf03907faa95d7994c17587c48da7c
Parents: 0da5bb0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 12:56:34 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Loop.feature  | 68 ----------------------------
 gremlin-test/features/map/Loops.feature | 68 ++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 68 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4923c24f/gremlin-test/features/map/Loop.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Loop.feature b/gremlin-test/features/map/Loop.feature
deleted file mode 100644
index efd439f..0000000
--- a/gremlin-test/features/map/Loop.feature
+++ /dev/null
@@ -1,68 +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.
-
-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/4923c24f/gremlin-test/features/map/Loops.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Loops.feature b/gremlin-test/features/map/Loops.feature
new file mode 100644
index 0000000..b8a70ae
--- /dev/null
+++ b/gremlin-test/features/map/Loops.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 - loops()
+
+  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 |


[31/50] tinkerpop git commit: TINKERPOP-1784 Added where() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added where() feature tests

This is not complete, but it is enough for now.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/96dd07c2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/96dd07c2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/96dd07c2

Branch: refs/heads/TINKERPOP-1784
Commit: 96dd07c217ee017c3cebfedec57b0213218803c8
Parents: 18a178a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 12:35:04 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Where.feature | 105 ++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/96dd07c2/gremlin-test/features/filter/Where.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Where.feature b/gremlin-test/features/filter/Where.feature
new file mode 100644
index 0000000..5c520da
--- /dev/null
+++ b/gremlin-test/features/filter/Where.feature
@@ -0,0 +1,105 @@
+# 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 - where()
+
+  Scenario: g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_eqXbXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("age").as("a").out().in().has("age").as("b").select("a", "b").where("a", P.eq("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[marko]"}] |
+      | m[{"a":"v[marko]","b":"v[marko]"}] |
+      | m[{"a":"v[marko]","b":"v[marko]"}] |
+      | m[{"a":"v[josh]","b":"v[josh]"}] |
+      | m[{"a":"v[josh]","b":"v[josh]"}] |
+      | m[{"a":"v[peter]","b":"v[peter]"}] |
+
+  Scenario: g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_neqXbXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("age").as("a").out().in().has("age").as("b").select("a", "b").where("a", P.neq("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[josh]"}] |
+      | m[{"a":"v[marko]","b":"v[peter]"}] |
+      | m[{"a":"v[josh]","b":"v[marko]"}] |
+      | m[{"a":"v[josh]","b":"v[peter]"}] |
+      | m[{"a":"v[peter]","b":"v[marko]"}] |
+      | m[{"a":"v[peter]","b":"v[josh]"}] |
+
+  Scenario: g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXb_hasXname_markoXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("age").as("a").out().in().has("age").as("b").select("a", "b").where(__.as("b").has("name", "marko"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[marko]"}] |
+      | m[{"a":"v[marko]","b":"v[marko]"}] |
+      | m[{"a":"v[marko]","b":"v[marko]"}] |
+      | m[{"a":"v[josh]","b":"v[marko]"}] |
+      | m[{"a":"v[peter]","b":"v[marko]"}] |
+
+  Scenario: g_V_hasXageX_asXaX_out_in_hasXageX_asXbX_selectXa_bX_whereXa_outXknowsX_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("age").as("a").out().in().has("age").as("b").select("a", "b").where(__.as("a").out("knows").as("b"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"a":"v[marko]","b":"v[josh]"}] |
+
+  Scenario: g_V_asXaX_outXcreatedX_whereXasXaX_name_isXjoshXX_inXcreatedX_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").out("created").where(__.as("a").values("name").is("josh")).in("created").values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | josh |
+      | josh |
+      | marko |
+      | peter |
+
+  Scenario: g_withSideEffectXa_josh_peterX_VX1X_outXcreatedX_inXcreatedX_name_whereXwithinXaXX
+    Given the modern graph
+    And using the parameter l defined as "l[josh,peter]"
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.withSideEffect("a", l).V(v1Id).out("created").in("created").values("name").where(P.within("a"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | josh |
+      | peter |
+


[29/50] tinkerpop git commit: TINKERPOP-1784 Add more tests for group() and cap()

Posted by sp...@apache.org.
TINKERPOP-1784 Add more tests for group() and cap()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/a8983223
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a8983223
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a8983223

Branch: refs/heads/TINKERPOP-1784
Commit: a8983223067dd39f175867d49fd2062fc0729525
Parents: e90faa1
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 31 09:23:22 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |   2 +-
 gremlin-test/features/sideEffect/Group.feature  | 244 +++++++++++++++++++
 .../features/sideEffect/SideEffectCap.feature   |  38 +++
 3 files changed, 283 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8983223/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 b48b7ef..b8b31ce 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -149,7 +149,7 @@ def _convert(val, ctx):
     elif isinstance(val, str) and re.match("^e\[.*\]$", val):         # parse edge
         return ctx.lookup_e["modern"][val[2:-1]]
     elif isinstance(val, str) and re.match("^m\[.*\]$", val):         # parse json as a map
-        return _convert(json.loads(val[2:-1]), ctx)
+        return _convert(json.loads(val[2:-1].replace('\\"', '"')), ctx)
     elif isinstance(val, str) and re.match("^p\[.*\]$", val):         # parse path
         path_objects = list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
         return Path([set([])], path_objects)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8983223/gremlin-test/features/sideEffect/Group.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Group.feature b/gremlin-test/features/sideEffect/Group.feature
new file mode 100644
index 0000000..9ba57ec
--- /dev/null
+++ b/gremlin-test/features/sideEffect/Group.feature
@@ -0,0 +1,244 @@
+# 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 - group()
+
+  Scenario: g_V_group_byXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":"l[v[ripple]]", "peter":"l[v[peter]]", "vadas":"l[v[vadas]]", "josh": "l[v[josh]]", "lop":"l[v[lop]]", "marko":"l[v[marko]]"}] |
+
+  Scenario: g_V_group_byXnameX_by
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by("name").by()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":"l[v[ripple]]", "peter":"l[v[peter]]", "vadas":"l[v[vadas]]", "josh": "l[v[josh]]", "lop":"l[v[lop]]", "marko":"l[v[marko]]"}] |
+
+  Scenario: g_V_groupXaX_byXnameX_capXaX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group("a").by("name").cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":"l[v[ripple]]", "peter":"l[v[peter]]", "vadas":"l[v[vadas]]", "josh": "l[v[josh]]", "lop":"l[v[lop]]", "marko":"l[v[marko]]"}] |
+
+  Scenario: g_V_hasXlangX_groupXaX_byXlangX_byXnameX_out_capXaX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("lang").group("a").by("lang").by("name").out().cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"java":["lop","ripple"]}] |
+
+  Scenario: g_V_hasXlangX_group_byXlangX_byXcountX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("lang").group().by("lang").by(__.count())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"java":2}] |
+
+  Scenario: g_V_repeatXout_groupXaX_byXnameX_byXcountX_timesX2X_capXaX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.out().group("a").by("name").by(__.count())).times(2).cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":2, "vadas":1, "josh":1, "lop":4}] |
+
+  Scenario: g_V_group_byXoutE_countX_byXnameX
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+      specifically it has numeric keys which basically get toString()'d under GraphSON 2.x. This test can be supported
+      with GraphSON 3.x.
+      """
+
+  Scenario: g_V_groupXaX_byXlabelX_byXoutE_weight_sumX_capXaX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group("a").by(T.label).by(__.outE().values("weight").sum()).cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"software":0, "person":3.5}] |
+
+  Scenario: g_V_repeatXbothXfollowedByXX_timesX2X_group_byXsongTypeX_byXcountX
+    Given the grateful graph
+    And the traversal of
+      """
+      g.V().repeat(__.both("followedBy")).times(2).group().by("songType").by(__.count())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"original":771317, "":160968, "cover":368579}] |
+
+  Scenario: g_V_repeatXbothXfollowedByXX_timesX2X_groupXaX_byXsongTypeX_byXcountX_capXaX
+    Given the grateful graph
+    And the traversal of
+      """
+      g.V().repeat(__.both("followedBy")).times(2).group("a").by("songType").by(__.count()).cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"original":771317, "":160968, "cover":368579}] |
+
+  Scenario: g_V_group_byXname_substring_1X_byXconstantX1XX
+    Given the modern graph
+    And using the parameter l1 defined as "c[it.value('name').substring(0, 1)]"
+    And the traversal of
+      """
+      g.V().group().by(l1).by(__.constant(1))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"p":1, "r":1, "v":1, "j":1, "l":1, "m":1}] |
+
+  Scenario: g_V_groupXaX_byXname_substring_1X_byXconstantX1XX_capXaX
+    Given the modern graph
+    And using the parameter l1 defined as "c[it.value('name').substring(0, 1)]"
+    And the traversal of
+      """
+      g.V().group("a").by(l1).by(__.constant(1)).cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"p":1, "r":1, "v":1, "j":1, "l":1, "m":1}] |
+
+  Scenario: g_V_out_group_byXlabelX_selectXpersonX_unfold_outXcreatedX_name_limitX2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().out().group().by(T.label).select("person").unfold().out("created").values("name").limit(2)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | ripple |
+      | lop |
+
+  # TODO: can we change the traversal to allow for a better assertion
+  Scenario: g_V_hasLabelXsongX_group_byXnameX_byXproperties_groupCount_byXlabelXX
+    Given the grateful graph
+    And the traversal of
+      """
+      g.V().hasLabel("song").group().by("name").by(__.properties().groupCount().by(T.label))
+      """
+    When iterated next
+    Then should have a result count of 584
+
+  Scenario: g_V_hasLabelXsongX_groupXaX_byXnameX_byXproperties_groupCount_byXlabelXX_out_capXaX
+    Given the grateful graph
+    And the traversal of
+      """
+      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
+
+  Scenario: g_V_repeatXunionXoutXknowsX_groupXaX_byXageX__outXcreatedX_groupXbX_byXnameX_byXcountXX_groupXaX_byXnameXX_timesX2X_capXa_bX
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+      specifically it has numeric keys which basically get toString()'d under GraphSON 2.x. This test can be supported
+      with GraphSON 3.x.
+      """
+
+  Scenario: g_V_group_byXbothE_countX_byXgroup_byXlabelXX
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+      specifically it has numeric keys which basically get toString()'d under GraphSON 2.x. This test can be supported
+      with GraphSON 3.x.
+      """
+
+  Scenario: g_V_outXfollowedByX_group_byXsongTypeX_byXbothE_group_byXlabelX_byXweight_sumXX
+    Given the grateful graph
+    And the traversal of
+      """
+      g.V().out("followedBy").group().by("songType").by(__.bothE().group().by(T.label).by(__.values("weight").sum()))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"cover":{"followedBy":777982, "sungBy":0, "writtenBy":0}, "":{"followedBy":179350}, "original":{"followedBy":2185613, "sungBy":0, "writtenBy":0}}] |
+
+  Scenario: g_V_groupXmX_byXnameX_byXinXknowsX_nameX_capXmX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group("m").by("name").by(__.in("knows").values("name")).cap("m")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"vadas":"marko", "josh":"marko"}] |
+
+  Scenario: g_V_group_byXlabelX_byXbothE_groupXaX_byXlabelX_byXweight_sumX_weight_sumX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by(T.label).by(__.bothE().group("a").by(T.label).by(__.values("weight").sum()).values("weight").sum())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"software":2.0, "person":5.0}] |
+
+  Scenario: g_withSideEffectXa__marko_666_noone_blahX_V_groupXaX_byXnameX_byXoutE_label_foldX_capXaX
+    Given the modern graph
+    And using the parameter m defined as "m[{\"marko\":[666], \"noone\":[\"blah\"]}]"
+    And the traversal of
+      """
+      g.withSideEffect("a", m).V().group("a").by("name").by(__.outE().label().fold()).cap("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":[], "peter":["created"], "noone":["blah"], "vadas":[], "josh":["created", "created"], "lop":[], "marko":[666, "created", "knows", "knows"]}] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a8983223/gremlin-test/features/sideEffect/SideEffectCap.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/SideEffectCap.feature b/gremlin-test/features/sideEffect/SideEffectCap.feature
new file mode 100644
index 0000000..6be2fdb
--- /dev/null
+++ b/gremlin-test/features/sideEffect/SideEffectCap.feature
@@ -0,0 +1,38 @@
+# 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 - cap()
+
+  Scenario: g_V_group_byXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().group().by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | m[{"ripple":"l[v[ripple]]", "vadas":"l[v[vadas]]", "lop":"l[v[lop]]", "peter": "l[v[peter]]", "josh": "l[v[josh]]", "marko":"l[v[marko]]"}] |
+    
+  Scenario: g_V_chooseXlabel_person__age_groupCountXaX__name_groupCountXbXX_capXa_bX
+    Given an unsupported test
+    Then nothing should happen because
+      """
+      The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+      specifically it has numeric keys which basically get toString()'d under GraphSON 2.x. This test can be supported
+      with GraphSON 3.x.
+      """
\ No newline at end of file


[30/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for AddEdge

Posted by sp...@apache.org.
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


[41/50] tinkerpop git commit: TINKERPOP-1784 Added flatMap()/fold() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added flatMap()/fold() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/235abb52
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/235abb52
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/235abb52

Branch: refs/heads/TINKERPOP-1784
Commit: 235abb52dbf69e377965eaa7f297ae22962a6266
Parents: 83a683a
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 2 08:11:48 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  3 +-
 gremlin-test/features/map/FlatMap.feature       | 35 ++++++++++++
 gremlin-test/features/map/Fold.feature          | 57 ++++++++++++++++++++
 3 files changed, 94 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/235abb52/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 b7050e9..dae6361a 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -21,7 +21,7 @@ import json
 import re
 from gremlin_python.structure.graph import Graph, Path
 from gremlin_python.process.graph_traversal import __
-from gremlin_python.process.traversal import P, Scope, Column, Order, Direction, T, Pick
+from gremlin_python.process.traversal import P, Scope, Column, Order, Direction, T, Pick, Operator
 from radish import given, when, then
 from hamcrest import *
 
@@ -218,6 +218,7 @@ def _make_traversal(g, traversal_string, params):
          "P": P,
          "Pick": Pick,
          "Scope": Scope,
+         "Operator": Operator,
          "T": T}
 
     b.update(params)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/235abb52/gremlin-test/features/map/FlatMap.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/FlatMap.feature b/gremlin-test/features/map/FlatMap.feature
new file mode 100644
index 0000000..7384ee3
--- /dev/null
+++ b/gremlin-test/features/map/FlatMap.feature
@@ -0,0 +1,35 @@
+# 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 - flatMap()
+
+  Scenario: g_V_asXaX_flatMapXselectXaXX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().as("a").flatMap(__.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]  |
+

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/235abb52/gremlin-test/features/map/Fold.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Fold.feature b/gremlin-test/features/map/Fold.feature
new file mode 100644
index 0000000..1c71b27
--- /dev/null
+++ b/gremlin-test/features/map/Fold.feature
@@ -0,0 +1,57 @@
+# 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 - fold()
+
+  Scenario: g_V_fold
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().fold()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | l[v[marko],v[vadas],v[lop],v[josh],v[ripple],v[peter]] |
+
+  Scenario: g_V_fold_unfold
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().fold().unfold()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | v[marko] |
+      | v[vadas] |
+      | v[lop] |
+      | v[josh] |
+      | v[ripple] |
+      | v[peter]  |
+
+  Scenario: g_V_age_foldX0_plusX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").fold(0, Operator.sum)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | d[123] |
+


[32/50] tinkerpop git commit: TINKERPOP-1784 Disabled coverage test for features

Posted by sp...@apache.org.
TINKERPOP-1784 Disabled coverage test for features

No point to enabling at this time since all tests aren't really targetted for migration with this initial body of work. It will be turned on later when all test are intended for migration.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/be1fe03e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/be1fe03e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/be1fe03e

Branch: refs/heads/TINKERPOP-1784
Commit: be1fe03e63eb44baf8a351b092384115e545d7fe
Parents: 984decf
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 11:24:47 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 .../org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/be1fe03e/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index dba865b..cc6e9bd 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -35,6 +35,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateT
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import java.io.BufferedReader;
@@ -65,6 +66,7 @@ public class FeatureCoverageTest {
     private static Pattern scenarioName = Pattern.compile("^\\s*Scenario:\\s*(.*)$");
 
     @Test
+    @Ignore("As it stands we won't have all of these tests migrated initially so there is no point to running this in full - it can be flipped on later")
     public void shouldImplementAllProcessTestsAsFeatures() throws Exception {
 
         // TEMPORARY while test framework is under development - all tests should ultimately be included


[34/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for V()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for V()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/da49b9e9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/da49b9e9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/da49b9e9

Branch: refs/heads/TINKERPOP-1784
Commit: da49b9e9bb193b83b98354a4755e1befacb3ca24
Parents: 235abb5
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Nov 2 08:58:27 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Graph.feature | 109 +++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/da49b9e9/gremlin-test/features/map/Graph.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Graph.feature b/gremlin-test/features/map/Graph.feature
new file mode 100644
index 0000000..249d6a3
--- /dev/null
+++ b/gremlin-test/features/map/Graph.feature
@@ -0,0 +1,109 @@
+# 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 - V()
+
+  Scenario: g_VX1X_V_valuesXnameX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).V().values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | marko  |
+      | vadas |
+      | lop   |
+      | josh |
+      | ripple |
+      | peter  |
+
+  Scenario: g_V_outXknowsX_V_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V().out("knows").V().values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | marko  |
+      | marko  |
+      | vadas |
+      | vadas |
+      | lop   |
+      | lop   |
+      | josh |
+      | josh |
+      | ripple |
+      | ripple |
+      | peter  |
+      | peter  |
+
+  Scenario: g_V_hasXname_GarciaX_inXsungByX_asXsongX_V_hasXname_Willie_DixonX_inXwrittenByX_whereXeqXsongXX_name
+    Given the grateful graph
+    And the traversal of
+      """
+      g.V().has("artist", "name", "Garcia").in("sungBy").as("song").
+        V().has("artist", "name", "Willie_Dixon").in("writtenBy").where(P.eq("song")).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | result |
+      | MY BABE |
+      | HOOCHIE COOCHIE MAN |
+
+  Scenario: g_V_hasLabelXpersonX_asXpX_VXsoftwareX_addInEXuses_pX
+    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 software defined as "l[v[lop],v[ripple]]"
+    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().hasLabel("person").as("p").V(software).addE("uses").from("p")
+      """
+    When iterated to list
+    Then the result should have a count of 8
+    And the graph should return 8 for count of "g.E().hasLabel(\"uses\")"
+    And the graph should return 2 for count of "g.V(v1Id).outE(\"uses\")"
+    And the graph should return 2 for count of "g.V(v2Id).outE(\"uses\")"
+    And the graph should return 4 for count of "g.V(v3Id).inE(\"uses\")"
+    And the graph should return 2 for count of "g.V(v4Id).outE(\"uses\")"
+    And the graph should return 4 for count of "g.V(v5Id).inE(\"uses\")"
+    And the graph should return 2 for count of "g.V(v6Id).outE(\"uses\")"


[16/50] tinkerpop git commit: TINKERPOP-1784 Added repeat() feature tests

Posted by sp...@apache.org.
TINKERPOP-1784 Added repeat() feature tests


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fc1ed8ae
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fc1ed8ae
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fc1ed8ae

Branch: refs/heads/TINKERPOP-1784
Commit: fc1ed8aed962568c7fff6c43283e42ea8656c1ab
Parents: 379ef9f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Oct 23 13:50:37 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/branch/Repeat.feature | 217 +++++++++++++++++++++++
 1 file changed, 217 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fc1ed8ae/gremlin-test/features/branch/Repeat.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Repeat.feature b/gremlin-test/features/branch/Repeat.feature
new file mode 100644
index 0000000..e6049b5
--- /dev/null
+++ b/gremlin-test/features/branch/Repeat.feature
@@ -0,0 +1,217 @@
+# 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 - repeat()
+
+  Scenario: g_V_repeatXoutX_timesX2X_emit_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.out()).times(2).emit().path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[lop]] |
+      | p[v[marko],v[vadas]] |
+      | p[v[marko],v[josh]] |
+      | p[v[marko],v[josh],v[ripple]] |
+      | p[v[marko],v[josh],v[lop]] |
+      | p[v[josh],v[ripple]] |
+      | p[v[josh],v[lop]] |
+      | p[v[peter],v[lop]] |
+
+  Scenario: g_V_repeatXoutX_timesX2X_repeatXinX_timesX2X_name
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.out()).times(2).repeat(__.in()).times(2).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | marko |
+
+  Scenario: g_V_repeatXoutX_timesX2X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.out()).times(2) 
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[ripple] |
+      | v[lop] |
+
+  Scenario: g_V_repeatXoutX_timesX2X_emit
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.out()).times(2).emit()
+      """
+    When iterated to list
+    Then the result should be of
+      | v[ripple] |
+      | v[lop] |
+      | v[josh] |
+      | v[vadas] |
+    And only have a result count of 8
+
+  Scenario: g_VX1X_timesX2X_repeatXoutX_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).times(2).repeat(__.out()).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | ripple |
+      | lop |
+
+  Scenario: g_V_emit_timesX2X_repeatXoutX_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().emit().times(2).repeat(__.out()).path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko]] |
+      | p[v[marko],v[lop]] |
+      | p[v[marko],v[vadas]] |
+      | p[v[marko],v[josh]] |
+      | p[v[marko],v[josh],v[ripple]] |
+      | p[v[marko],v[josh],v[lop]] |
+      | p[v[vadas]] |
+      | p[v[lop]] |
+      | p[v[josh]] |
+      | p[v[josh],v[ripple]] |
+      | p[v[josh],v[lop]] |
+      | p[v[ripple]] |
+      | p[v[peter]] |
+      | p[v[peter],v[lop]] |
+
+  Scenario: g_V_emit_repeatXoutX_timesX2X_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().emit().repeat(__.out()).times(2).path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko]] |
+      | p[v[marko],v[lop]] |
+      | p[v[marko],v[vadas]] |
+      | p[v[marko],v[josh]] |
+      | p[v[marko],v[josh],v[ripple]] |
+      | p[v[marko],v[josh],v[lop]] |
+      | p[v[vadas]] |
+      | p[v[lop]] |
+      | p[v[josh]] |
+      | p[v[josh],v[ripple]] |
+      | p[v[josh],v[lop]] |
+      | p[v[ripple]] |
+      | p[v[peter]] |
+      | p[v[peter],v[lop]] |
+
+  Scenario: g_VX1X_emitXhasXlabel_personXX_repeatXoutX_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).emit(__.has(T.label, "person")).repeat(__.out()).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | marko |
+      | vadas |
+      | josh  |
+
+  Scenario: g_V_repeatXgroupCountXmX_byXnameX_outX_timesX2X_capXmX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.groupCount("m").by("name").out()).times(2).cap("m")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"ripple":2,"peter":1,"vadas":2,"josh":2,"lop":4,"marko":1}] |
+
+  Scenario: g_VX1X_repeatXgroupCountXmX_byXloopsX_outX_timesX3X_capXmX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).repeat(__.groupCount("m").by(__.loops()).out()).times(3).cap("m")
+      """
+    When iterated to list
+    Then nothing should happen because
+      """
+      The result returned is not supported under GraphSON 2.x and therefore cannot be properly asserted. More
+      specifically it has long keys which basically get toString()'d under GraphSON 2.x. This test can be supported
+      with GraphSON 3.x.
+      """
+
+  Scenario: g_V_repeatXbothX_timesX10X_asXaX_out_asXbX_selectXa_bX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.both()).times(10).as("a").out().as("b").select("a", "b").count()
+      """
+    When iterated to list
+    Then the result should be ordered
+      | d[43958] |
+
+  Scenario: g_VX1X_repeatXoutX_untilXoutE_count_isX0XX_name
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And the traversal of
+      """
+      g.V(v1Id).repeat(__.out()).until(__.outE().count().is(0)).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | vadas |
+      | ripple  |
+      | lop  |
+
+  Scenario: g_V_repeatXbothX_untilXname_eq_marko_or_loops_gt_1X_groupCount_byXnameX
+    Given the modern graph
+    And using the parameter v1Id defined as "v[marko].id"
+    And using the parameter l defined as "c[t -> t.get().value('name').equals('lop') || t.loops() > 1]"
+    And the traversal of
+      """
+      g.V().repeat(__.both()).until(l).groupCount().by("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"ripple":3,"vadas":3,"josh":4,"lop":10,"marko":4}] |
+
+  Scenario: g_V_hasXname_markoX_repeatXoutE_inV_simplePathX_untilXhasXname_rippleXX_path_byXnameX_byXlabelX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().has("name", "marko").repeat(__.outE().inV().simplePath()).until(__.has("name", "ripple")).path().by("name").by(T.label)
+      """
+    When iterated next
+    Then the result should be unordered
+      | marko |
+      | knows |
+      | josh  |
+      | created |
+      | ripple  |


[28/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for addV()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for addV()

Included Cardinality in imports for test logic


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0da5bb0d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0da5bb0d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0da5bb0d

Branch: refs/heads/TINKERPOP-1784
Commit: 0da5bb0d59b0891b5af739261e72ac68dafadad7
Parents: 96dd07c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Nov 10 12:55:01 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:21 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |   3 +-
 gremlin-test/features/map/AddVertex.feature     | 147 +++++++++++++++++++
 2 files changed, 149 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0da5bb0d/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 6c72bf1..90b0120 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -21,7 +21,7 @@ import json
 import re
 from gremlin_python.structure.graph import Graph, Path
 from gremlin_python.process.graph_traversal import __
-from gremlin_python.process.traversal import P, Scope, Column, Order, Direction, T, Pick, Operator
+from gremlin_python.process.traversal import Cardinality, P, Scope, Column, Order, Direction, T, Pick, Operator
 from radish import given, when, then
 from hamcrest import *
 
@@ -215,6 +215,7 @@ def _translate(traversal):
 def _make_traversal(g, traversal_string, params):
     b = {"g": g,
          "__": __,
+         "Cardinality": Cardinality,
          "Column": Column,
          "Direction": Direction,
          "Order": Order,

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0da5bb0d/gremlin-test/features/map/AddVertex.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/AddVertex.feature b/gremlin-test/features/map/AddVertex.feature
new file mode 100644
index 0000000..3335e29
--- /dev/null
+++ b/gremlin-test/features/map/AddVertex.feature
@@ -0,0 +1,147 @@
+# 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 - addV()
+
+  Scenario: g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX
+    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").addV("animal").property("age", __.select("a").by("age")).property("name", "puppy")
+      """
+    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(\"animal\",\"age\",29)"
+
+  Scenario: g_V_addVXanimalX_propertyXage_0X
+    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().addV("animal").property("age", 0)
+      """
+    When iterated to list
+    Then the result should have a count of 6
+    And the graph should return 6 for count of "g.V().has(\"animal\",\"age\",0)"
+
+  Scenario: g_addVXpersonX_propertyXname_stephenX
+    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("person").property("name", "stephen")
+      """
+    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\",\"name\",\"stephen\")"
+
+  Scenario: g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenmX
+    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("person").property(Cardinality.single, "name", "stephen").property(Cardinality.single, "name", "stephenm")
+      """
+    When iterated to list
+    Then the result should have a count of 1
+    And the graph should return 0 for count of "g.V().has(\"person\",\"name\",\"stephen\")"
+    And the graph should return 1 for count of "g.V().has(\"person\",\"name\",\"stephenm\")"
+
+  Scenario: get_g_addVXpersonX_propertyXsingle_name_stephenX_propertyXsingle_name_stephenm_since_2010X
+    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("person").property(Cardinality.single, "name", "stephen").property(Cardinality.single, "name", "stephenm", "since", 2010)
+      """
+    When iterated to list
+    Then the result should have a count of 1
+    And the graph should return 0 for count of "g.V().has(\"person\",\"name\",\"stephen\")"
+    And the graph should return 1 for count of "g.V().has(\"person\",\"name\",\"stephenm\")"
+    And the graph should return 1 for count of "g.V().has(\"person\",\"name\",\"stephenm\").properties(\"name\").has(\"since\",2010)"
\ No newline at end of file


[05/50] tinkerpop git commit: TINKERPOP-1784 Added tests for optional() and Path object assertion

Posted by sp...@apache.org.
TINKERPOP-1784 Added tests for optional() and Path object assertion


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0558b87c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0558b87c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0558b87c

Branch: refs/heads/TINKERPOP-1784
Commit: 0558b87ccca32d894f41e7b58aaeaf0cc6d2f4bc
Parents: 6d2d835
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 11 14:05:54 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:19 2017 -0500

----------------------------------------------------------------------
 gremlin-python/pom.xml                          |  2 +-
 .../src/main/jython/radish/feature_steps.py     | 33 +++++----
 gremlin-test/features/branch/Optional.feature   | 77 ++++++++++++++++++++
 .../traversal/step/branch/OptionalTest.java     |  4 +-
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 5 files changed, 101 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0558b87c/gremlin-python/pom.xml
----------------------------------------------------------------------
diff --git a/gremlin-python/pom.xml b/gremlin-python/pom.xml
index c6df1f0..d1a4a76 100644
--- a/gremlin-python/pom.xml
+++ b/gremlin-python/pom.xml
@@ -449,7 +449,7 @@ limitations under the License.
                                         <exec executable="env/bin/radish" dir="${project.build.directory}/python2"
                                               failonerror="true">
                                             <env key="PYTHONPATH" value=""/>
-                                            <arg line="-b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/"/> <!-- -no-line-jump -->
+                                            <arg line="-e -t -b ${project.build.directory}/python2/radish ${project.basedir}/../gremlin-test/features/"/> <!-- -no-line-jump -->
                                         </exec>                                                                  
                                     </target>
                                 </configuration>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0558b87c/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 a34bb8d..1876f5b 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -19,7 +19,7 @@ under the License.
 
 import json
 import re
-from gremlin_python.structure.graph import Graph
+from gremlin_python.structure.graph import Graph, Path
 from gremlin_python.process.graph_traversal import __
 from gremlin_python.process.traversal import P, Scope, Column, Order, Direction, T, Pick
 from radish import given, when, then
@@ -48,7 +48,7 @@ def add_parameter(step, param_name, param):
     if not hasattr(step.context, "traversal_params"):
         step.context.traversal_params = {}
 
-    step.context.traversal_params[param_name] = __convert(param, step.context)
+    step.context.traversal_params[param_name] = _convert(param, step.context)
 
 
 @given("the traversal of")
@@ -67,8 +67,8 @@ def translate_traversal(step):
     if hasattr(step.context, "traversal_params"):
         b.update(step.context.traversal_params)
 
-    print __translate(step.text + " - " + str(b))
-    step.context.traversal = eval(__translate(step.text), b)
+    print _translate(step.text + " - " + str(b))
+    step.context.traversal = eval(_translate(step.text), b)
 
 
 @when("iterated to list")
@@ -81,9 +81,9 @@ def assert_result(step, characterized_as):
     if characterized_as == "empty":
         assert_that(len(step.context.result), equal_to(0))
     elif characterized_as == "ordered":
-        __table_assertion(step.table, step.context.result, step.context, True)
+        _table_assertion(step.table, step.context.result, step.context, True)
     elif characterized_as == "unordered":
-        __table_assertion(step.table, step.context.result, step.context, False)
+        _table_assertion(step.table, step.context.result, step.context, False)
     else:
         raise ValueError("unknown data characterization of " + characterized_as)
 
@@ -93,16 +93,16 @@ def nothing_happening(step):
     return
 
 
-def __convert(val, ctx):
+def _convert(val, ctx):
     if isinstance(val, dict):                                         # convert dictionary keys/values
         n = {}
         for key, value in val.items():
-            n[__convert(key, ctx)] = __convert(value, ctx)
+            n[_convert(key, ctx)] = _convert(value, ctx)
         return n
     elif isinstance(val, unicode):                                    # stupid unicode/string nonsense in py 2/x
-        return __convert(val.encode('utf-8'), ctx)
+        return _convert(val.encode('utf-8'), ctx)
     elif isinstance(val, str) and re.match("^l\[.*\]$", val):         # parse list
-        return list(map((lambda x: __convert(x, ctx)), val[2:-1].split(",")))
+        return list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
     elif isinstance(val, str) and re.match("^d\[.*\]$", val):         # parse numeric
         return long(val[2:-1])
     elif isinstance(val, str) and re.match("^v\[.*\]\.id$", val):     # parse vertex id
@@ -118,14 +118,18 @@ def __convert(val, ctx):
     elif isinstance(val, str) and re.match("^e\[.*\]$", val):         # parse edge
         return ctx.lookup_e["modern"][val[2:-1]]
     elif isinstance(val, str) and re.match("^m\[.*\]$", val):         # parse json as a map
-        return __convert(json.loads(val[2:-1]), ctx)
+        return _convert(json.loads(val[2:-1]), ctx)
+    elif isinstance(val, str) and re.match("^p\[.*\]$", val):         # parse path
+        path_objects = list(map((lambda x: _convert(x, ctx)), val[2:-1].split(",")))
+        labels = [set([]) for i in range(len(path_objects))]
+        return Path(labels, path_objects)
     elif isinstance(val, str) and re.match("^c\[.*\]$", val):         # parse lambda/closure
         return lambda: (val[2:-1], "gremlin-groovy")
     else:
         return val
 
 
-def __table_assertion(data, result, ctx, ordered):
+def _table_assertion(data, result, ctx, ordered):
     # results from traversal should have the same number of entries as the feature data table
     assert_that(len(result), equal_to(len(data)))
 
@@ -134,17 +138,18 @@ def __table_assertion(data, result, ctx, ordered):
     # finds a match in the results for each line of data to assert and then removes that item
     # from the list - in the end there should be no items left over and each will have been asserted
     for ix, line in enumerate(data):
-        val = __convert(line[0], ctx)
+        val = _convert(line[0], ctx)
         if ordered:
             assert_that(results_to_test[ix], equal_to(val))
         else:
+            print str(type(val)) + "---------" + str(type(results_to_test[0]))
             assert_that(val, is_in(results_to_test))
         results_to_test.remove(val)
 
     assert_that(len(results_to_test), is_(0))
 
 
-def __translate(traversal):
+def _translate(traversal):
     replaced = traversal.replace("\n", "")
     replaced = regex_and.sub(r"\1and_(", replaced)
     replaced = regex_as.sub(r"\1as_(", replaced)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0558b87c/gremlin-test/features/branch/Optional.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Optional.feature b/gremlin-test/features/branch/Optional.feature
new file mode 100644
index 0000000..ebd0de2
--- /dev/null
+++ b/gremlin-test/features/branch/Optional.feature
@@ -0,0 +1,77 @@
+# 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 - choose()
+
+  Scenario: g_VX2X_optionalXoutXknowsXX
+    Given the modern graph
+    And using the parameter v2Id is "v[vadas].id"
+    And the traversal of
+      """
+      g.V(v2Id).optional(__.out("knows"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[vadas] |
+
+  Scenario: g_VX2X_optionalXinXknowsXX
+    Given the modern graph
+    And using the parameter v2Id is "v[vadas].id"
+    And the traversal of
+      """
+      g.V(v2Id).optional(__.in("knows"))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | v[marko] |
+
+  Scenario: g_V_hasLabelXpersonX_optionalXoutXknowsX_optionalXoutXcreatedXXX_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("person").
+        optional(__.out("knows").
+                    optional(__.out("created"))).
+        path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[vadas]] |
+      | p[v[marko],v[josh],v[ripple]] |
+      | p[v[marko],v[josh],v[lop]] |
+      | p[v[vadas]] |
+      | p[v[josh]] |
+      | p[v[peter]] |
+    
+  Scenario: g_V_optionalXout_optionalXoutXX_path
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().optional(__.out().optional(__.out())).path()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | p[v[marko],v[lop]] |
+      | p[v[marko],v[vadas]] |
+      | p[v[marko],v[josh],v[ripple]] |
+      | p[v[marko],v[josh],v[lop]] |
+      | p[v[vadas]] |
+      | p[v[lop]] |
+      | p[v[josh],v[ripple]] |
+      | p[v[josh],v[lop]] |
+      | p[v[ripple]] |
+      | p[v[peter],v[lop]] |

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0558b87c/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/OptionalTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/OptionalTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/OptionalTest.java
index 660af6c..403c413 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/OptionalTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/OptionalTest.java
@@ -125,12 +125,12 @@ public abstract class OptionalTest extends AbstractGremlinProcessTest {
     public static class Traversals extends OptionalTest {
 
         @Override
-        public Traversal<Vertex, Vertex> get_g_VX2X_optionalXoutXknowsXX(Object v2Id) {
+        public Traversal<Vertex, Vertex> get_g_VX2X_optionalXoutXknowsXX(final Object v2Id) {
             return this.g.V(v2Id).optional(out("knows"));
         }
 
         @Override
-        public Traversal<Vertex, Vertex> get_g_VX2X_optionalXinXknowsXX(Object v2Id) {
+        public Traversal<Vertex, Vertex> get_g_VX2X_optionalXinXknowsXX(final Object v2Id) {
             return this.g.V(v2Id).optional(in("knows"));
         }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0558b87c/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 4ee540e..1ac9ed8 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -20,6 +20,7 @@ package org.apache.tinkerpop.gremlin.process;
 
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
@@ -60,6 +61,7 @@ public class FeatureCoverageTest {
         final List<Class<?>> temp = Arrays.asList(
                 BranchTest.class,
                 ChooseTest.class,
+                OptionalTest.class,
                 CoinTest.class,
                 CountTest.class,
                 GroupCountTest.class,


[15/50] tinkerpop git commit: TINKERPOP-1784 Added feature tests for min()

Posted by sp...@apache.org.
TINKERPOP-1784 Added feature tests for min()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/b6f625f6
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/b6f625f6
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/b6f625f6

Branch: refs/heads/TINKERPOP-1784
Commit: b6f625f682dad949e91972d490d5a24591244ede
Parents: ce0fd3c
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 24 13:36:36 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/map/Min.feature | 48 ++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/b6f625f6/gremlin-test/features/map/Min.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Min.feature b/gremlin-test/features/map/Min.feature
new file mode 100644
index 0000000..48ceeb9
--- /dev/null
+++ b/gremlin-test/features/map/Min.feature
@@ -0,0 +1,48 @@
+# 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 - min()
+
+  Scenario: g_V_age_min
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").min()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[27] |
+
+  Scenario: g_V_repeatXbothX_timesX5X_age_min
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().repeat(__.both()).times(5).values("age").min()
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[27] |
+
+  Scenario: get_g_V_hasLabelXsoftwareX_group_byXnameX_byXbothE_weight_minX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("software").group().by("name").by(__.bothE().values("weight").min())
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"ripple":1.0,"lop":0.2}] |


[23/50] tinkerpop git commit: TINKERPOP-1784 Added tests for project()

Posted by sp...@apache.org.
TINKERPOP-1784 Added tests for project()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8282262d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8282262d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8282262d

Branch: refs/heads/TINKERPOP-1784
Commit: 8282262d993574fc1a6f228dcc490bbeb3da4ea7
Parents: 366d975
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Fri Oct 20 13:29:41 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 .../src/main/jython/radish/feature_steps.py     |  1 -
 gremlin-test/features/map/Project.feature       | 53 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 3 files changed, 55 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8282262d/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 0d71f78..f58f0da 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -76,7 +76,6 @@ def translate_traversal(step):
 
 @when("iterated to list")
 def iterate_the_traversal(step):
-    print str(step.context.traversal.bytecode)
     step.context.result = map(lambda x: _convert_results(x), step.context.traversal.toList())
 
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8282262d/gremlin-test/features/map/Project.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Project.feature b/gremlin-test/features/map/Project.feature
new file mode 100644
index 0000000..3d8b9cc
--- /dev/null
+++ b/gremlin-test/features/map/Project.feature
@@ -0,0 +1,53 @@
+# 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 - project()
+
+  Scenario: g_V_hasLabelXpersonX_projectXa_bX_byXoutE_countX_byXageX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().hasLabel("person").
+        project("a", "b").
+          by(__.outE().count()).
+          by("age")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | m[{"a":3, "b":29}] |
+      | m[{"a":0, "b":27}] |
+      | m[{"a":2, "b":32}] |
+      | m[{"a":1, "b":35}] |
+
+  Scenario: g_V_outXcreatedX_projectXa_bX_byXnameX_byXinXcreatedX_countX_order_byXselectXbX__decrX_selectXaX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().out("created").
+        project("a", "b").
+          by("name").
+          by(__.in("created").count()).
+        order().
+          by(__.select("b"), Order.decr).
+        select("a")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
+      | lop |
+      | lop |
+      | ripple |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8282262d/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 09344b4..eb62f77 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -26,6 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProjectTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountTest;
@@ -76,6 +77,7 @@ public class FeatureCoverageTest {
                 // map
                 CountTest.class,
                 PathTest.class,
+                ProjectTest.class,
                 VertexTest.class,
                 // sideEffect
                 AggregateTest.class,


[19/50] tinkerpop git commit: TINKERPOP-1784 Added tests for is()

Posted by sp...@apache.org.
TINKERPOP-1784 Added tests for is()


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4748de89
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4748de89
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4748de89

Branch: refs/heads/TINKERPOP-1784
Commit: 4748de89fea7f2f249eb4baab43eec9124d93941
Parents: d74d6a6
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 17 15:52:23 2017 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Fri Nov 10 19:55:20 2017 -0500

----------------------------------------------------------------------
 gremlin-test/features/filter/Is.feature         | 70 ++++++++++++++++++++
 .../gremlin/process/FeatureCoverageTest.java    |  2 +
 2 files changed, 72 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4748de89/gremlin-test/features/filter/Is.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Is.feature b/gremlin-test/features/filter/Is.feature
new file mode 100644
index 0000000..9a00945
--- /dev/null
+++ b/gremlin-test/features/filter/Is.feature
@@ -0,0 +1,70 @@
+# 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 - coin()
+
+  Scenario: g_V_valuesXageX_isX32X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").is(32)
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[32] |
+
+  Scenario: g_V_valuesXageX_isXlte_30X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").is(P.lte(30))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[27] |
+      | d[29] |
+
+  Scenario: g_V_valuesXageX_isXgte_29X_isXlt_34X
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().values("age").is(P.gte(29)).is(P.lt(34))
+      """
+    When iterated to list
+    Then the result should be unordered
+      | d[29] |
+      | d[32] |
+
+  Scenario: g_V_whereXinXcreatedX_count_isX1XX_valuesXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().where(__.in("created").count().is(1)).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | ripple |
+
+  Scenario: g_V_whereXinXcreatedX_count_isXgte_2XX_valuesXnameX
+    Given the modern graph
+    And the traversal of
+      """
+      g.V().where(__.in("created").count().is(P.gte(2l))).values("name")
+      """
+    When iterated to list
+    Then the result should be unordered
+      | lop |
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4748de89/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
index 1f52581..bb2c483 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.IsTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PathTest;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexTest;
@@ -69,6 +70,7 @@ public class FeatureCoverageTest {
                 // filter
                 CoinTest.class,
                 DropTest.class,
+                IsTest.class,
                 // map
                 CountTest.class,
                 PathTest.class,