You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/02/20 19:07:16 UTC
[25/27] tinkerpop git commit: TINKERPOP-1857 sack() inject() cap()
GLV tests
TINKERPOP-1857 sack() inject() cap() GLV tests
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5db5f218
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5db5f218
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5db5f218
Branch: refs/heads/master
Commit: 5db5f2188137c8088f3433910cf48f6bb1e2eb6b
Parents: 4351977
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Feb 6 10:55:14 2018 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Feb 14 15:34:10 2018 -0500
----------------------------------------------------------------------
.../src/main/jython/radish/feature_steps.py | 3 +-
gremlin-test/features/sideEffect/Inject.feature | 17 ++++++++
gremlin-test/features/sideEffect/Sack.feature | 42 +++++++++++++++++++-
.../features/sideEffect/SideEffectCap.feature | 8 ++--
.../gremlin/process/FeatureCoverageTest.java | 15 +++++--
5 files changed, 76 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5db5f218/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 7c0525f..3ba88a2 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 Cardinality, P, Pop, Scope, Column, Order, Direction, T, Pick, Operator
+from gremlin_python.process.traversal import Barrier, Cardinality, P, Pop, Scope, Column, Order, Direction, T, Pick, Operator
from radish import given, when, then
from hamcrest import *
@@ -253,6 +253,7 @@ def _translate(traversal):
def _make_traversal(g, traversal_string, params):
b = {"g": g,
"__": __,
+ "Barrier": Barrier,
"Cardinality": Cardinality,
"Column": Column,
"Direction": Direction,
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5db5f218/gremlin-test/features/sideEffect/Inject.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Inject.feature b/gremlin-test/features/sideEffect/Inject.feature
index 61ffb58..740928d 100644
--- a/gremlin-test/features/sideEffect/Inject.feature
+++ b/gremlin-test/features/sideEffect/Inject.feature
@@ -49,3 +49,20 @@ Feature: Step - inject()
| p[v[marko],v[lop],lop,d[3].i] |
| p[v[marko],v[vadas],vadas,d[5].i] |
| p[v[marko],v[josh],josh,d[4].i] |
+
+ Scenario: g_VX1X_injectXg_VX4XX_out_name
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And using the parameter v4 defined as "v[josh]"
+ And the traversal of
+ """
+ g.V(v1Id).inject(v4).out().values("name")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | ripple |
+ | lop |
+ | lop |
+ | vadas |
+ | josh |
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5db5f218/gremlin-test/features/sideEffect/Sack.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/Sack.feature b/gremlin-test/features/sideEffect/Sack.feature
index 73e65da..f5baf64 100644
--- a/gremlin-test/features/sideEffect/Sack.feature
+++ b/gremlin-test/features/sideEffect/Sack.feature
@@ -68,4 +68,44 @@ Feature: Step - sack()
Then nothing should happen because
"""
This API is deprecated - will not test.
- """
\ No newline at end of file
+ """
+
+ Scenario: g_withBulkXfalseX_withSackX1_sumX_VX1X_localXoutEXknowsX_barrierXnormSackX_inVX_inXknowsX_barrier_sack
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.withBulk(false).withSack(1.0, Operator.sum).V(v1Id).local(__.outE("knows").barrier(Barrier.normSack).inV()).in("knows").barrier().sack()
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[1.0].d |
+
+ Scenario: g_withBulkXfalseX_withSackX1_sumX_V_out_barrier_sack
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.withBulk(false).withSack(1, Operator.sum).V().out().barrier().sack()
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[3].l |
+ | d[1].l |
+ | d[1].l |
+ | d[1].l |
+
+ Scenario: g_withSackX1_sumX_VX1X_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.withSack(1.0, Operator.sum).V(v1Id).local(__.out("knows").barrier(Barrier.normSack)).in("knows").barrier().sack()
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[1.0].d |
+ | d[1.0].d |
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5db5f218/gremlin-test/features/sideEffect/SideEffectCap.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/sideEffect/SideEffectCap.feature b/gremlin-test/features/sideEffect/SideEffectCap.feature
index 6be2fdb..795db7e 100644
--- a/gremlin-test/features/sideEffect/SideEffectCap.feature
+++ b/gremlin-test/features/sideEffect/SideEffectCap.feature
@@ -17,17 +17,17 @@
Feature: Step - cap()
- Scenario: g_V_group_byXnameX
+ Scenario: g_V_hasXageX_groupCountXaX_byXnameX_out_capXaX
Given the modern graph
And the traversal of
"""
- g.V().group().by("name")
+ g.V().has("age").groupCount("a").by("name").out().cap("a")
"""
When iterated to list
Then the result should be unordered
| result |
- | m[{"ripple":"l[v[ripple]]", "vadas":"l[v[vadas]]", "lop":"l[v[lop]]", "peter": "l[v[peter]]", "josh": "l[v[josh]]", "marko":"l[v[marko]]"}] |
-
+ | m[{"peter":"d[1].i", "vadas":"d[1].i", "josh":"d[1].i", "marko": "d[1].i"}] |
+
Scenario: g_V_chooseXlabel_person__age_groupCountXaX__name_groupCountXbXX_capXa_bX
Given an unsupported test
Then nothing should happen because
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5db5f218/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 9e6ca72..28c6d77 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
@@ -126,7 +126,16 @@ public class FeatureCoverageTest {
"g_V_valueMap_selectXpop_a_bX",
"g_V_selectXaX",
// assertion doesn't seem to want to work right for embedded lists
- "g_V_asXa_bX_out_asXcX_path_selectXkeysX");
+ "g_V_asXa_bX_out_asXcX_path_selectXkeysX",
+ // probably need TINKERPOP-1877
+ "g_V_bothEXselfX",
+ "g_V_bothXselfX",
+ // ugh - BigInteger?
+ "g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack",
+ // ugh - clone
+ "g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack",
+ // wont round right or something
+ "g_withSackX2X_V_sackXdivX_byXconstantX3_0XX_sack");
@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")
@@ -192,7 +201,7 @@ public class FeatureCoverageTest {
InjectTest.class,
SackTest.class,
SideEffectCapTest.class,
- SideEffectTest.class,
+ //SideEffectTest.class,
StoreTest.class);
// SubgraphTest.class,
// TreeTest.class);
@@ -214,7 +223,7 @@ public class FeatureCoverageTest {
.map(Method::getName).collect(Collectors.toSet());
final File featureFile = new File(featureFileName);
- assertThat(featureFile.exists(), is(true));
+ assertThat("Where is: " + featureFileName, featureFile.exists(), is(true));
assertThat(featureFile.isFile(), is(true));
final Set<String> testsInFeatureFile = new HashSet<>();