tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject incubator-tinkerpop git commit: added a VertexTest for g.V(1, 2, blah, 3).name to ensure that 1, 2, 3 are returned. CTR.
Date Wed, 18 May 2016 14:13:46 GMT
Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/tp31 6148e3364 -> 3feb7526d


added a VertexTest for g.V(1,2,blah,3).name to ensure that 1,2,3 are returned. CTR.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/3feb7526
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/3feb7526
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/3feb7526

Branch: refs/heads/tp31
Commit: 3feb7526d32ea07e7874f71480ff8873b9080b08
Parents: 6148e33
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Wed May 18 08:13:58 2016 -0600
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Wed May 18 08:13:58 2016 -0600

----------------------------------------------------------------------
 .../traversal/step/map/GroovyVertexTest.groovy  |  7 +++++
 .../process/traversal/step/map/VertexTest.java  | 31 ++++++++++++++++++--
 2 files changed, 35 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3feb7526/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
index 34a567e..7b8974c 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
@@ -169,5 +169,12 @@ public abstract class GroovyVertexTest {
         public Traversal<Vertex, Vertex> get_g_VX1X_to_XOUT_knowsX(final Object v1Id)
{
             TraversalScriptHelper.compute("g.V(v1Id).to(Direction.OUT, 'knows')", g, "v1Id",
v1Id);
         }
+
+        @Override
+        public Traversal<Vertex, String> get_g_VX1_2_3_4X_name(
+                final Object v1Id, final Object v2Id, final Object v3Id, final Object v4Id)
{
+            g.V(v3Id).drop().iterate();
+            TraversalScriptHelper.compute("g.V(v1Id, v2Id, v4Id, v3Id).name", g, "v1Id",
v1Id, "v2Id", v2Id, "v3Id", v3Id, "v4Id", v4Id);
+        }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/3feb7526/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
index a521027..063af97 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
@@ -18,13 +18,17 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.step.map;
 
+import org.apache.tinkerpop.gremlin.FeatureRequirement;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
 import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner;
+import org.apache.tinkerpop.gremlin.process.IgnoreEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.structure.Direction;
 import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -37,7 +41,9 @@ import java.util.Map;
 import java.util.Set;
 
 import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -103,12 +109,14 @@ public abstract class VertexTest extends AbstractGremlinProcessTest
{
 
     public abstract Traversal<Vertex, Vertex> get_g_VX1X_to_XOUT_knowsX(final Object
v1Id);
 
+    public abstract Traversal<Vertex, String> get_g_VX1_2_3_4X_name(final Object v1Id,
final Object v2Id, final Object v3Id, final Object v4Id);
+
     // GRAPH VERTEX/EDGE
 
     @Test
     @LoadGraphWith(MODERN)
     public void g_VXlistX1_2_3XX_name() {
-        final Traversal<Vertex,String> traversal = get_g_VXlistX1_2_3XX_name();
+        final Traversal<Vertex, String> traversal = get_g_VXlistX1_2_3XX_name();
         printTraversalForm(traversal);
         checkResults(Arrays.asList("marko", "vadas", "lop"), traversal);
     }
@@ -116,7 +124,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(MODERN)
     public void g_VXlistXv1_v2_v3XX_name() {
-        final Traversal<Vertex,String> traversal = get_g_VXlistXv1_v2_v3XX_name();
+        final Traversal<Vertex, String> traversal = get_g_VXlistXv1_v2_v3XX_name();
         printTraversalForm(traversal);
         checkResults(Arrays.asList("marko", "vadas", "lop"), traversal);
     }
@@ -539,6 +547,17 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         assertFalse(traversal.hasNext());
     }
 
+    @Test
+    @LoadGraphWith
+    @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_REMOVE_VERTICES)
+    @IgnoreEngine(TraversalEngine.Type.COMPUTER)
+    public void g_VX1_2_3_4X_name() {
+        final Traversal<Vertex, String> traversal = get_g_VX1_2_3_4X_name(convertToVertexId("marko"),
convertToVertexId("vadas"), convertToVertexId("lop"), convertToVertexId("josh"));
+        printTraversalForm(traversal);
+        checkResults(Arrays.asList("marko", "vadas", "josh"), traversal);
+        assertFalse(traversal.hasNext());
+    }
+
     public static class Traversals extends VertexTest {
 
         @Override
@@ -677,6 +696,12 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
         }
 
         @Override
+        public Traversal<Vertex, String> get_g_VX1_2_3_4X_name(final Object v1Id, final
Object v2Id, final Object v3Id, final Object v4Id) {
+            g.V(v3Id).drop().iterate();
+            return g.V(v1Id, v2Id, v3Id, v4Id).values("name");
+        }
+
+        @Override
         public Traversal<Edge, Edge> get_g_EX11X(final Object e11Id) {
             return g.E(e11Id);
         }


Mime
View raw message