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 2015/05/06 15:48:00 UTC

incubator-tinkerpop git commit: Enforce equality of the StarAdjacentVertex to Vertex and StarVertex.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/master 8e9871d2f -> 9ad039aa8


Enforce equality of the StarAdjacentVertex to Vertex and StarVertex.


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

Branch: refs/heads/master
Commit: 9ad039aa809e27ede78945fc724b402db94e6a0f
Parents: 8e9871d
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed May 6 09:47:35 2015 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed May 6 09:47:35 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/util/star/StarGraphTest.java       | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/9ad039aa/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
index 9f27fed..0ff2a82 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/star/StarGraphTest.java
@@ -36,6 +36,7 @@ import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoReader;
 import org.apache.tinkerpop.gremlin.structure.io.gryo.GryoWriter;
 import org.apache.tinkerpop.gremlin.structure.util.Attachable;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.javatuples.Pair;
 import org.junit.Ignore;
 import org.junit.Test;
@@ -60,12 +61,18 @@ public class StarGraphTest extends AbstractGremlinTest {
     @LoadGraphWith(LoadGraphWith.GraphData.CREW)
     public void shouldHashAndEqualsCorrectly() {
         final Vertex gremlin = g.V(convertToVertexId("gremlin")).next();
-        final StarGraph starGraph = StarGraph.of(gremlin);
-        final StarGraph.StarVertex gremlinStar = starGraph.getStarVertex();
+        final StarGraph gremlinStarGraph = StarGraph.of(gremlin);
+        final StarGraph.StarVertex gremlinStar = gremlinStarGraph.getStarVertex();
+
+        final Vertex marko = g.V(convertToVertexId("marko")).next();
+        final StarGraph markoStarGraph = StarGraph.of(marko);
+        final StarGraph.StarAdjacentVertex gremlinStarAdjacentGraph = (StarGraph.StarAdjacentVertex) IteratorUtils.filter(markoStarGraph.getStarVertex().edges(Direction.OUT, "uses"), x -> x.inVertex().id().equals(convertToVertexId("gremlin"))).next().inVertex();
+
         final Set<Vertex> set = new HashSet<>();
         for (int i = 0; i < 100; i++) {
             set.add(gremlin);
             set.add(gremlinStar);
+            set.add(gremlinStarAdjacentGraph);
         }
         assertEquals(1, set.size());
     }