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/72e98b68
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/72e98b68
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/72e98b68
Branch: refs/heads/TINKERPOP-1784
Commit: 72e98b68f8f120f5b6ba0f011b97007fca759c30
Parents: 8437c18
Author: Stephen Mallette
Authored: Fri Oct 20 13:57:59 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:51 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/72e98b68/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 000..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/72e98b68/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,
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/7896264e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7896264e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7896264e
Branch: refs/heads/TINKERPOP-1784
Commit: 7896264edf6a3ea94a2f7ae396da1f1db152311e
Parents: 3b54267
Author: Stephen Mallette
Authored: Fri Nov 10 11:24:47 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/7896264e/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
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/8437c18f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8437c18f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8437c18f
Branch: refs/heads/TINKERPOP-1784
Commit: 8437c18f9d0845c08106a02f1c3ee07b7b149240
Parents: e0cb76e
Author: Stephen Mallette
Authored: Fri Oct 20 13:29:41 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:51 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/8437c18f/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/8437c18f/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 000..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/8437c18f/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
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/401a44fc
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/401a44fc
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/401a44fc
Branch: refs/heads/TINKERPOP-1784
Commit: 401a44fc95c628cccbdd6b47c604488561a13bd8
Parents: f784e71
Author: Stephen Mallette
Authored: Mon Oct 23 13:50:37 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/branch/Repeat.feature | 217 +++
1 file changed, 217 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/401a44fc/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 000..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]] |
+ |
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/5045a56c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5045a56c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5045a56c
Branch: refs/heads/TINKERPOP-1784
Commit: 5045a56c208b5e069dedeb330ab6bef092419880
Parents: 754b7f5
Author: Stephen Mallette
Authored: Fri Nov 10 14:15:28 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 2017 -0500
--
gremlin-test/features/map/Order.feature | 132 +++
1 file changed, 132 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5045a56c/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 000..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
+
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/99105194
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/99105194
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/99105194
Branch: refs/heads/TINKERPOP-1784
Commit: 9910519423bbf89f05f48ec83986ea9e6cec0e4f
Parents: 9c93fd7
Author: Stephen Mallette
Authored: Fri Nov 10 12:55:01 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 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/99105194/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/99105194/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 000..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
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/5dd6a240
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5dd6a240
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5dd6a240
Branch: refs/heads/TINKERPOP-1784
Commit: 5dd6a240b30c29cd2d2d4625a0415159b191818f
Parents: 447e57c
Author: Stephen Mallette
Authored: Fri Nov 10 14:36:03 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 2017 -0500
--
gremlin-test/features/map/Sum.feature | 40 ++
1 file changed, 40 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5dd6a240/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 000..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
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/d11787a7
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d11787a7
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d11787a7
Branch: refs/heads/TINKERPOP-1784
Commit: d11787a7e1177491cb126def43d1c101485d1e22
Parents: 22e113d
Author: Stephen Mallette
Authored: Tue Oct 24 12:35:59 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/filter/Sample.feature | 75
1 file changed, 75 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d11787a7/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 000..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().
+ """
+
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/3b542678
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3b542678
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3b542678
Branch: refs/heads/TINKERPOP-1784
Commit: 3b54267846bc86a927cf44839c1333e2ba63135a
Parents: 8f0b8f7
Author: Stephen Mallette
Authored: Thu Nov 9 12:50:52 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Match.feature | 80
1 file changed, 80 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3b542678/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 000..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]"}] |
+
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/1588d3e2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1588d3e2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1588d3e2
Branch: refs/heads/TINKERPOP-1784
Commit: 1588d3e27d91c01808ef342773be3616d8ec8fae
Parents: 5478e5d
Author: Stephen Mallette
Authored: Tue Oct 24 15:42:29 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Constant.feature | 50 +
1 file changed, 50 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1588d3e2/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 000..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 |
+
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/e0cb76ee
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e0cb76ee
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e0cb76ee
Branch: refs/heads/TINKERPOP-1784
Commit: e0cb76ee19a04f794efcecc61de78ef039f8e7a8
Parents: 3293498
Author: Stephen Mallette
Authored: Wed Oct 18 15:30:16 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:51 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/e0cb76ee/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/e0cb76ee/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 000..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
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1784 e03cbd296 -> c0a3ce0e3 (forced update)
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/bd3868b5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bd3868b5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bd3868b5
Branch: refs/heads/TINKERPOP-1784
Commit: bd3868b5aaeeaaad98261fe7ab4e31e2abf96c02
Parents: 72e98b6
Author: Stephen Mallette
Authored: Fri Oct 20 14:06:15 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:51 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/bd3868b5/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 000..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/bd3868b5/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,
TINKERPOP-1784 Added feature tests for loop() and map()
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8f0b8f7a
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8f0b8f7a
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8f0b8f7a
Branch: refs/heads/TINKERPOP-1784
Commit: 8f0b8f7a7c4455f92cd1384720262f068c8f8be6
Parents: 75d1e27
Author: Stephen Mallette
Authored: Thu Nov 2 11:59:10 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Loop.feature | 68 ++
gremlin-test/features/map/Map.feature | 108
2 files changed, 176 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f0b8f7a/gremlin-test/features/map/Loop.feature
--
diff --git a/gremlin-test/features/map/Loop.feature
b/gremlin-test/features/map/Loop.feature
new file mode 100644
index 000..efd439f
--- /dev/null
+++ b/gremlin-test/features/map/Loop.feature
@@ -0,0 +1,68 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Feature: Step - loop()
+
+ Scenario:
g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_or_loops_isX3XX_hasXname_peterX_path_byXnameX
+Given the modern graph
+And using the parameter v1Id defined as "v[marko].id"
+And the traversal of
+ """
+ g.V(v1Id).repeat(__.both().simplePath()).until(__.has("name",
"peter").or().loops().is(3)).has("name", "peter").path().by("name")
+ """
+When iterated to list
+Then the result should be unordered
+ | result |
+ | p[marko,lop,peter] |
+ | p[marko,josh,lop,peter] |
+
+ Scenario:
g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_or_loops_isX2XX_hasXname_peterX_path_byXnameX
+Given the modern graph
+And using the parameter v1Id defined as "v[marko].id"
+And the traversal of
+ """
+ g.V(v1Id).repeat(__.both().simplePath()).until(__.has("name",
"peter").or().loops().is(2)).has("name", "peter").path().by("name")
+ """
+When iterated to list
+Then the result should be unordered
+ | result |
+ | p[marko,lop,peter] |
+
+ Scenario:
g_VX1X_repeatXboth_simplePathX_untilXhasXname_peterX_and_loops_isX3XX_hasXname_peterX_path_byXnameX
+Given the modern graph
+And using the parameter v1Id defined as "v[marko].id"
+And the traversal of
+ """
+ g.V(v1Id).repeat(__.both().simplePath()).until(__.has("name",
"peter").and().loops().is(3)).has("name", "peter").path().by("name")
+ """
+When iterated to list
+Then the result should be unordered
+ | result |
+ | p[marko,josh,lop,peter] |
+
+ Scenario: g_V_emitXhasXname_markoX_or_loops_isX2XX_repeatXoutX_valuesXnameX
+Given the modern graph
+And the traversal of
+ """
+ g.V().emit(__.has("name",
"marko").or().loops().is(2)).repeat(__.out()).values("name")
+ """
+When iterated to list
+Then the result should be unordered
+ | result |
+ | marko |
+ | ripple |
+ | lop |
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f0b8f7a/gremlin-test/features/map/Map.feature
--
diff --git a/gremlin-test/features/map/Map.feature
b/gremlin-test/features/map/Map.feature
new file mode 100644
index 000..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
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/d55e058d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d55e058d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d55e058d
Branch: refs/heads/TINKERPOP-1784
Commit: d55e058d873954af84a07683f7023f7b97755f37
Parents: c24d5b4
Author: Stephen Mallette
Authored: Tue Oct 24 13:36:36 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Min.feature | 48 ++
1 file changed, 48 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d55e058d/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 000..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}] |
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/4a5b87c5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4a5b87c5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4a5b87c5
Branch: refs/heads/TINKERPOP-1784
Commit: 4a5b87c5eaf74a114182dc7aa2cb6ced1944571b
Parents: 5dd6a24
Author: Stephen Mallette
Authored: Fri Nov 10 14:50:32 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 2017 -0500
--
gremlin-test/features/map/Unfold.feature | 76 +++
1 file changed, 76 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4a5b87c5/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 000..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
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/26779e19
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/26779e19
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/26779e19
Branch: refs/heads/TINKERPOP-1784
Commit: 26779e1904d24db9702c9a4b98f5107b930bf49f
Parents: 9910519
Author: Stephen Mallette
Authored: Fri Nov 10 12:56:34 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 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/26779e19/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..000
--- 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/26779e19/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 000..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
+#
+#
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/c24d5b40
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c24d5b40
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c24d5b40
Branch: refs/heads/TINKERPOP-1784
Commit: c24d5b40746950c28c02fef97da27cb95abf687b
Parents: d11787a
Author: Stephen Mallette
Authored: Tue Oct 24 12:46:26 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/filter/SimplePath.feature | 69
1 file changed, 69 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c24d5b40/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 000..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]|
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/c3a3848d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c3a3848d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c3a3848d
Branch: refs/heads/TINKERPOP-1784
Commit: c3a3848d274a04eda8f930f0bfcf964b675f40c0
Parents: 3314644
Author: Stephen Mallette
Authored: Tue Oct 31 09:23:22 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/c3a3848d/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/c3a3848d/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 000..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
+ """
+
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/d977d6a5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d977d6a5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d977d6a5
Branch: refs/heads/TINKERPOP-1784
Commit: d977d6a59660039ff7e6b7251449512744550d53
Parents: 401a44f
Author: Stephen Mallette
Authored: Tue Oct 24 10:14:09 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/filter/And.feature | 65 +++
1 file changed, 65 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d977d6a5/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 000..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
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/75d1e27b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/75d1e27b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/75d1e27b
Branch: refs/heads/TINKERPOP-1784
Commit: 75d1e27bb517494df7ab3fdc7ac02a23935ef91d
Parents: 78fd4fd
Author: Stephen Mallette
Authored: Thu Nov 2 08:58:27 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Graph.feature | 109 +++
1 file changed, 109 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/75d1e27b/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 000..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
TINKERPOP-1784 Removed duplicate entry from bad merge in changelog
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/33258993
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/33258993
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/33258993
Branch: refs/heads/TINKERPOP-1784
Commit: 33258993494225f61697fc8fe58d3b54d59766f8
Parents: 2b24f58
Author: Stephen Mallette
Authored: Fri Nov 10 20:13:12 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:53:14 2017 -0500
--
CHANGELOG.asciidoc | 1 -
1 file changed, 1 deletion(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/33258993/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index cb2779a..d722066 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,7 +30,6 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* `TraversalVertexProgram` `profile()` now accounts for worker iteration in
`GraphComputer` OLAP.
* Returned the `Builder` instance from the `DetachedEdge.Builder` methods of
`setOutE` and `setOutV`.
* 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`.
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/a9af53ff
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a9af53ff
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a9af53ff
Branch: refs/heads/TINKERPOP-1784
Commit: a9af53ffa88432a5adefaf93e8df8158151a186f
Parents: d977d6a
Author: Stephen Mallette
Authored: Tue Oct 24 10:24:40 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/filter/CyclicPath.feature | 50
1 file changed, 50 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/a9af53ff/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 000..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
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/a5d99774
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/a5d99774
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/a5d99774
Branch: refs/heads/TINKERPOP-1784
Commit: a5d99774e2f6b8dbe312062e99380b5a80873816
Parents: a9af53f
Author: Stephen Mallette
Authored: Tue Oct 24 11:37:18 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/a5d99774/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/a5d99774/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/a5d99774/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/a5d99774/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
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/77d59ddf
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/77d59ddf
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/77d59ddf
Branch: refs/heads/TINKERPOP-1784
Commit: 77d59ddf9c323842872c875445e35952210784ca
Parents: bd3868b
Author: Stephen Mallette
Authored: Fri Oct 20 15:13:06 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/77d59ddf/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 000..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/77d59ddf/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
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/447e57c2
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/447e57c2
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/447e57c2
Branch: refs/heads/TINKERPOP-1784
Commit: 447e57c2e2bad029ead63de2227b12db708cbd85
Parents: c7347ab
Author: Stephen Mallette
Authored: Fri Nov 10 14:31:20 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 2017 -0500
--
gremlin-test/features/map/Properties.feature | 68 +++
1 file changed, 68 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/447e57c2/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 000..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.
+ """
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/04c903e5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/04c903e5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/04c903e5
Branch: refs/heads/TINKERPOP-1784
Commit: 04c903e55c7bba523c1729625b6463a89031e2b4
Parents: 4a5b87c
Author: Stephen Mallette
Authored: Fri Nov 10 15:17:03 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:53:13 2017 -0500
--
CHANGELOG.asciidoc | 2 ++
1 file changed, 2 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04c903e5/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 918bbd4..cb2779a 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,8 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* Bump to Netty 4.0.52
* `TraversalVertexProgram` `profile()` now accounts for worker iteration in
`GraphComputer` OLAP.
* Returned the `Builder` instance from the `DetachedEdge.Builder` methods of
`setOutE` and `setOutV`.
+* 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`.
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/32934987
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/32934987
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/32934987
Branch: refs/heads/TINKERPOP-1784
Commit: 32934987c4f60e9a231a77e99c0fe67e4e76015c
Parents: 0aef836
Author: Stephen Mallette
Authored: Wed Oct 18 14:36:25 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:51 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/32934987/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/32934987/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/32934987/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 000..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.
+
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/78fd4fdc
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/78fd4fdc
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/78fd4fdc
Branch: refs/heads/TINKERPOP-1784
Commit: 78fd4fdc8f177ecab960f7d5c94aa6374606cd61
Parents: e9ee40f
Author: Stephen Mallette
Authored: Thu Nov 2 08:11:48 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/78fd4fdc/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/78fd4fdc/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 000..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/78fd4fdc/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 000..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
+ """
+
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/754b7f5c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/754b7f5c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/754b7f5c
Branch: refs/heads/TINKERPOP-1784
Commit: 754b7f5c5def7a1388d955df464507cbb44e40b0
Parents: 26779e1
Author: Stephen Mallette
Authored: Fri Nov 10 13:38:55 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 2017 -0500
--
gremlin-test/features/map/Mean.feature | 40 +
1 file changed, 40 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/754b7f5c/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 000..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.}] |
\ No newline at end of file
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/9c93fd7c
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9c93fd7c
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9c93fd7c
Branch: refs/heads/TINKERPOP-1784
Commit: 9c93fd7c558933532349aae1d42e84f0afbc
Parents: e67cbdb
Author: Stephen Mallette
Authored: Fri Nov 10 12:35:04 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:53 2017 -0500
--
gremlin-test/features/filter/Where.feature | 105
1 file changed, 105 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9c93fd7c/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 000..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
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/e67cbdb8
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e67cbdb8
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e67cbdb8
Branch: refs/heads/TINKERPOP-1784
Commit: e67cbdb86241dd7d2baa42cb9a6e1458788839ee
Parents: 7896264
Author: Stephen Mallette
Authored: Fri Nov 10 12:05:57 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/e67cbdb8/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/e67cbdb8/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 000..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
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/c45bac78
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c45bac78
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c45bac78
Branch: refs/heads/TINKERPOP-1784
Commit: c45bac7890f5bd06d94726c6da15801b8c14d596
Parents: 77d59dd
Author: Stephen Mallette
Authored: Mon Oct 23 10:00:34 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/c45bac78/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/c45bac78/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 000..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
+ """
+
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/f9803660
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f9803660
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f9803660
Branch: refs/heads/TINKERPOP-1784
Commit: f98036605cfefac5d6a18b8e4e0f9ffeee690323
Parents: 04c903e
Author: Stephen Mallette
Authored: Fri Nov 10 15:17:20 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:53:13 2017 -0500
--
gremlin-test/features/sideEffect/Sack.feature | 71 ++
1 file changed, 71 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f9803660/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 000..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
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/3a294df1
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3a294df1
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3a294df1
Branch: refs/heads/TINKERPOP-1784
Commit: 3a294df142d7608eb8814542d6f9b9e7d24aa986
Parents: c3a3848
Author: Stephen Mallette
Authored: Wed Nov 1 15:36:23 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 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/3a294df1/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/3a294df1/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/3a294df1/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
---
TINKERPOP-1784 Added aliasing to .NET driver
Tests were failing as a result of the change to using the mix server
configuration that had all the graphs. On the way to dealing with that, I
noticed the driver didn't seem to have aliasing capability which prevented it
from choosing the correct graph traversal source on the server. For some
reason, asserting longs on ids seemed to be a problem as well after this change
and I'm pretty sure it has something to do with the configuration of the
TinkerGraph in this new mixed mode configuration and not something in
serialization.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/314ab67b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/314ab67b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/314ab67b
Branch: refs/heads/TINKERPOP-1784
Commit: 314ab67b6bff2c33e7d1e0fb93cffd62d638707a
Parents: 3325899
Author: Stephen Mallette
Authored: Sat Nov 11 06:17:19 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:53:14 2017 -0500
--
.../Driver/Remote/DriverRemoteConnection.cs | 16 ++--
.../DriverRemoteConnection/GraphTraversalTests.cs | 8
.../RemoteConnectionFactory.cs | 8 +++-
gremlin-dotnet/test/pom.xml | 6 +-
4 files changed, 30 insertions(+), 8 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/314ab67b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
--
diff --git
a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
index 0a8b93f..80bd100 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Driver/Remote/DriverRemoteConnection.cs
@@ -36,15 +36,27 @@ namespace Gremlin.Net.Driver.Remote
public class DriverRemoteConnection : IRemoteConnection, IDisposable
{
private readonly IGremlinClient _client;
+private readonly string _traversalSource;
///
/// Initializes a new .
///
/// The that will
be used for the connection.
/// Thrown when client is
null.
-public DriverRemoteConnection(IGremlinClient client)
+public DriverRemoteConnection(IGremlinClient client):this(client, "g")
+{
+}
+
+///
+/// Initializes a new .
+///
+/// The that will
be used for the connection.
+/// The name of the traversal source on
the server to bind to.
+/// Thrown when client is
null.
+public DriverRemoteConnection(IGremlinClient client, string
traversalSource)
{
_client = client ?? throw new
ArgumentNullException(nameof(client));
+_traversalSource = traversalSource;
}
///
@@ -66,7 +78,7 @@ namespace Gremlin.Net.Driver.Remote
.Processor(Tokens.ProcessorTraversal)
.OverrideRequestId(requestid)
.AddArgument(Tokens.ArgsGremlin, bytecode)
-.AddArgument(Tokens.ArgsAliases, new Dictionary {{"g", "g"}})
+.AddArgument(Tokens.ArgsAliases, new Dictionary {{"g", _traversalSource}})
.Create();
return await
_client.SubmitAsync(requestMsg).ConfigureAwait(false);
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/314ab67b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
index 84a44a7..d9c47f1 100644
---
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Process/Traversal/DriverRemoteConnection/GraphTraversalTests.cs
@@ -55,8 +55,8 @@ namespace
Gremlin.Net.IntegrationTest.Process.Traversal.DriverRemoteConnection
var vertex = g.V(1).Next();
-Assert.Equal(new Vertex((long) 1), vertex);
-Assert.Equal((long) 1, vertex.Id);
+Assert.Equal(new Vertex(1), vertex);
+Assert.Equal(1, vertex.Id);
}
[Fact]
@@ -68,7 +68,7 @@ namespace
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/5478e5dd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5478e5dd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5478e5dd
Branch: refs/heads/TINKERPOP-1784
Commit: 5478e5ddca1c228a4df48310a4373dca97192c61
Parents: d55e058
Author: Stephen Mallette
Authored: Tue Oct 24 13:51:30 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Max.feature | 48 ++
1 file changed, 48 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5478e5dd/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 000..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}] |
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/f784e719
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f784e719
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f784e719
Branch: refs/heads/TINKERPOP-1784
Commit: f784e71988183852cdef8713fa66b84f3e332a28
Parents: c45bac7
Author: Stephen Mallette
Authored: Mon Oct 23 10:58:36 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/branch/Union.feature | 133
1 file changed, 133 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f784e719/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 000..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())
+ """
+
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/22e113d1
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/22e113d1
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/22e113d1
Branch: refs/heads/TINKERPOP-1784
Commit: 22e113d1a1e746d87a3da57df16f9f3adc0a6f33
Parents: a5d9977
Author: Stephen Mallette
Authored: Tue Oct 24 12:17:43 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/filter/Range.feature | 213
1 file changed, 213 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/22e113d1/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 000..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
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/e9ee40ff
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e9ee40ff
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e9ee40ff
Branch: refs/heads/TINKERPOP-1784
Commit: e9ee40ff808253ad52655c3533ca9e81c97a73ea
Parents: 3a294df
Author: Stephen Mallette
Authored: Thu Nov 2 07:52:49 2017 -0400
Committer: Stephen Mallette
Committed: Tue Nov 21 15:52:52 2017 -0500
--
gremlin-test/features/map/Coalesce.feature | 78 +
1 file changed, 78 insertions(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e9ee40ff/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 000..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] |
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/57675441
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/57675441
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/57675441
Branch: refs/heads/TINKERPOP-1784
Commit: 576754415381205936f9a8be5cf50259d13faacb
Parents: 314ab67
Author: Stephen Mallette
Authored: Sat Nov 11 06:20:32 2017 -0500
Committer: Stephen Mallette
Committed: Tue Nov 21 15:53:14 2017 -0500
--
CHANGELOG.asciidoc | 1 +
1 file changed, 1 insertion(+)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/57675441/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index d722066..5ba7c70 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -30,6 +30,7 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
* `TraversalVertexProgram` `profile()` now accounts for worker iteration in
`GraphComputer` OLAP.
* Returned the `Builder` instance from the `DetachedEdge.Builder` methods of
`setOutE` and `setOutV`.
* Added test framework for GLVs.
+* Added alias support in the .NET `DriverRemoteConnection`.
* 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`.
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1834 [created] 2a957bb58
Added NoneStep which simply filter(false). Traversal.none() was added which
appends the NoneStep. Traversal.iterate() was updated such that if the
traversal has not been compiled yet, then Traversal.none() is called to ensure
that a full filter is propagated in the bytecode.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2a957bb5
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2a957bb5
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2a957bb5
Branch: refs/heads/TINKERPOP-1834
Commit: 2a957bb586263b2dd70b4db36d1b3c6f87d5596f
Parents: 26ea2be
Author: Marko A. Rodriguez
Authored: Tue Nov 21 03:44:32 2017 -0800
Committer: Marko A. Rodriguez
Committed: Tue Nov 21 03:44:32 2017 -0800
--
CHANGELOG.asciidoc | 1 +
.../gremlin/process/traversal/Traversal.java| 23 --
.../process/traversal/step/filter/NoneStep.java | 44
.../optimization/LazyBarrierStrategy.java | 2 +
.../optimization/PathRetractionStrategy.java| 2 +
.../process/traversal/TraversalTest.java| 2 +-
.../traversal/dsl/graph/GraphTraversalTest.java | 2 +-
.../process/traversal/CoreTraversalTest.java| 11 +
8 files changed, 81 insertions(+), 6 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2a957bb5/CHANGELOG.asciidoc
--
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 327e2cb..fd6ed48 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -25,6 +25,7 @@
image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
This release also includes changes from <>.
+* Added `NoneStep` and `Traversal.none()` for full filtering integration with
`iterate()`.
* Fixed bug in serialization of `Path` for GraphSON 3.0 in `gremlin-python`.
* Added support for GraphSON 3.0 in Gremlin.Net.
* Added `math()`-step which supports scientific calculator capabilities for
numbers within a traversal.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2a957bb5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
--
diff --git
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
index c085dc7..220c995 100644
---
a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
+++
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Traversal.java
@@ -23,6 +23,7 @@ import
org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
import
org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.NoneStep;
import
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.ProfileSideEffectStep;
import
org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapStep;
import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
@@ -69,6 +70,7 @@ public interface Traversal extends Iterator,
Serializable, Cloneable, A
}
public static final String profile = "profile";
+public static final String none = "none";
}
/**
@@ -149,7 +151,7 @@ public interface Traversal extends Iterator,
Serializable, Cloneable, A
* {@link TraversalSource#withRemote(Configuration)}. Calling this method
otherwise will yield an
* {@code IllegalStateException}.
*/
-public default CompletableFuture promise(final
Function, T> traversalFunction) {
+public default CompletableFuture promise(final
Function, T> traversalFunction) {
// apply strategies to see if RemoteStrategy has any effect (i.e. add
RemoteStep)
if (!this.asAdmin().isLocked()) this.asAdmin().applyStrategies();
@@ -191,7 +193,10 @@ public interface Traversal extends Iterator,
Serializable, Cloneable, A
*/
public default Traversal iterate() {
try {
-if (!this.asAdmin().isLocked()) this.asAdmin().applyStrategies();
+if (!this.asAdmin().isLocked()) {
+this.none();
+this.asAdmin().applyStrategies();
+}
// use the end step
Invoke predicates and enums
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/72174e3b
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/72174e3b
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/72174e3b
Branch: refs/heads/TINKERPOP-1827
Commit: 72174e3b63c7fc46a73bbf6eb64f55177dc5cc90
Parents: 7db8cb6
Author: Jorge Bay Gondra
Authored: Mon Oct 30 15:14:38 2017 +0100
Committer: Jorge Bay Gondra
Committed: Tue Nov 21 11:46:18 2017 +0100
--
.../StaticTraversalParameter.cs | 15 +--
.../TraversalEnumParameter.cs | 98
.../TraversalEvaluationTests.cs | 16 +++-
.../TraversalEvaluation/TraversalParser.cs | 79 ++--
.../TraversalPredicateParameter.cs | 26 --
.../TraversalTokenParameter.cs | 71 --
6 files changed, 188 insertions(+), 117 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72174e3b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/StaticTraversalParameter.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/StaticTraversalParameter.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/StaticTraversalParameter.cs
index 8e0fbf9..dca691b 100644
---
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/StaticTraversalParameter.cs
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/StaticTraversalParameter.cs
@@ -30,9 +30,11 @@ namespace
Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation
{
internal class StaticTraversalParameter : ITokenParameter,
IEquatable
{
+private readonly string _traversalText;
+
public bool Equals(StaticTraversalParameter other)
{
-return Parts.SequenceEqual(other.Parts);
+return Tokens.SequenceEqual(other.Tokens);
}
public override bool Equals(object obj)
@@ -45,12 +47,12 @@ namespace
Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation
public override int GetHashCode()
{
-return Parts != null ? Parts.GetHashCode() : 0;
+return Tokens != null ? Tokens.GetHashCode() : 0;
}
public object GetValue()
{
-throw new NotImplementedException();
+return TraversalParser.GetTraversalFromTokens(Tokens, null,
_traversalText);
}
public Type GetParameterType()
@@ -58,11 +60,12 @@ namespace
Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation
return typeof(ITraversal);
}
-public IList Parts { get; }
+public IList Tokens { get; }
-public StaticTraversalParameter(IList parts)
+public StaticTraversalParameter(IList tokens, string
traversalText)
{
-Parts = parts;
+_traversalText = traversalText;
+Tokens = tokens;
}
}
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72174e3b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEnumParameter.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEnumParameter.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEnumParameter.cs
new file mode 100644
index 000..663928a
--- /dev/null
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEnumParameter.cs
@@ -0,0 +1,98 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using
Get property information from modern graph
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7db8cb6a
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7db8cb6a
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7db8cb6a
Branch: refs/heads/TINKERPOP-1827
Commit: 7db8cb6ac4d4342bef2dae56cee226fa544dd655
Parents: 74a4f8a
Author: Jorge Bay Gondra
Authored: Fri Oct 27 14:18:32 2017 +0200
Committer: Jorge Bay Gondra
Committed: Tue Nov 21 11:46:18 2017 +0100
--
.../ModernGraphTypeInformation.cs | 70
.../TraversalEvaluationTests.cs | 10 ++-
.../TraversalEvaluation/TraversalParser.cs | 24 ---
3 files changed, 92 insertions(+), 12 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7db8cb6a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs
new file mode 100644
index 000..bce3449
--- /dev/null
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs
@@ -0,0 +1,70 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using Gremlin.Net.Process.Traversal;
+
+namespace Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation
+{
+internal class ModernGraphTypeInformation
+{
+private static readonly IDictionary PropertyInfos = new
Dictionary
+{
+{"age", typeof(int)},
+{"name", typeof(string)},
+{"lang", typeof(string)},
+{"weight", typeof(float)}
+};
+
+///
+/// Gets the type argument information based on the modern graph.
+/// s
+public static Type GetTypeArguments(MethodInfo method, object[]
parameterValues)
+{
+switch (method.Name)
+{
+case nameof(GraphTraversal.ValueMap):
+case nameof(GraphTraversal.Values) when
parameterValues.Length == 1:
+// The parameter contains the element property names
+var properties = ((IEnumerable)
parameterValues[parameterValues.Length - 1]).Cast();
+var types =
properties.Select(GetElementPropertyType).ToArray();
+if (types.Distinct().Count() == 1)
+{
+return types[0];
+}
+return typeof(object);
+}
+return null;
+}
+
+private static Type GetElementPropertyType(string name)
+{
+PropertyInfos.TryGetValue(name, out var type);
+return type;
+}
+}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7db8cb6a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEvaluationTests.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEvaluationTests.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEvaluationTests.cs
index 0949ad5..4e3ec42 100644
---
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEvaluationTests.cs
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalEvaluationTests.cs
@@ -77,15 +77,19 @@ namespace
Gherkin-based test runner
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d000fce0
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d000fce0
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d000fce0
Branch: refs/heads/TINKERPOP-1827
Commit: d000fce0006552f537cb3e580f4c70c60c895e88
Parents: e03cbd2
Author: Jorge Bay Gondra
Authored: Mon Sep 25 17:27:13 2017 +0200
Committer: Jorge Bay Gondra
Committed: Tue Nov 21 11:46:17 2017 +0100
--
.../Gherkin/Attributes/BddAttribute.cs | 37 ++
.../Gherkin/Attributes/GivenAttribute.cs| 33 ++
.../Gherkin/Attributes/ThenAttribute.cs | 33 ++
.../Gherkin/Attributes/WhenAttribute.cs | 33 ++
.../Gherkin/CommonSteps.cs | 156 +
.../Gherkin/GherkinTestRunner.cs| 335 +++
.../Gherkin/StepDefinition.cs | 39 +++
.../Gherkin/TraversalTranslations.cs| 102 ++
.../Gremlin.Net.IntegrationTest.csproj | 13 +-
.../RemoteConnectionFactory.cs | 18 +-
10 files changed, 790 insertions(+), 9 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d000fce0/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/BddAttribute.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/BddAttribute.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/BddAttribute.cs
new file mode 100644
index 000..1e9a242
--- /dev/null
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/BddAttribute.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System;
+
+namespace Gremlin.Net.IntegrationTest.Gherkin.Attributes
+{
+internal class BddAttribute : Attribute
+{
+public string Message { get; }
+
+internal BddAttribute(string message)
+{
+Message = message;
+}
+}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d000fce0/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/GivenAttribute.cs
--
diff --git
a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/GivenAttribute.cs
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/GivenAttribute.cs
new file mode 100644
index 000..7266145
--- /dev/null
+++
b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/GivenAttribute.cs
@@ -0,0 +1,33 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+namespace Gremlin.Net.IntegrationTest.Gherkin.Attributes
+{
+internal class GivenAttribute : BddAttribute
+{
+public GivenAttribute(string message) : base(message)
+{
+
+}
+}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d000fce0/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Attributes/ThenAttribute.cs
Decimal serialization support and avoid dynamic conversion
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/0279f282
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/0279f282
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/0279f282
Branch: refs/heads/TINKERPOP-1827
Commit: 0279f2823b2ad7029dab7c7ccf5fd02d25f90fd0
Parents: a5f1e17
Author: Jorge Bay Gondra
Authored: Tue Nov 21 11:39:38 2017 +0100
Committer: Jorge Bay Gondra
Committed: Tue Nov 21 11:46:19 2017 +0100
--
.../Process/Traversal/DefaultTraversal.cs | 11 +--
.../Structure/IO/GraphSON/DecimalConverter.cs | 34
.../Structure/IO/GraphSON/GraphSONReader.cs | 15 +++--
.../Structure/IO/GraphSON/GraphSONWriter.cs | 1 +
.../Structure/IO/GraphSON/NumberConverter.cs| 3 +-
5 files changed, 58 insertions(+), 6 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0279f282/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
--
diff --git
a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
index 7e0f37b..052c33a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/DefaultTraversal.cs
@@ -91,9 +91,16 @@ namespace Gremlin.Net.Process.Traversal
}
///
-public E Current => (E)TraverserEnumerator.Current?.Object;
+public E Current => (E) GetCurrent();
-object IEnumerator.Current => Current;
+///
+object IEnumerator.Current => GetCurrent();
+
+private object GetCurrent()
+{
+// Use the object (not dynamic) result
+return TraverserEnumerator.Current?.Object;
+}
private IEnumerator GetTraverserEnumerator()
{
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0279f282/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
--
diff --git
a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
new file mode 100644
index 000..82cc646
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DecimalConverter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * 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.
+ */
+
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+internal class DecimalConverter : NumberConverter
+{
+protected override string GraphSONTypeName => "BigDecimal";
+protected override Type HandledType => typeof(decimal);
+protected override string Prefix => "gx";
+}
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/0279f282/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
--
diff --git
a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index aa1fc48..60bafed 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@ -48,7 +48,8 @@ namespace Gremlin.Net.Structure.IO.GraphSON
{"g:Edge", new EdgeDeserializer()},
{"g:Property", new PropertyDeserializer()},
{"g:VertexProperty", new VertexPropertyDeserializer()},
-{"g:Path", new PathDeserializer()}
+{"g:Path", new PathDeserializer()},
+{"gx:BigDecimal", new DecimalConverter()}
};
///
@@ -89,9 +90,17 @@ namespace