tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spmalle...@apache.org
Subject tinkerpop git commit: TINKERPOP-1996 Testing for GraphSON and IoRegistry configuration
Date Fri, 20 Jul 2018 15:55:40 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1996 7f1bf1783 -> ae3f685ad


TINKERPOP-1996 Testing for GraphSON and IoRegistry configuration


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

Branch: refs/heads/TINKERPOP-1996
Commit: ae3f685ad7af326c9f1282da296e9db49f94da03
Parents: 7f1bf17
Author: Stephen Mallette <spmva@genoprime.com>
Authored: Fri Jul 20 11:55:09 2018 -0400
Committer: Stephen Mallette <spmva@genoprime.com>
Committed: Fri Jul 20 11:55:09 2018 -0400

----------------------------------------------------------------------
 .../step/sideEffect/TinkerGraphIoStepTest.java  | 23 ++++++++++++++++++++
 1 file changed, 23 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ae3f685a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphIoStepTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphIoStepTest.java
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphIoStepTest.java
index 06c4db8..8bab7da 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphIoStepTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/step/sideEffect/TinkerGraphIoStepTest.java
@@ -72,4 +72,27 @@ public class TinkerGraphIoStepTest {
 
         assertEquals(1, emptyG.V().has("custom", new CustomId("a", uuid)).count().next().intValue());
     }
+
+    @Test
+    public void shouldWriteReadWithCustomIoRegistryGraphSON() throws Exception {
+        final UUID uuid = UUID.randomUUID();
+        g.addV("person").property("name","stephen").property("custom", new CustomId("a",
uuid)).iterate();
+
+        final File file = TestHelper.generateTempFile(TinkerGraphIoStepTest.class, "shouldWriteReadWithCustomIoRegistryGraphSON",
".json");
+        g.io(file.getAbsolutePath()).with(IO.registry, CustomId.CustomIdIoRegistry.class.getName()).write().iterate();
+
+        final Graph emptyGraph = TinkerGraph.open();
+        final GraphTraversalSource emptyG = emptyGraph.traversal();
+
+        try {
+            emptyG.io(file.getAbsolutePath()).read().iterate();
+            fail("Can't read without a registry");
+        } catch (Exception ignored) {
+            // do nothing
+        }
+
+        emptyG.io(file.getAbsolutePath()).with(IO.registry, CustomId.CustomIdIoRegistry.instance()).read().iterate();
+
+        assertEquals(1, emptyG.V().has("custom", new CustomId("a", uuid)).count().next().intValue());
+    }
 }


Mime
View raw message