tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject [16/19] incubator-tinkerpop git commit: Added a test for iterating Vertex properties() on detached
Date Fri, 26 Feb 2016 12:17:26 GMT
Added a test for iterating Vertex properties() on detached

Just covering a case that wasn't covered otherwise. 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/d414bcb8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/d414bcb8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/d414bcb8

Branch: refs/heads/master
Commit: d414bcb85de2e05160fdd22bf6924ea269fca4c8
Parents: 7daa5b9
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Thu Feb 25 13:57:37 2016 -0500
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Thu Feb 25 13:57:37 2016 -0500

----------------------------------------------------------------------
 .../util/detached/DetachedVertexTest.java       | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d414bcb8/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
index 6bd4cc3..582b9a5 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/util/detached/DetachedVertexTest.java
@@ -39,7 +39,11 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicInteger;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -48,6 +52,24 @@ public class DetachedVertexTest extends AbstractGremlinTest {
 
     @Test
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
+    public void shouldIteratePropertiesOnDetached() {
+        final Vertex v = graph.addVertex("name", "daniel", "favoriteColor", "red", "state",
"happy");
+        final Vertex detached = DetachedFactory.detach(v, true);
+        assertEquals("daniel", detached.properties("name").next().value());
+        detached.properties().forEachRemaining(p -> {
+            if (p.key().equals("name"))
+                assertEquals("daniel", p.value());
+            else if (p.key().equals("favoriteColor"))
+                assertEquals("red", p.value());
+            else if (p.key().equals("state"))
+                assertEquals("happy", p.value());
+            else
+                fail("Should be one of the expected keys");
+        });
+    }
+
+    @Test
+    @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     public void shouldHashAndEqualCorrectly() {
         final Vertex v = graph.addVertex();
         final Set<Vertex> set = new HashSet<>();


Mime
View raw message