You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2017/03/16 15:26:48 UTC
tinkerpop git commit: added to()/from() test support for cyclicPath()
and added to()/from() example to the-traversal.asciidoc.
Repository: tinkerpop
Updated Branches:
refs/heads/TINKERPOP-1387 65b3ad06b -> 936344f33
added to()/from() test support for cyclicPath() and added to()/from() example to the-traversal.asciidoc.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/936344f3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/936344f3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/936344f3
Branch: refs/heads/TINKERPOP-1387
Commit: 936344f33f62fd3b3d7adee6bf0bf8fb11b8e5e5
Parents: 65b3ad0
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Mar 16 09:26:45 2017 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Mar 16 09:26:45 2017 -0600
----------------------------------------------------------------------
docs/src/reference/the-traversal.asciidoc | 8 ++++++++
.../step/filter/GroovyCyclicPathTest.groovy | 6 ++++++
.../traversal/step/filter/CyclicPathTest.java | 16 +++++++++++++++-
3 files changed, 29 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/936344f3/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index eb93950..75d740f 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -584,6 +584,14 @@ traversal computation. If non-cyclic behavior is desired, see <<simplepath-step,
g.V(1).both().both()
g.V(1).both().both().cyclicPath()
g.V(1).both().both().cyclicPath().path()
+g.V(1).as('a').out('created').as('b').
+ in('created').as('c').
+ cyclicPath().
+ path()
+g.V(1).as('a').out('created').as('b').
+ in('created').as('c').
+ cyclicPath().from('a').to('b').
+ path()
----
[[dedup-step]]
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/936344f3/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
index 7479e21..d18e677 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/filter/GroovyCyclicPathTest.groovy
@@ -39,5 +39,11 @@ public abstract class GroovyCyclicPathTest {
Traversal<Vertex, Path> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path(final Object v1Id) {
new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).out('created').in('created').cyclicPath().path()", "v1Id", v1Id);
}
+
+ @Override
+ public Traversal<Vertex, Path> get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(
+ final Object v1Id) {
+ new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id).as('a').out('created').as('b').in('created').as('c').cyclicPath.from('a').to('b').path", "v1Id", v1Id)
+ }
}
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/936344f3/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
index 33a3a6e..6d9fef5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/filter/CyclicPathTest.java
@@ -23,7 +23,6 @@ import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
import org.apache.tinkerpop.gremlin.process.traversal.Path;
import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -42,6 +41,8 @@ public abstract class CyclicPathTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, Path> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path(final Object v1);
+ public abstract Traversal<Vertex, Path> get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(final Object v1Id);
+
@Test
@LoadGraphWith(MODERN)
public void g_VX1X_outXcreatedX_inXcreatedX_cyclicPath() {
@@ -72,6 +73,14 @@ public abstract class CyclicPathTest extends AbstractGremlinProcessTest {
assertFalse(traversal.hasNext());
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path() {
+ final Traversal<Vertex, Path> traversal = get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(convertToVertexId("marko"));
+ printTraversalForm(traversal);
+ assertFalse(traversal.hasNext());
+ }
+
public static class Traversals extends CyclicPathTest {
@Override
public Traversal<Vertex, Vertex> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath(final Object v1Id) {
@@ -82,5 +91,10 @@ public abstract class CyclicPathTest extends AbstractGremlinProcessTest {
public Traversal<Vertex, Path> get_g_VX1X_outXcreatedX_inXcreatedX_cyclicPath_path(final Object v1Id) {
return g.V(v1Id).out("created").in("created").cyclicPath().path();
}
+
+ @Override
+ public Traversal<Vertex, Path> get_g_VX1X_asXaX_outXcreatedX_asXbX_inXcreatedX_asXcX_cyclicPath_fromXaX_toXbX_path(final Object v1Id) {
+ return g.V(v1Id).as("a").out("created").as("b").in("created").as("c").cyclicPath().from("a").to("b").path();
+ }
}
}