tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject tinkerpop git commit: added failing GraphSONReader test
Date Tue, 01 Aug 2017 17:55:44 GMT
Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1738 [created] 203c4c2da


added failing GraphSONReader test


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

Branch: refs/heads/TINKERPOP-1738
Commit: 203c4c2da161e1b70679525814f6944b4bd19614
Parents: 9bc2d46
Author: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Authored: Tue Aug 1 19:55:13 2017 +0200
Committer: Daniel Kuppitz <daniel_kuppitz@hotmail.com>
Committed: Tue Aug 1 19:55:13 2017 +0200

----------------------------------------------------------------------
 .../io/graphson/GraphSONReaderTest.java         | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/203c4c2d/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
new file mode 100644
index 0000000..d9c81f8
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONReaderTest.java
@@ -0,0 +1,24 @@
+package org.apache.tinkerpop.gremlin.structure.io.graphson;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @author Daniel Kuppitz (http://gremlin.guru)
+ */
+public class GraphSONReaderTest {
+
+    @Test
+    public void elementOrderShouldNotMatter() throws Exception {
+        final GraphSONReader reader = GraphSONReader.build().create();
+        final String bytecodeJSON1 = "{\"@type\":\"g:Bytecode\",\"@value\":{\"step\":[[\"addV\",\"poc_int\"],[\"property\",\"bigint1value\",{\"@type\":\"g:Int32\",\"@value\":-4294967295}]]}}";
+        final String bytecodeJSON2 = "{\"@value\":{\"step\":[[\"addV\",\"poc_int\"],[\"property\",\"bigint1value\",{\"@value\":-4294967295,\"@type\":\"g:Int32\"}]]},\"@type\":\"g:Bytecode\"}";
+        final Bytecode bytecode1 = reader.readObject(new ByteArrayInputStream(bytecodeJSON1.getBytes()),
Bytecode.class);
+        final Bytecode bytecode2 = reader.readObject(new ByteArrayInputStream(bytecodeJSON2.getBytes()),
Bytecode.class);
+        assertEquals(bytecode1, bytecode2);
+    }
+}
\ No newline at end of file


Mime
View raw message