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/03/09 21:29:44 UTC

[1/2] incubator-tinkerpop git commit: Fixed SerializationTest for after api refactoring.

Repository: incubator-tinkerpop
Updated Branches:
  refs/heads/newapi dbd38cc71 -> fd62ee8e2


Fixed SerializationTest for after api refactoring.

Replaced most references to Traversal in favor of usage of only low-level API references.  Had to leave a couple of serialization tests with Traversal still in them because the tests were looking at Traversal oriented objects: Path and Metrics.  Perhaps we need a set of serialization tests for gremlin-process related objects.


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

Branch: refs/heads/newapi
Commit: d674afed13b85ec88fa45dc30e9a0dcd2d9d20e7
Parents: b18aad4
Author: Stephen Mallette <sp...@apache.org>
Authored: Mon Mar 9 16:18:27 2015 -0400
Committer: Stephen Mallette <sp...@apache.org>
Committed: Mon Mar 9 16:18:27 2015 -0400

----------------------------------------------------------------------
 .../gremlin/structure/SerializationTest.java    | 30 ++++++++++----------
 1 file changed, 15 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/d674afed/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
index 2b6f728..02de2e0 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/SerializationTest.java
@@ -55,7 +55,7 @@ public class SerializationTest {
         public void shouldSerializeVertexAsDetached() throws Exception {
             final GryoMapper gryoMapper = g.io().gryoMapper().create();
             final Kryo kryo = gryoMapper.createMapper();
-            final Vertex v = g.V(convertToVertexId("marko")).next();
+            final Vertex v = g.vertices(convertToVertexId("marko")).next();
             final ByteArrayOutputStream stream = new ByteArrayOutputStream();
             final Output output = new Output(stream);
             kryo.writeObject(output, v);
@@ -113,7 +113,7 @@ public class SerializationTest {
         public void shouldSerializeVertexPropertyAsDetached() throws Exception {
             final GryoMapper gryoMapper = g.io().gryoMapper().create();
             final Kryo kryo = gryoMapper.createMapper();
-            final VertexProperty vp = g.V(convertToVertexId("marko")).next().property("name");
+            final VertexProperty vp = g.vertices(convertToVertexId("marko")).next().property("name");
             final ByteArrayOutputStream stream = new ByteArrayOutputStream();
             final Output output = new Output(stream);
             kryo.writeObject(output, vp);
@@ -133,7 +133,7 @@ public class SerializationTest {
         public void shouldSerializeVertexPropertyWithPropertiesAsDetached() throws Exception {
             final GryoMapper gryoMapper = g.io().gryoMapper().create();
             final Kryo kryo = gryoMapper.createMapper();
-            final VertexProperty vp = g.V(convertToVertexId("marko")).next().iterators().propertyIterator("location").next();
+            final VertexProperty vp = g.vertices(convertToVertexId("marko")).next().properties("location").next();
             final ByteArrayOutputStream stream = new ByteArrayOutputStream();
             final Output output = new Output(stream);
             kryo.writeObject(output, vp);
@@ -146,10 +146,10 @@ public class SerializationTest {
             assertEquals(vp.label(), detached.label());
             assertEquals(vp.id(), detached.id());
             assertEquals(vp.value(), detached.value());
-            assertEquals(vp.iterators().propertyIterator("startTime").next().value(), detached.iterators().propertyIterator("startTime").next().value());
-            assertEquals(vp.iterators().propertyIterator("startTime").next().key(), detached.iterators().propertyIterator("startTime").next().key());
-            assertEquals(vp.iterators().propertyIterator("endTime").next().value(), detached.iterators().propertyIterator("endTime").next().value());
-            assertEquals(vp.iterators().propertyIterator("endTime").next().key(), detached.iterators().propertyIterator("endTime").next().key());
+            assertEquals(vp.values("startTime").next(), detached.values("startTime").next());
+            assertEquals(((VertexProperty) vp.properties("startTime").next()).key(), ((VertexProperty) detached.properties("startTime").next()).key());
+            assertEquals(vp.values("endTime").next(), detached.values("endTime").next());
+            assertEquals(((VertexProperty) vp.properties("endTime").next()).key(), ((VertexProperty) detached.properties("endTime").next()).key());
         }
 
         @Test
@@ -180,7 +180,7 @@ public class SerializationTest {
             assertEquals(vOut.id(), detachedVOut.id());
 
             // this is a SimpleTraverser so no properties are present in detachment
-            assertFalse(detachedVOut.iterators().propertyIterator().hasNext());
+            assertFalse(detachedVOut.properties().hasNext());
 
             final Edge e = p.get("b");
             final Edge detachedE = detached.get("b");
@@ -188,7 +188,7 @@ public class SerializationTest {
             assertEquals(e.id(), detachedE.id());
 
             // this is a SimpleTraverser so no properties are present in detachment
-            assertFalse(detachedE.iterators().propertyIterator().hasNext());
+            assertFalse(detachedE.properties().hasNext());
 
             final Vertex vIn = p.get("c");
             final Vertex detachedVIn = detached.get("c");
@@ -196,7 +196,7 @@ public class SerializationTest {
             assertEquals(vIn.id(), detachedVIn.id());
 
             // this is a SimpleTraverser so no properties are present in detachment
-            assertFalse(detachedVIn.iterators().propertyIterator().hasNext());
+            assertFalse(detachedVIn.properties().hasNext());
         }
     }
 
@@ -208,7 +208,7 @@ public class SerializationTest {
         @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
         public void shouldSerializeVertex() throws Exception {
             final ObjectMapper mapper = g.io().graphSONMapper().create().createMapper();
-            final Vertex v = g.V(convertToVertexId("marko")).next();
+            final Vertex v = g.vertices(convertToVertexId("marko")).next();
             final String json = mapper.writeValueAsString(v);
             final Map<String, Object> m = mapper.readValue(json, mapTypeReference);
 
@@ -248,7 +248,7 @@ public class SerializationTest {
         @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
         public void shouldSerializeVertexProperty() throws Exception {
             final ObjectMapper mapper = g.io().graphSONMapper().create().createMapper();
-            final VertexProperty vp = g.V(convertToVertexId("marko")).next().property("name");
+            final VertexProperty vp = g.vertices(convertToVertexId("marko")).next().property("name");
             final String json = mapper.writeValueAsString(vp);
             final Map<String, Object> m = mapper.readValue(json, mapTypeReference);
 
@@ -261,15 +261,15 @@ public class SerializationTest {
         @LoadGraphWith(LoadGraphWith.GraphData.CREW)
         public void shouldSerializeVertexPropertyWithProperties() throws Exception {
             final ObjectMapper mapper = g.io().graphSONMapper().create().createMapper();
-            final VertexProperty vp = g.V(convertToVertexId("marko")).next().iterators().propertyIterator("location").next();
+            final VertexProperty vp = g.vertices(convertToVertexId("marko")).next().properties("location").next();
             final String json = mapper.writeValueAsString(vp);
             final Map<String, Object> m = mapper.readValue(json, mapTypeReference);
 
             assertEquals(vp.label(), m.get(GraphSONTokens.LABEL));
             assertNotNull(m.get(GraphSONTokens.ID));
             assertEquals(vp.value(), m.get(GraphSONTokens.VALUE));
-            assertEquals(vp.iterators().propertyIterator("startTime").next().value(), ((Map) m.get(GraphSONTokens.PROPERTIES)).get("startTime"));
-            assertEquals(vp.iterators().propertyIterator("endTime").next().value(), ((Map) m.get(GraphSONTokens.PROPERTIES)).get("endTime"));
+            assertEquals(vp.values("startTime").next(), ((Map) m.get(GraphSONTokens.PROPERTIES)).get("startTime"));
+            assertEquals(vp.values("endTime").next(), ((Map) m.get(GraphSONTokens.PROPERTIES)).get("endTime"));
         }
 
         @Test


[2/2] incubator-tinkerpop git commit: Merge remote-tracking branch 'origin/newapi' into newapi

Posted by sp...@apache.org.
Merge remote-tracking branch 'origin/newapi' into newapi


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

Branch: refs/heads/newapi
Commit: fd62ee8e295d5033862d5738ac0c107d74d38fb6
Parents: d674afe dbd38cc
Author: Stephen Mallette <sp...@apache.org>
Authored: Mon Mar 9 16:29:34 2015 -0400
Committer: Stephen Mallette <sp...@apache.org>
Committed: Mon Mar 9 16:29:34 2015 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/structure/BatchTest.java  | 65 ++++++++++----------
 .../gremlin/structure/FeatureSupportTest.java   |  6 +-
 .../strategy/PartitionStrategyTest.java         | 17 ++---
 .../strategy/SubgraphStrategyTest.java          |  4 +-
 .../gremlin/hadoop/structure/HadoopEdge.java    | 19 +++---
 .../gremlin/hadoop/structure/HadoopVertex.java  | 19 +++---
 .../gremlin/neo4j/structure/Neo4jEdge.java      | 13 ++--
 .../gremlin/neo4j/structure/Neo4jElement.java   |  4 +-
 .../gremlin/neo4j/structure/Neo4jVertex.java    | 13 ++--
 .../neo4j/structure/Neo4jVertexProperty.java    | 12 +---
 10 files changed, 74 insertions(+), 98 deletions(-)
----------------------------------------------------------------------