You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2017/12/28 20:06:14 UTC
[1/6] tinkerpop git commit: TINKERPOP-1857 General test naming fixes
and other inconsistencies
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1857 [created] 8f3ac49d6
TINKERPOP-1857 General test naming fixes and other inconsistencies
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7796cec0
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7796cec0
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7796cec0
Branch: refs/heads/TINKERPOP-1857
Commit: 7796cec0e54c4c316d937118c64d9003be557f45
Parents: 9511dac
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Dec 27 13:18:15 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Dec 27 14:35:03 2017 -0500
----------------------------------------------------------------------
gremlin-test/features/branch/Union.feature | 2 +-
gremlin-test/features/filter/Filter.feature | 24 ++++++
gremlin-test/features/filter/Has.feature | 4 +-
.../traversal/step/branch/LocalTest.java | 2 +-
.../traversal/step/branch/RepeatTest.java | 2 +-
.../traversal/step/branch/UnionTest.java | 4 +-
.../process/traversal/step/filter/AndTest.java | 4 +-
.../traversal/step/filter/FilterTest.java | 9 ++-
.../gremlin/process/FeatureCoverageTest.java | 78 +++++++++++++++++++-
9 files changed, 117 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/features/branch/Union.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/branch/Union.feature b/gremlin-test/features/branch/Union.feature
index 30eb53c..564e6b5 100644
--- a/gremlin-test/features/branch/Union.feature
+++ b/gremlin-test/features/branch/Union.feature
@@ -121,7 +121,7 @@ Feature: Step - union()
| d[1.9].d |
| d[1].l |
- Scenario: get_g_VX1_2X_localXunionXoutE_count__inE_count__outE_weight_sumXX
+ Scenario: g_VX1_2X_localXunionXoutE_count__inE_count__outE_weight_sumXX
Given the modern graph
And using the parameter v1Id defined as "v[marko].id"
And using the parameter v2Id defined as "v[vadas].id"
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/features/filter/Filter.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Filter.feature b/gremlin-test/features/filter/Filter.feature
index 76a5d7d..b552578 100644
--- a/gremlin-test/features/filter/Filter.feature
+++ b/gremlin-test/features/filter/Filter.feature
@@ -57,6 +57,30 @@ Feature: Step - filter()
| v[ripple] |
| v[lop] |
+ Scenario: g_VX1X_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).filter(l1)
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_VX2X_filterXage_gt_30X
+ Given the modern graph
+ And using the parameter v2Id defined as "v[josh].id"
+ And using the parameter l1 defined as "c[it.get().property('age').orElse(0) > 30]"
+ And the traversal of
+ """
+ g.V(v2Id).filter(l1)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[josh] |
+
Scenario: g_VX1X_out_filterXage_gt_30X
Given the modern graph
And using the parameter v1Id defined as "v[marko].id"
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/features/filter/Has.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature
index 797a1ec..4240881 100644
--- a/gremlin-test/features/filter/Has.feature
+++ b/gremlin-test/features/filter/Has.feature
@@ -17,7 +17,7 @@
Feature: Step - has()
- Scenario: Use has() with P.gt()
+ Scenario: g_V_hasXage_gt_30X
Given the modern graph
And the traversal of
"""
@@ -29,7 +29,7 @@ Feature: Step - has()
| v[josh] |
| v[peter] |
- Scenario: Use hasId() with P
+ Scenario: g_V_in_hasIdXneqX1XX
Given the modern graph
And using the parameter v1 defined as "v[marko].id"
And the traversal of
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/LocalTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/LocalTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/LocalTest.java
index c202a9c..faec45e 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/LocalTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/LocalTest.java
@@ -86,7 +86,7 @@ public abstract class LocalTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_by() {
+ public void g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX() {
final Traversal<Vertex, Map<String, Object>> traversal = get_g_V_hasXlabel_personX_asXaX_localXoutXcreatedX_asXbXX_selectXa_bX_byXnameX_byXidX();
printTraversalForm(traversal);
int counter = 0;
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
index ae1220f..5a50ae8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatTest.java
@@ -281,7 +281,7 @@ public abstract class RepeatTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_VXX_hasXname_markoX_repeatXoutEXX_inVXX_simplePathXXX_untilXhasXname_rippleXX_limitX1X_pathXX_byXvaluesXnameXX_byXT_labelX() {
+ public void g_V_hasXname_markoX_repeatXoutE_inV_simplePathX_untilXhasXname_rippleXX_path_byXnameX_byXlabelX() {
final Traversal<Vertex, Path> traversal = get_g_V_hasXname_markoX_repeatXoutE_inV_simplePathX_untilXhasXname_rippleXX_path_byXnameX_byXlabelX();
printTraversalForm(traversal);
final Path path = traversal.next();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
index df52f9b..b440447 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/UnionTest.java
@@ -91,7 +91,7 @@ public abstract class UnionTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_chooseXlabel_eq_person__unionX__out_lang__out_nameX__in_labelX() {
+ public void g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX() {
final Traversal<Vertex, String> traversal = get_g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX();
printTraversalForm(traversal);
checkResults(new HashMap<String, Long>() {{
@@ -106,7 +106,7 @@ public abstract class UnionTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_chooseXlabel_eq_person__unionX__out_lang__out_nameX__in_labelX_groupCount() {
+ public void g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX_groupCount() {
final Traversal<Vertex, Map<String, Long>> traversal = get_g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX_groupCount();
printTraversalForm(traversal);
final Map<String, Long> groupCount = traversal.next();
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndTest.java
index 863b602..59a8ec8 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/AndTest.java
@@ -54,7 +54,7 @@ public abstract class AndTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_andXhasXage_gt_27X__outE_count_gt_2X_name() {
+ public void g_V_andXhasXage_gt_27X__outE_count_gte_2X_name() {
final Traversal<Vertex, String> traversal = get_g_V_andXhasXage_gt_27X__outE_count_gte_2X_name();
printTraversalForm(traversal);
checkResults(Arrays.asList("marko", "josh"), traversal);
@@ -62,7 +62,7 @@ public abstract class AndTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_V_andXout__hasXlabel_personX_and_hasXage_gte_32XX_name() {
+ public void g_V_andXoutE__hasXlabel_personX_and_hasXage_gte_32XX_name() {
final Traversal<Vertex, String> traversal = get_g_V_andXoutE__hasXlabel_personX_and_hasXage_gte_32XX_name();
printTraversalForm(traversal);
checkResults(Arrays.asList("josh", "peter"), traversal);
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/FilterTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/FilterTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/FilterTest.java
index d2e05b8..d8663df 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/FilterTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/FilterTest.java
@@ -103,10 +103,15 @@ public abstract class FilterTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void g_VX1X_filterXage_gt_30X() {
- Traversal<Vertex, Vertex> traversal = get_g_VX1X_filterXage_gt_30X(convertToVertexId("marko"));
+ final Traversal<Vertex, Vertex> traversal = get_g_VX1X_filterXage_gt_30X(convertToVertexId("marko"));
printTraversalForm(traversal);
assertFalse(traversal.hasNext());
- traversal = get_g_VX1X_filterXage_gt_30X(convertToVertexId("josh"));
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX2X_filterXage_gt_30X() {
+ final Traversal<Vertex, Vertex> traversal = get_g_VX1X_filterXage_gt_30X(convertToVertexId("josh"));
printTraversalForm(traversal);
assertTrue(traversal.hasNext());
assertEquals(Integer.valueOf(32), traversal.next().<Integer>value("age"));
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7796cec0/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 cc6e9bd..36b2b29 100644
--- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
+++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java
@@ -20,20 +20,55 @@ package org.apache.tinkerpop.gremlin.process;
import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.branch.OptionalTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.RepeatTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.branch.UnionTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CoinTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.CyclicPathTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DedupTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.DropTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.filter.FilterTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasTest;
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.filter.RangeTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SampleTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.SimplePathTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TailTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.WhereTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.CoalesceTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.ConstantTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.FlatMapTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.FoldTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.LoopsTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.MapTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.MaxTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.MeanTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.MinTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.OrderTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest;
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.PropertiesTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.UnfoldTest;
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;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapTest;
+import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectTest;
import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest;
import org.junit.Ignore;
import org.junit.Test;
@@ -66,7 +101,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")
+ // @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
@@ -74,24 +109,65 @@ public class FeatureCoverageTest {
// branch
BranchTest.class,
ChooseTest.class,
+ LocalTest.class,
OptionalTest.class,
+ RepeatTest.class,
+ UnionTest.class,
// filter
+ AndTest.class,
CoinTest.class,
+ CyclicPathTest.class,
+ DedupTest.class,
DropTest.class,
FilterTest.class,
+ HasTest.class,
IsTest.class,
OrTest.class,
+ RangeTest.class,
+ SampleTest.class,
+ SimplePathTest.class,
+ TailTest.class,
+ WhereTest.class,
// map
+ AddEdgeTest.class,
+ AddVertexTest.class,
+ CoalesceTest.class,
+ ConstantTest.class,
CountTest.class,
+ FlatMapTest.class,
+ FoldTest.class,
+ GraphTest.class,
+ LoopsTest.class,
+ MapTest.class,
+ MatchTest.class,
+ MaxTest.class,
+ MeanTest.class,
+ MinTest.class,
+ OrderTest.class,
+ PageRankTest.class,
PathTest.class,
+ // PeerPressureTest.class,
+ // ProfileTest.class,
+ // ProgramTest.class,
ProjectTest.class,
+ PropertiesTest.class,
+ SelectTest.class,
+ SumTest.class,
+ UnfoldTest.class,
ValueMapTest.class,
VertexTest.class,
// sideEffect
AggregateTest.class,
+ // ExplainTest.class,
GroupCountTest.class,
+ GroupTest.class,
InjectTest.class,
+ SackTest.class,
+ SideEffectCapTest.class,
+ SideEffectTest.class,
StoreTest.class);
+ // SubgraphTest.class,
+ // TreeTest.class);
final Field field = ProcessStandardSuite.class.getDeclaredField("testsToEnforce");
field.setAccessible(true);
[5/6] tinkerpop git commit: TINKERPOP-1857 Added ignore for a has()
test in the python GLV tests
Posted by sp...@apache.org.
TINKERPOP-1857 Added ignore for a has() test in the python GLV tests
Created TINKERPOP-1859 regarding bad bytecode generation for complex P instances
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1db5ff99
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1db5ff99
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1db5ff99
Branch: refs/heads/TINKERPOP-1857
Commit: 1db5ff9961aff543b2e44488371758c46978fb95
Parents: 10ec530
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 15:03:22 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Dec 28 15:03:22 2017 -0500
----------------------------------------------------------------------
gremlin-python/src/main/jython/radish/feature_steps.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1db5ff99/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 814d176..f9643ec 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -41,7 +41,8 @@ project = __.project
tail = __.tail
ignores = [
- "g.V(v1Id).out().inject(v2).values(\"name\")" # bug in attachment won't connect v2
+ "g.V(v1Id).out().inject(v2).values(\"name\")", # bug in attachment won't connect v2
+ "g.V().hasLabel(\"person\").has(\"age\", P.not(P.lte(d10).and(P.not(P.between(d11, d20)))).and(P.lt(d29).or(P.eq(d35)))).values(\"name\")" # TINKERPOP-1859
]
@@ -90,11 +91,17 @@ def translate_traversal(step):
@when("iterated to list")
def iterate_the_traversal(step):
+ if step.context.ignore:
+ return
+
step.context.result = map(lambda x: _convert_results(x), step.context.traversal.toList())
@when("iterated next")
def next_the_traversal(step):
+ if step.context.ignore:
+ return
+
step.context.result = map(lambda x: _convert_results(x), step.context.traversal.next())
[2/6] tinkerpop git commit: TINKERPOP-1857 Improved handling of empty
graph in python glv tests
Posted by sp...@apache.org.
TINKERPOP-1857 Improved handling of empty graph in python glv tests
Caches were hardcoded to the modern graph. For empty graph this caused hassles because the cache couldn't be initialized until after the graph initializer step was executed. Still a bit messy due to cut/paste issues. Need to clean that up at a later point.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3ff2e0f1
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3ff2e0f1
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3ff2e0f1
Branch: refs/heads/TINKERPOP-1857
Commit: 3ff2e0f150368873c2db6d79a0cded3562cce146
Parents: 7796cec
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 11:18:38 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Dec 28 11:18:38 2017 -0500
----------------------------------------------------------------------
.../src/main/jython/radish/feature_steps.py | 78 +++++++++++++++-----
.../src/main/jython/radish/terrain.py | 7 +-
2 files changed, 63 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3ff2e0f1/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 5cb4b9a..72ec4c4 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -34,6 +34,11 @@ regex_is = re.compile(r"([(.,\s])is\(")
regex_not = re.compile(r"([(.,\s])not\(")
regex_or = re.compile(r"([(.,\s])or\(")
+outV = __.outV
+label = __.label
+inV = __.inV
+project = __.project
+tail = __.tail
ignores = [
"g.V(v1Id).out().inject(v2).values(\"name\")" # bug in attachment won't connect v2
@@ -42,6 +47,7 @@ ignores = [
@given("the {graph_name:w} graph")
def choose_graph(step, graph_name):
+ step.context.graph_name = graph_name
step.context.g = Graph().traversal().withRemote(step.context.remote_conn[graph_name])
@@ -52,7 +58,12 @@ def initialize_graph(step):
# just be sure that the traversal returns something to prove that it worked to some degree. probably
# is overkill to try to assert the complete success of this init operation. presumably the test
# suite would fail elsewhere if this didn't work which would help identify a problem.
- assert len(traversal.toList()) > 0
+ result = traversal.toList()
+ assert len(result) > 0
+
+ # add the first result - if a map - to the bindings. this is useful for cases when parameters for
+ # the test traversal need to come from the original graph initializer (i.e. a new graph is created
+ # and you need the id of a vertex from that graph)
@given("an unsupported test")
@@ -125,42 +136,52 @@ def nothing_happening(step):
def _convert(val, ctx):
- if isinstance(val, dict): # convert dictionary keys/values
+ graph_name = ctx.graph_name
+ if isinstance(val, dict): # convert dictionary keys/values
n = {}
for key, value in val.items():
n[_convert(key, ctx)] = _convert(value, ctx)
return n
- elif isinstance(val, unicode): # convert annoying python 2.x unicode nonsense
+ elif isinstance(val, unicode): # convert annoying python 2.x unicode nonsense
return _convert(val.encode('utf-8'), ctx)
- elif isinstance(val, str) and re.match("^l\[.*\]$", val): # parse list
+ 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
+ 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\[.*\]\.[ilfdm]$", val): # parse numeric
return float(val[2:-3]) if val[2:-3].__contains__(".") else long(val[2:-3])
- 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
- return ctx.lookup_v["modern"][val[2:-5]].id
- elif isinstance(val, str) and re.match("^v\[.*\]$", val): # parse vertex
- return ctx.lookup_v["modern"][val[2:-1]]
- elif isinstance(val, str) and re.match("^e\[.*\]\.id$", val): # parse edge id
- return ctx.lookup_e["modern"][val[2:-4]].id
- elif isinstance(val, str) and re.match("^e\[.*\]\.sid$", val): # parse edge id as string
- return ctx.lookup_e["modern"][val[2:-5]].id
- 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
+ elif isinstance(val, str) and re.match("^v\[.*\]\.id$", val): # parse vertex id
+ return __find_cached_element(ctx, graph_name, val[2:-4], "v").id
+ elif isinstance(val, str) and re.match("^v\[.*\]\.sid$", val): # parse vertex id as string
+ return __find_cached_element(ctx, graph_name, val[2:-5], "v").id
+ elif isinstance(val, str) and re.match("^v\[.*\]$", val): # parse vertex
+ return __find_cached_element(ctx, graph_name, val[2:-1], "v")
+ elif isinstance(val, str) and re.match("^e\[.*\]\.id$", val): # parse edge id
+ return __find_cached_element(ctx, graph_name, val[2:-4], "e").id
+ elif isinstance(val, str) and re.match("^e\[.*\]\.sid$", val): # parse edge id as string
+ return __find_cached_element(ctx, graph_name, val[2:-5], "e").id
+ elif isinstance(val, str) and re.match("^e\[.*\]$", val): # parse edge
+ return __find_cached_element(ctx, graph_name, val[2:-1], "e")
+ elif isinstance(val, str) and re.match("^m\[.*\]$", val): # parse json as a map
return _convert(json.loads(val[2:-1].replace('\\"', '"')), ctx)
- elif isinstance(val, str) and re.match("^p\[.*\]$", val): # parse path
+ 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)
- elif isinstance(val, str) and re.match("^c\[.*\]$", val): # parse lambda/closure
+ elif isinstance(val, str) and re.match("^c\[.*\]$", val): # parse lambda/closure
return lambda: (val[2:-1], "gremlin-groovy")
else:
return val
+def __find_cached_element(ctx, graph_name, identifier, element_type):
+ if graph_name == "empty":
+ cache = __create_lookup_v(ctx.remote_conn["empty"]) if element_type == "v" else __create_lookup_e(ctx.remote_conn["empty"])
+ else:
+ cache = ctx.lookup_v[graph_name] if element_type == "v" else ctx.lookup_e[graph_name]
+
+ return cache[identifier]
+
+
def _convert_results(val):
if isinstance(val, Path):
# kill out labels as they aren't in the assertion logic
@@ -228,3 +249,20 @@ def _make_traversal(g, traversal_string, params):
b.update(params)
return eval(_translate(traversal_string), b)
+
+
+def __create_lookup_v(remote):
+ g = Graph().traversal().withRemote(remote)
+
+ # hold a map of name/vertex for use in asserting results
+ return g.V().group().by('name').by(tail()).next()
+
+
+def __create_lookup_e(remote):
+ g = Graph().traversal().withRemote(remote)
+
+ # hold a map of the "name"/edge for use in asserting results - "name" in this context is in the form of
+ # outgoingV-label->incomingV
+ return g.E().group(). \
+ by(lambda: ("it.outVertex().value('name') + '-' + it.label() + '->' + it.inVertex().value('name')", "gremlin-groovy")). \
+ by(tail()).next()
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3ff2e0f1/gremlin-python/src/main/jython/radish/terrain.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/radish/terrain.py b/gremlin-python/src/main/jython/radish/terrain.py
index 0c749eb..9aed647 100644
--- a/gremlin-python/src/main/jython/radish/terrain.py
+++ b/gremlin-python/src/main/jython/radish/terrain.py
@@ -17,7 +17,6 @@ specific language governing permissions and limitations
under the License.
'''
-import re
from gremlin_python.structure.graph import Graph
from gremlin_python.process.graph_traversal import __
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
@@ -58,6 +57,10 @@ def prepare_static_traversal_source(features, marker):
scenario.context.lookup_v[graph_name] = cache[graph_name]["lookup_v"]
scenario.context.lookup_e[graph_name] = cache[graph_name]["lookup_e"]
+ # setup the "empty" lookups as needed
+ scenario.context.lookup_v["empty"] = {}
+ scenario.context.lookup_e["empty"] = {}
+
@before.each_scenario
def prepare_traversal_source(scenario):
@@ -97,4 +100,4 @@ def __create_lookup_e(remote):
# outgoingV-label->incomingV
return g.E().group(). \
by(lambda: ("it.outVertex().value('name') + '-' + it.label() + '->' + it.inVertex().value('name')", "gremlin-groovy")). \
- by(tail()).next()
+ by(tail()).next()
\ No newline at end of file
[3/6] tinkerpop git commit: TINKERPOP-1857 Python GLV tests were not
string-ing IDs
Posted by sp...@apache.org.
TINKERPOP-1857 Python GLV tests were not string-ing IDs
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2f8248e7
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2f8248e7
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2f8248e7
Branch: refs/heads/TINKERPOP-1857
Commit: 2f8248e71e92b880f31847506fd9fd901f012af0
Parents: 3ff2e0f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 11:25:06 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Dec 28 11:25:06 2017 -0500
----------------------------------------------------------------------
gremlin-python/src/main/jython/radish/feature_steps.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2f8248e7/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 72ec4c4..814d176 100644
--- a/gremlin-python/src/main/jython/radish/feature_steps.py
+++ b/gremlin-python/src/main/jython/radish/feature_steps.py
@@ -153,13 +153,13 @@ def _convert(val, ctx):
elif isinstance(val, str) and re.match("^v\[.*\]\.id$", val): # parse vertex id
return __find_cached_element(ctx, graph_name, val[2:-4], "v").id
elif isinstance(val, str) and re.match("^v\[.*\]\.sid$", val): # parse vertex id as string
- return __find_cached_element(ctx, graph_name, val[2:-5], "v").id
+ return str(__find_cached_element(ctx, graph_name, val[2:-5], "v").id)
elif isinstance(val, str) and re.match("^v\[.*\]$", val): # parse vertex
return __find_cached_element(ctx, graph_name, val[2:-1], "v")
elif isinstance(val, str) and re.match("^e\[.*\]\.id$", val): # parse edge id
return __find_cached_element(ctx, graph_name, val[2:-4], "e").id
elif isinstance(val, str) and re.match("^e\[.*\]\.sid$", val): # parse edge id as string
- return __find_cached_element(ctx, graph_name, val[2:-5], "e").id
+ return str(__find_cached_element(ctx, graph_name, val[2:-5], "e").id)
elif isinstance(val, str) and re.match("^e\[.*\]$", val): # parse edge
return __find_cached_element(ctx, graph_name, val[2:-1], "e")
elif isinstance(val, str) and re.match("^m\[.*\]$", val): # parse json as a map
[4/6] tinkerpop git commit: TINKERPOP-1857 Generation of P for python
was incorrect
Posted by sp...@apache.org.
TINKERPOP-1857 Generation of P for python was incorrect
The template was generating not() bytecode with the python naming of not_(). There were also duplicate functions in the template that needed to be removed.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/10ec530f
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/10ec530f
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/10ec530f
Branch: refs/heads/TINKERPOP-1857
Commit: 10ec530f097ba40b90b33763c98d609231d5b1fd
Parents: 2f8248e
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 15:00:54 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Dec 28 15:00:54 2017 -0500
----------------------------------------------------------------------
gremlin-python/glv/TraversalSource.template | 14 ++++----------
.../main/jython/gremlin_python/process/traversal.py | 14 ++++----------
2 files changed, 8 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ec530f/gremlin-python/glv/TraversalSource.template
----------------------------------------------------------------------
diff --git a/gremlin-python/glv/TraversalSource.template b/gremlin-python/glv/TraversalSource.template
index 66ea940..b6f5b9f 100644
--- a/gremlin-python/glv/TraversalSource.template
+++ b/gremlin-python/glv/TraversalSource.template
@@ -112,26 +112,20 @@ class P(object):
self.operator = operator
self.value = value
self.other = other
-
<% pmethods.each { method -> %>
@staticmethod
def <%= method %>(*args):
- return P("<%= toPython.call(method) %>", *args)
+ return P("<%= toJava.call(method) %>", *args)
<% } %>
def and_(self, arg):
return P("and", self, arg)
+
def or_(self, arg):
return P("or", self, arg)
+
def __eq__(self, other):
return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
- def __repr__(self):
- return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
- def and_(self, arg):
- return P("and", self, arg)
- def or_(self, arg):
- return P("or", self, arg)
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
+
def __repr__(self):
return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
<% pmethods.findAll{!it.equals("clone")}.each { method -> %>
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/10ec530f/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
index 69275fb..747ed81 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
@@ -186,7 +186,6 @@ class P(object):
self.value = value
self.other = other
-
@staticmethod
def between(*args):
return P("between", *args)
@@ -221,7 +220,7 @@ class P(object):
@staticmethod
def not_(*args):
- return P("not_", *args)
+ return P("not", *args)
@staticmethod
def outside(*args):
@@ -241,18 +240,13 @@ class P(object):
def and_(self, arg):
return P("and", self, arg)
+
def or_(self, arg):
return P("or", self, arg)
+
def __eq__(self, other):
return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
- def __repr__(self):
- return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
- def and_(self, arg):
- return P("and", self, arg)
- def or_(self, arg):
- return P("or", self, arg)
- def __eq__(self, other):
- return isinstance(other, self.__class__) and self.operator == other.operator and self.value == other.value and self.other == other.other
+
def __repr__(self):
return self.operator + "(" + str(self.value) + ")" if self.other is None else self.operator + "(" + str(self.value) + "," + str(self.other) + ")"
[6/6] tinkerpop git commit: TINKERPOP-1857 Added more has() tests to
the GLV suite.
Posted by sp...@apache.org.
TINKERPOP-1857 Added more has() tests to the GLV suite.
Fixed some consistency problems in the java test itself.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8f3ac49d
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8f3ac49d
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8f3ac49d
Branch: refs/heads/TINKERPOP-1857
Commit: 8f3ac49d64ec0bcb44440b0c2601021c9db49578
Parents: 1db5ff9
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Dec 28 15:05:07 2017 -0500
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Dec 28 15:05:07 2017 -0500
----------------------------------------------------------------------
gremlin-test/features/filter/Has.feature | 315 ++++++++++++++++++-
.../process/traversal/step/filter/HasTest.java | 37 ++-
2 files changed, 340 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f3ac49d/gremlin-test/features/filter/Has.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/filter/Has.feature b/gremlin-test/features/filter/Has.feature
index 4240881..6fb43c4 100644
--- a/gremlin-test/features/filter/Has.feature
+++ b/gremlin-test/features/filter/Has.feature
@@ -17,6 +17,82 @@
Feature: Step - has()
+ Scenario: g_V_outXcreatedX_hasXname__mapXlengthX_isXgtX3XXX_name
+ Given the modern graph
+ And using the parameter l1 defined as "c[it.get().length()]"
+ And the traversal of
+ """
+ g.V().out("created").has("name", __.map(l1).is(P.gt(3))).values("name")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | ripple |
+
+ Scenario: g_VX1X_hasXnameX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.V(v1Id).has("name")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[marko] |
+
+ Scenario: g_VX1X_hasXcircumferenceX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.V(v1Id).has("circumference")
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_VX1X_hasXname_markoX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.V(v1Id).has("name", "marko")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[marko] |
+
+ Scenario: g_VX2X_hasXname_markoX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[vadas].id"
+ And the traversal of
+ """
+ g.V(v1Id).has("name", "marko")
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_V_hasXname_markoX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().has("name", "marko")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[marko] |
+
+ Scenario: g_V_hasXname_blahX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().has("name", "blah")
+ """
+ When iterated to list
+ Then the result should be empty
+
Scenario: g_V_hasXage_gt_30X
Given the modern graph
And the traversal of
@@ -29,12 +105,247 @@ Feature: Step - has()
| v[josh] |
| v[peter] |
+ Scenario: g_V_hasXage_isXgt_30XX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().has("age", __.is(P.gt(30)))
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[josh] |
+ | v[peter] |
+
+ Scenario: g_VX1X_hasXage_gt_30X
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.V(v1Id).has("age", P.gt(30))
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_VX2X_hasXage_gt_30X
+ Given the modern graph
+ And using the parameter v2Id defined as "v[josh].id"
+ And the traversal of
+ """
+ g.V(v2Id).has("age", P.gt(30))
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[josh] |
+
+ Scenario: g_VXv1X_hasXage_gt_30X
+ Given the modern graph
+ And using the parameter v1 defined as "v[marko]"
+ And the traversal of
+ """
+ g.V(v1).has("age", P.gt(30))
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_VXv2X_hasXage_gt_30X
+ Given the modern graph
+ And using the parameter v2 defined as "v[josh]"
+ And the traversal of
+ """
+ g.V(v2).has("age", P.gt(30))
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[josh] |
+
+ Scenario: g_VX1X_out_hasIdX2X
+ 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).out().hasId(v2Id)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[vadas] |
+
+ Scenario: g_VX1X_out_hasXid_2AsString_3AsStringX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].sid"
+ And using the parameter v2Id defined as "v[vadas].sid"
+ And using the parameter v3Id defined as "v[lop].sid"
+ And the traversal of
+ """
+ g.V(v1Id).out().hasId(v2Id, v3Id)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[vadas] |
+ | v[lop] |
+
+ Scenario: g_V_hasXblahX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().has("blah")
+ """
+ When iterated to list
+ Then the result should be empty
+
+ Scenario: g_EX7X_hasXlabelXknowsX
+ Given the modern graph
+ And using the parameter e7Id defined as "e[marko-knows->vadas].id"
+ And the traversal of
+ """
+ g.E(e7Id).hasLabel("knows")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | e[marko-knows->vadas] |
+
+ Scenario: g_E_hasXlabelXknowsX
+ Given the modern graph
+ And the traversal of
+ """
+ g.E().hasLabel("knows")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | e[marko-knows->vadas] |
+ | e[marko-knows->josh] |
+
+ Scenario: g_E_hasLabelXuses_traversesX
+ Given the crew graph
+ And the traversal of
+ """
+ g.E().hasLabel("uses", "traverses")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | e[marko-uses->gremlin] |
+ | e[marko-uses->tinkergraph] |
+ | e[stephen-uses->gremlin] |
+ | e[stephen-uses->tinkergraph] |
+ | e[daniel-uses->gremlin] |
+ | e[daniel-uses->tinkergraph] |
+ | e[matthias-uses->gremlin] |
+ | e[matthias-uses->tinkergraph] |
+ | e[gremlin-traverses->tinkergraph] |
+
+ Scenario: g_V_hasLabelXperson_software_blahX
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().hasLabel("person","software", "blah")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[marko] |
+ | v[vadas] |
+ | v[josh] |
+ | v[peter] |
+ | v[lop] |
+ | v[ripple] |
+
+ Scenario: g_V_hasXperson_name_markoX_age
+ Given the modern graph
+ And the traversal of
+ """
+ g.V().has("person", "name", "marko").values("age")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | d[29].i |
+
+ Scenario: g_VX1X_outE_hasXweight_inside_0_06X_inV
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And using the parameter lower defined as "d[0.0].d"
+ And using the parameter upper defined as "d[0.6].d"
+ And the traversal of
+ """
+ g.V(v1Id).outE().has("weight", P.inside(lower, upper)).inV()
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[vadas] |
+ | v[lop] |
+
+ Scenario: g_EX11X_outV_outE_hasXid_10X
+ Given the modern graph
+ And using the parameter e11Id defined as "e[josh-created->lop].id"
+ And using the parameter e10Id defined as "e[josh-created->ripple].id"
+ And the traversal of
+ """
+ g.E(e11Id).outV().outE().has(T.id, e10Id)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | e[josh-created->ripple] |
+
+ Scenario: g_EX11X_outV_outE_hasXid_10AsStringX
+ Given the modern graph
+ And using the parameter e11Id defined as "e[josh-created->lop].sid"
+ And using the parameter e10Id defined as "e[josh-created->ripple].sid"
+ And the traversal of
+ """
+ g.E(e11Id).outV().outE().has(T.id, e10Id)
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | e[josh-created->ripple] |
+
+ Scenario: g_V_hasXlocationX
+ Given the crew graph
+ And the traversal of
+ """
+ g.V().has("location")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | v[marko] |
+ | v[matthias] |
+ | v[stephen] |
+ | v[daniel] |
+
+ Scenario: g_V_hasLabelXpersonX_hasXage_notXlteX10X_andXnotXbetweenX11_20XXXX_andXltX29X_orXeqX35XXXX_name
+ Given the modern graph
+ And using the parameter d10 defined as "d[10].i"
+ And using the parameter d11 defined as "d[11].i"
+ And using the parameter d20 defined as "d[20].i"
+ And using the parameter d29 defined as "d[29].i"
+ And using the parameter d35 defined as "d[35].i"
+ And the traversal of
+ """
+ g.V().hasLabel("person").has("age", P.not(P.lte(d10).and(P.not(P.between(d11, d20)))).and(P.lt(d29).or(P.eq(d35)))).values("name")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | vadas |
+ | peter |
+
Scenario: g_V_in_hasIdXneqX1XX
Given the modern graph
- And using the parameter v1 defined as "v[marko].id"
+ And using the parameter v1Id defined as "v[marko].id"
And the traversal of
"""
- g.V().in().hasId(P.neq(v1))
+ g.V().in().hasId(P.neq(v1Id))
"""
When iterated to list
Then the result should be unordered
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8f3ac49d/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
index d8457f1..ade6a0b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/HasTest.java
@@ -127,13 +127,17 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_VX1X_hasXkeyX() {
- Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXkeyX(convertToVertexId("marko"), "name");
+ public void g_VX1X_hasXnameX() {
+ final Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXkeyX(convertToVertexId("marko"), "name");
printTraversalForm(traversal);
assertEquals("marko", traversal.next().<String>value("name"));
assertFalse(traversal.hasNext());
- //
- traversal = get_g_VX1X_hasXkeyX(convertToVertexId("marko"), "circumference");
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX1X_hasXcircumferenceX() {
+ final Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXkeyX(convertToVertexId("marko"), "circumference");
printTraversalForm(traversal);
assertFalse(traversal.hasNext());
}
@@ -141,11 +145,16 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void g_VX1X_hasXname_markoX() {
- Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXname_markoX(convertToVertexId("marko"));
+ final Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXname_markoX(convertToVertexId("marko"));
printTraversalForm(traversal);
assertEquals("marko", traversal.next().<String>value("name"));
assertFalse(traversal.hasNext());
- traversal = get_g_VX1X_hasXname_markoX(convertToVertexId("vadas"));
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX2X_hasXname_markoX() {
+ final Traversal<Vertex, Vertex> traversal = get_g_VX1X_hasXname_markoX(convertToVertexId("vadas"));
printTraversalForm(traversal);
assertFalse(traversal.hasNext());
}
@@ -197,6 +206,11 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
final Traversal<Vertex, Vertex> traversalMarko = get_g_VX1X_hasXage_gt_30X(convertToVertexId("marko"));
printTraversalForm(traversalMarko);
assertFalse(traversalMarko.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX2X_hasXage_gt_30X() {
final Traversal<Vertex, Vertex> traversalJosh = get_g_VX1X_hasXage_gt_30X(convertToVertexId("josh"));
printTraversalForm(traversalJosh);
assertTrue(traversalJosh.hasNext());
@@ -208,6 +222,11 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
final Traversal<Vertex, Vertex> traversalMarko = get_g_VXv1X_hasXage_gt_30X(convertToVertexId("marko"));
printTraversalForm(traversalMarko);
assertFalse(traversalMarko.hasNext());
+ }
+
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VXv2X_hasXage_gt_30X() {
final Traversal<Vertex, Vertex> traversalJosh = get_g_VXv1X_hasXage_gt_30X(convertToVertexId("josh"));
printTraversalForm(traversalJosh);
assertTrue(traversalJosh.hasNext());
@@ -275,7 +294,6 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void g_V_hasXblahX() {
- //assumeTrue(graphMeetsTestRequirements());
final Traversal<Vertex, Vertex> traversal = get_g_V_hasXblahX();
printTraversalForm(traversal);
assertFalse(traversal.hasNext());
@@ -285,7 +303,6 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void g_EX7X_hasXlabelXknowsX() {
- //System.out.println(convertToEdgeId("marko", "knows", "vadas"));
final Traversal<Edge, Edge> traversal = get_g_EX7X_hasLabelXknowsX(convertToEdgeId("marko", "knows", "vadas"));
printTraversalForm(traversal);
int counter = 0;
@@ -492,8 +509,8 @@ public abstract class HasTest extends AbstractGremlinProcessTest {
public static class Traversals extends HasTest {
@Override
- public Traversal<Edge, Edge> get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e8Id) {
- return g.E(e11Id).outV().outE().has(T.id, e8Id);
+ public Traversal<Edge, Edge> get_g_EX11X_outV_outE_hasXid_10X(final Object e11Id, final Object e10Id) {
+ return g.E(e11Id).outV().outE().has(T.id, e10Id);
}
@Override