You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2018/03/07 15:48:42 UTC
[48/50] tinkerpop git commit: added new test case to verify new
select scope order
added new test case to verify new select scope order
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5535e5b3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5535e5b3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5535e5b3
Branch: refs/heads/TINKERPOP-1522
Commit: 5535e5b364ebe0064ffb4bfda234f1c5a19e5353
Parents: 24f629b
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Mon Feb 26 11:19:21 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Wed Mar 7 08:36:39 2018 -0700
----------------------------------------------------------------------
gremlin-test/features/map/Select.feature | 18 +++++++++++++++++-
.../process/traversal/step/map/SelectTest.java | 15 +++++++--------
2 files changed, 24 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5535e5b3/gremlin-test/features/map/Select.feature
----------------------------------------------------------------------
diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature
index 35d9322..bf0a890 100644
--- a/gremlin-test/features/map/Select.feature
+++ b/gremlin-test/features/map/Select.feature
@@ -204,6 +204,22 @@ Feature: Step - select()
| v[ripple] |
| v[peter] |
+ Scenario: g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX
+ Given the modern graph
+ And using the parameter v1Id defined as "v[marko].id"
+ And the traversal of
+ """
+ g.V(v1Id).group("a").
+ by(__.constant("a")).
+ by(__.values("name")).
+ barrier().
+ select("a").select("a")
+ """
+ When iterated to list
+ Then the result should be unordered
+ | result |
+ | marko |
+
Scenario: g_VX1X_asXhereX_out_selectXhereX
Given the modern graph
And using the parameter v1Id defined as "v[marko].id"
@@ -514,4 +530,4 @@ Feature: Step - select()
Then the result should be unordered
| result |
| d[2].l |
- | d[2].l |
\ No newline at end of file
+ | d[2].l |
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5535e5b3/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
index 3ca2068..6a7a43b 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java
@@ -83,7 +83,7 @@ public abstract class SelectTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Vertex> get_g_V_chooseXoutE_count_isX0X__asXaX__asXbXX_chooseXselectXaX__selectXaX__selectXbXX();
- public abstract Traversal<Integer, String> get_g_withSideEffectXa_a_markoX_injectX1X_selectXaX_select_XaX();
+ public abstract Traversal<Vertex, String> get_g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX(final Object v1Id);
// below are original back()-tests
@@ -345,8 +345,8 @@ public abstract class SelectTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
- public void g_withSideEffectXa_a_markoX_injectX1X_selectXaX_select_XaX() {
- final Traversal<Integer, String> traversal = get_g_withSideEffectXa_a_markoX_injectX1X_selectXaX_select_XaX();
+ public void g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX() {
+ final Traversal<Vertex, String> traversal = get_g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX(convertToVertexId("marko"));
printTraversalForm(traversal);
assertTrue(traversal.hasNext());
assertEquals("marko", traversal.next());
@@ -658,7 +658,6 @@ public abstract class SelectTest extends AbstractGremlinProcessTest {
}
assertFalse(traversal.hasNext());
}
-
@Test
@LoadGraphWith(MODERN)
public void g_VX1X_asXaX_repeatXout_asXaXX_timesX2X_selectXfirst_aX() {
@@ -734,10 +733,10 @@ public abstract class SelectTest extends AbstractGremlinProcessTest {
return g.V().choose(__.outE().count().is(0L), __.as("a"), __.as("b")).choose(__.select("a"), __.select("a"), __.select("b"));
}
- public Traversal<Integer, String> get_g_withSideEffectXa_a_markoX_injectX1X_selectXaX_select_XaX() {
- final Map<String, String> m = new HashMap<>(1);
- m.put("a", "marko");
- return g.withSideEffect("a", m).inject(1).select("a").select("a");
+ public Traversal<Vertex, String> get_g_VX1X_groupXaX_byXconstantXaXX_byXnameX_selectXaX_selectXaX(final Object v1Id) {
+ return g.V(v1Id).group("a").by(__.constant("a")).by(__.values("name"))
+ .barrier() // TODO: this barrier() should not be necessary
+ .select("a").select("a");
}
// below are original back()-tests