You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by fl...@apache.org on 2018/08/13 17:38:07 UTC

[01/15] tinkerpop git commit: TINKERPOP-1945 Added additional extended GraphSON types to .NET

Repository: tinkerpop
Updated Branches:
  refs/heads/master 0be786437 -> 1a7d50eea
  refs/heads/tp32 180da8d9f -> ea18963e5
  refs/heads/tp33 5676e8612 -> 25ae75511


TINKERPOP-1945 Added additional extended GraphSON types to .NET

Support (de)serialization of GraphSON Duration-Types to TimeSpans.

Support (de)serialization of GraphSON BigInteger-Types to System.Numerics.BigInteger. An update to the latest version of Newtonsoft.Json would provide even better support.

Support (de)serialization of GraphSON Byte-Types to System.Byte.

Support (de)serialization of GraphSON Byte-Types to byte[].

Support (de)serialization of GraphSON Char-Types to System.Char.

Support deserialization of GraphSON Instant-Types to System.Date. It is up to discussion whether System.Date should be serialized to gx:Date or gx:Instant; currently it is neither.

Support deserialization of GraphSON LocalDate-Types to System.Date.

Support deserialization of GraphSON LocalDateTime-Types to System.DateTime.

Support deserialization of GraphSON LocalTime-Types to System.TimeSpan.

Support deserialization of GraphSON OffsetDateTime-Types to System.DateTimeOffset.

Support deserialization of GraphSON Period-Types to System.TimeSpan.

Support (de)serialization of GraphSON Int16-Types to System.Int16.

Update Newtonsoft.Json.

Explicitly reference Newtonsoft.Json 11.0.2 from Gremlin.Net.UnitTest.csproj.

Support deserialization of GraphSON ZoneOffset-Types to System.TimeSpan.

Support deserialization of GraphSON InetAddress-Types to string.

Split BigIntegerConverter and TimeSpanConverter into Serializer and Deserializer.

Split ByteBufferSerializer into ByteBufferSerializer and ByteBufferDeserializer.

Split DateSerializer into DateSerializer and DateDeserializer.

Remove InetAddressDeserializer for symmetry reasons.

Remove InstantDeserializer for symmetry reasons.

Remove LocalDateDeserializer, LocalDateTimeDeserializer and LocalTimeDeserializer for symmetry reasons.

Remove OffsetDateTimeDeserializer for symmetry reasons.

Remove ZoneOffsetDeserializer for symmetry reasons.

Remove registration for gx:Period for symmetry reasons.

Move Registration of DecimalConverter since it's in the extended (gx) namespace.

Remove unit tests that are now failing due to the removal of (de)serializers.

Add missing license headers.

Fix namespace of Int16.

Rename TimeSpan(De)serializer to Duration(De)serializer.


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

Branch: refs/heads/master
Commit: ddeaf4161e0d055046652033e3f1abaeecc66216
Parents: 180da8d
Author: Daniel Weber <dw...@exram.de>
Authored: Wed Apr 18 10:48:27 2018 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:05 2018 -0400

----------------------------------------------------------------------
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   2 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 ++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 ++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 110 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 17 files changed, 561 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index df4150a..e506bf5 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -48,7 +48,7 @@ Please see the reference documentation at Apache TinkerPop for more information
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
new file mode 100644
index 0000000..755dbcc
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Numerics;
+using System.Xml;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class BigIntegerDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var bigInteger = graphsonObject.ToObject<string>();
+            return BigInteger.Parse(bigInteger);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
new file mode 100644
index 0000000..b53f752
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Collections.Generic;
+using System.Numerics;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class BigIntegerSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            BigInteger value = objectData;
+            return GraphSONUtil.ToTypedValue("BigInteger", value.ToString(), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
new file mode 100644
index 0000000..f77abb0
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
@@ -0,0 +1,36 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteBufferDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var base64String = graphsonObject.ToObject<string>();
+            return Convert.FromBase64String(base64String);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
new file mode 100644
index 0000000..09d4f27
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
@@ -0,0 +1,36 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteBufferSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            byte[] value = objectData;
+            return GraphSONUtil.ToTypedValue("ByteBuffer", Convert.ToBase64String(value), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
new file mode 100644
index 0000000..6525d52
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
@@ -0,0 +1,33 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteConverter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Byte";
+        protected override Type HandledType => typeof(byte);
+        protected override string Prefix => "gx";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
new file mode 100644
index 0000000..b7023be
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class CharConverter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Char";
+        protected override Type HandledType => typeof(char);
+        protected override string Prefix => "gx";
+        protected override bool StringifyValue => true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
new file mode 100644
index 0000000..98ca25e
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DateDeserializer : IGraphSONDeserializer
+    {
+        private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
+
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var milliseconds = graphsonObject.ToObject<long>();
+            return UnixStart.AddTicks(TimeSpan.TicksPerMillisecond * milliseconds);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
index 3333f0c..d6c830a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
@@ -23,11 +23,10 @@
 
 using System;
 using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
-    internal class DateSerializer : IGraphSONSerializer, IGraphSONDeserializer
+    internal class DateSerializer : IGraphSONSerializer
     {
         private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
         
@@ -37,11 +36,5 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             var ticks = (value - UnixStart).Ticks;
             return GraphSONUtil.ToTypedValue("Date", ticks / TimeSpan.TicksPerMillisecond);
         }
-
-        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
-        {
-            var milliseconds = graphsonObject.ToObject<long>();
-            return UnixStart.AddTicks(TimeSpan.TicksPerMillisecond * milliseconds);
-        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
new file mode 100644
index 0000000..00a9a70
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Xml;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DurationDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var duration = graphsonObject.ToObject<string>();
+            return XmlConvert.ToTimeSpan(duration);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
new file mode 100644
index 0000000..9fe5fcd
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Xml;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DurationSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            TimeSpan value = objectData;
+            return GraphSONUtil.ToTypedValue("Duration", XmlConvert.ToString(value), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index db03dd4..d11b14c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@ -42,14 +42,22 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {"g:Float", new FloatConverter()},
                 {"g:Double", new DoubleConverter()},
                 {"g:UUID", new UuidDeserializer()},
-                {"g:Date", new DateSerializer()},
-                {"g:Timestamp", new DateSerializer()},
+                {"g:Date", new DateDeserializer()},
+                {"g:Timestamp", new DateDeserializer()},
                 {"g:Vertex", new VertexDeserializer()},
                 {"g:Edge", new EdgeDeserializer()},
                 {"g:Property", new PropertyDeserializer()},
                 {"g:VertexProperty", new VertexPropertyDeserializer()},
                 {"g:Path", new PathDeserializer()},
-                {"gx:BigDecimal", new DecimalConverter()}
+
+                //Extended
+                {"gx:BigDecimal", new DecimalConverter()},
+                {"gx:Duration", new DurationDeserializer()},
+                {"gx:BigInteger", new BigIntegerDeserializer()},
+                {"gx:Byte", new ByteConverter()},
+                {"gx:ByteBuffer", new ByteBufferDeserializer()},
+                {"gx:Char", new CharConverter()},
+                {"gx:Int16", new Int16Converter() }
             };
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
index 8926d23..5994180 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
@@ -25,6 +25,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using System.Numerics;
 using System.Reflection;
 using Gremlin.Net.Driver.Messages;
 using Gremlin.Net.Process.Traversal;
@@ -49,7 +50,6 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {typeof(long), new Int64Converter()},
                 {typeof(float), new FloatConverter()},
                 {typeof(double), new DoubleConverter()},
-                {typeof(decimal), new DecimalConverter()},
                 {typeof(Guid), new UuidSerializer()},
                 {typeof(DateTimeOffset), new DateSerializer()},
                 {typeof(Type), new ClassSerializer()},
@@ -60,7 +60,16 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {typeof(Property), new PropertySerializer()},
                 {typeof(VertexProperty), new VertexPropertySerializer()},
                 {typeof(AbstractTraversalStrategy), new TraversalStrategySerializer()},
-                {typeof(ILambda), new LambdaSerializer()}
+                {typeof(ILambda), new LambdaSerializer()},
+
+                //Extended
+                {typeof(decimal), new DecimalConverter()},
+                {typeof(TimeSpan), new DurationSerializer()},
+                {typeof(BigInteger), new BigIntegerSerializer()},
+                {typeof(byte), new ByteConverter()},
+                {typeof(byte[]), new ByteBufferSerializer()},
+                {typeof(char), new CharConverter() },
+                {typeof(short), new Int16Converter() }
             };
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
new file mode 100644
index 0000000..abe5a77
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class Int16Converter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Int16";
+        protected override Type HandledType => typeof(short);
+        protected override string Prefix => "gx";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
index d1d6372..0b44e57 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
@@ -15,6 +15,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
     <PackageReference Include="Moq" Version="4.7.99" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index d2ce40b..74bf385 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@ -23,9 +23,12 @@
 
 using System;
 using System.Collections.Generic;
+using System.Numerics;
+using Gremlin.Net.Process.Traversal;
 using Gremlin.Net.Structure;
 using Gremlin.Net.Structure.IO.GraphSON;
 using Moq;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Xunit;
 
@@ -38,6 +41,17 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             return new GraphSONReader();
         }
 
+        //During CI, we encountered a case where Newtonsoft.Json version 9.0.0
+        //was loaded although there is no obvious direct nor indirect dependency
+        //on that version of the library. An explicit reference to version
+        //11.0.0 from Gremlin.Net.UnitTest fixes that, however, it is
+        //still unclear what causes the downgrade. Until resolution, we keep this test.
+        [Fact]
+        public void NewtonsoftJsonVersionShouldSupportReallyBigIntegers()
+        {
+            Assert.Equal(new Version(11, 0, 0, 0), typeof(JToken).Assembly.GetName().Version);
+        }
+
         [Fact]
         public void ShouldDeserializeWithCustomDeserializerForNewType()
         {
@@ -320,6 +334,102 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             Assert.NotNull(d);
             Assert.Equal("g:Traverser", (string)d["@type"]);
         }
+
+        [Fact]
+        public void ShouldDeserializeDurationToTimeSpan()
+        {
+            var serializedValue = "{\"@type\":\"gx:Duration\",\"@value\":\"PT120H\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            TimeSpan deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(TimeSpan.FromDays(5), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeBigInteger()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeBigIntegerValueAsString()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeReallyBigIntegerValue()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789987654321123456789987654321}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789987654321123456789987654321"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeByte()
+        {
+            var serializedValue = "{\"@type\":\"gx:Byte\",\"@value\":1}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(1, deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeByteBuffer()
+        {
+            var serializedValue = "{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeChar()
+        {
+            var serializedValue = "{\"@type\":\"gx:Char\",\"@value\":\"x\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal('x', deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeInt16()
+        {
+            var serializedValue = "{\"@type\":\"gx:Int16\",\"@value\":100}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(100, deserializedValue);
+        }
     }
 
     internal class TestGraphSONDeserializer : IGraphSONDeserializer

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index 54dc8f3..a544fb3 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@ -23,6 +23,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Numerics;
 using Gremlin.Net.Process.Traversal;
 using Gremlin.Net.Process.Traversal.Strategy.Decoration;
 using Gremlin.Net.Structure;
@@ -346,6 +347,70 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
                 "{\"@type\":\"g:Lambda\",\"@value\":{\"script\":\"{ it.get() }\",\"language\":\"gremlin-groovy\",\"arguments\":-1}}";
             Assert.Equal(expected, graphSon);
         }
+
+        [Fact]
+        public void ShouldSerializeTimeSpan()
+        {
+            var writer = CreateStandardGraphSONWriter();
+            var timeSpan = new TimeSpan(5, 4, 3, 2, 1);
+
+            var graphSon = writer.WriteObject(timeSpan);
+
+            const string expected = "{\"@type\":\"gx:Duration\",\"@value\":\"P5DT4H3M2.001S\"}";
+            Assert.Equal(expected, graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeBigInteger()
+        {
+            var writer = CreateStandardGraphSONWriter();
+            var bigInteger = BigInteger.Parse("123456789987654321123456789987654321");
+
+            var graphSon = writer.WriteObject(bigInteger);
+
+            const string expected = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789987654321123456789987654321\"}";
+            Assert.Equal(expected, graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeByte()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject((byte)1);
+
+            Assert.Equal("{\"@type\":\"gx:Byte\",\"@value\":1}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeByteBuffer()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"));
+
+            Assert.Equal("{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeChar()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject('x');
+
+            Assert.Equal("{\"@type\":\"gx:Char\",\"@value\":\"x\"}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeInt16()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject((short)100);
+
+            Assert.Equal("{\"@type\":\"gx:Int16\",\"@value\":100}", graphSon);
+        }
     }
 
     internal class TestGraphSONSerializer : IGraphSONSerializer


[04/15] tinkerpop git commit: TINKERPOP-1945 Updated json version in .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Updated json version in .NET

The original PR modified the proj file directly rather than the template.


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

Branch: refs/heads/master
Commit: d6a7950678a5b0489af02087d35c296feb1e5718
Parents: 1eb418f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 11:08:46 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:28 2018 -0400

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d6a79506/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
index 0770178..965fba9 100644
--- a/gremlin-dotnet/glv/Gremlin.Net.csproj.template
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -48,7 +48,7 @@ Please see the reference documentation at Apache TinkerPop for more information
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
   </ItemGroup>
 
   <ItemGroup Condition="'\$(TargetFramework)' == 'netstandard1.3'">


[13/15] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by fl...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/master
Commit: 25ae755118cc5d968652d4fd36bccb4d78ce9a7d
Parents: 5676e86 ea18963
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 19:23:39 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 19:23:39 2018 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 gremlin-dotnet/glv/Gremlin.Net.csproj.template  |   3 +-
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   3 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 +++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 +++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 108 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 19 files changed, 563 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index 94fcd8d,d11b14c..5ced99a
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@@ -52,8 -49,15 +52,16 @@@ namespace Gremlin.Net.Structure.IO.Grap
                  {"g:Property", new PropertyDeserializer()},
                  {"g:VertexProperty", new VertexPropertyDeserializer()},
                  {"g:Path", new PathDeserializer()},
 +                {"g:T", new TDeserializer()},
-                 {"gx:BigDecimal", new DecimalConverter()}
+ 
+                 //Extended
+                 {"gx:BigDecimal", new DecimalConverter()},
+                 {"gx:Duration", new DurationDeserializer()},
+                 {"gx:BigInteger", new BigIntegerDeserializer()},
+                 {"gx:Byte", new ByteConverter()},
+                 {"gx:ByteBuffer", new ByteBufferDeserializer()},
+                 {"gx:Char", new CharConverter()},
+                 {"gx:Int16", new Int16Converter() }
              };
  
          /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index c93630f,74bf385..00cf853
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@@ -34,32 -36,22 +35,43 @@@ namespace Gremlin.Net.UnitTest.Structur
  {
      public class GraphSONReaderTests
      {
 -        private GraphSONReader CreateStandardGraphSONReader()
 -        {
 -            return new GraphSONReader();
 +        /// <summary>
 +        /// Parameters for each test supporting multiple versions of GraphSON
 +        /// </summary>
 +        public static IEnumerable<object[]> Versions => new []
 +        {
 +            new object[] { 2 },
 +            new object[] { 3 }
 +        };
 +        
 +        /// <summary>
 +        /// Parameters for each collections test supporting multiple versions of GraphSON
 +        /// </summary>
 +        public static IEnumerable<object[]> VersionsSupportingCollections => new []
 +        {
 +            new object[] { 3 }
 +        };
 +        
 +        private GraphSONReader CreateStandardGraphSONReader(int version)
 +        {
 +            if (version == 3)
 +            {
 +                return new GraphSON3Reader();
 +            }
 +            return new GraphSON2Reader();
          }
  
+         //During CI, we encountered a case where Newtonsoft.Json version 9.0.0
+         //was loaded although there is no obvious direct nor indirect dependency
+         //on that version of the library. An explicit reference to version
+         //11.0.0 from Gremlin.Net.UnitTest fixes that, however, it is
+         //still unclear what causes the downgrade. Until resolution, we keep this test.
+         [Fact]
+         public void NewtonsoftJsonVersionShouldSupportReallyBigIntegers()
+         {
+             Assert.Equal(new Version(11, 0, 0, 0), typeof(JToken).Assembly.GetName().Version);
+         }
+ 
          [Fact]
          public void ShouldDeserializeWithCustomDeserializerForNewType()
          {
@@@ -416,6 -334,102 +428,102 @@@
              Assert.NotNull(d);
              Assert.Equal("g:Traverser", (string)d["@type"]);
          }
+ 
 -        [Fact]
 -        public void ShouldDeserializeDurationToTimeSpan()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeDurationToTimeSpan(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Duration\",\"@value\":\"PT120H\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             TimeSpan deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(TimeSpan.FromDays(5), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeBigInteger()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeBigInteger(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeBigIntegerValueAsString()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeBigIntegerValueAsString(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeReallyBigIntegerValue()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeReallyBigIntegerValue(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789987654321123456789987654321}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789987654321123456789987654321"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeByte()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeByte(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Byte\",\"@value\":1}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(1, deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeByteBuffer()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeByteBuffer(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeChar()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeChar(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Char\",\"@value\":\"x\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal('x', deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeInt16()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeInt16(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Int16\",\"@value\":100}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(100, deserializedValue);
+         }
      }
  
      internal class TestGraphSONDeserializer : IGraphSONDeserializer

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index 9f62abe,a544fb3..2d30fa1
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@@ -406,6 -347,70 +407,70 @@@ namespace Gremlin.Net.UnitTest.Structur
                  "{\"@type\":\"g:Lambda\",\"@value\":{\"script\":\"{ it.get() }\",\"language\":\"gremlin-groovy\",\"arguments\":-1}}";
              Assert.Equal(expected, graphSon);
          }
+ 
 -        [Fact]
 -        public void ShouldSerializeTimeSpan()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeTimeSpan(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+             var timeSpan = new TimeSpan(5, 4, 3, 2, 1);
+ 
+             var graphSon = writer.WriteObject(timeSpan);
+ 
+             const string expected = "{\"@type\":\"gx:Duration\",\"@value\":\"P5DT4H3M2.001S\"}";
+             Assert.Equal(expected, graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeBigInteger()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeBigInteger(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+             var bigInteger = BigInteger.Parse("123456789987654321123456789987654321");
+ 
+             var graphSon = writer.WriteObject(bigInteger);
+ 
+             const string expected = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789987654321123456789987654321\"}";
+             Assert.Equal(expected, graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeByte()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeByte(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject((byte)1);
+ 
+             Assert.Equal("{\"@type\":\"gx:Byte\",\"@value\":1}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeByteBuffer()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeByteBuffer(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"));
+ 
+             Assert.Equal("{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeChar()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeChar(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject('x');
+ 
+             Assert.Equal("{\"@type\":\"gx:Char\",\"@value\":\"x\"}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeInt16()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeInt16(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject((short)100);
+ 
+             Assert.Equal("{\"@type\":\"gx:Int16\",\"@value\":100}", graphSon);
+         }
      }
  
      internal class TestGraphSONSerializer : IGraphSONSerializer


[08/15] tinkerpop git commit: TINKERPOP-1945 Updated json version in .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Updated json version in .NET

The original PR modified the proj file directly rather than the template.


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

Branch: refs/heads/tp32
Commit: d6a7950678a5b0489af02087d35c296feb1e5718
Parents: 1eb418f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 11:08:46 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:28 2018 -0400

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d6a79506/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
index 0770178..965fba9 100644
--- a/gremlin-dotnet/glv/Gremlin.Net.csproj.template
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -48,7 +48,7 @@ Please see the reference documentation at Apache TinkerPop for more information
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
   </ItemGroup>
 
   <ItemGroup Condition="'\$(TargetFramework)' == 'netstandard1.3'">


[10/15] tinkerpop git commit: Add dependency on Microsoft.CSharp TINKERPOP-1945 CTR

Posted by fl...@apache.org.
Add dependency on Microsoft.CSharp TINKERPOP-1945 CTR

We need this dependency to use dynamic in C#. We already had an indirect
dependency on it before through the dependency on Newtonsoft.Json.
Newtonsoft.Json dropped that dependency in version 11 for .NET Standard
2.0 which broke our build.
This commit only makes the dependency explicit.


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

Branch: refs/heads/tp33
Commit: ea18963e543de90668f401938217f5aa21f2ff29
Parents: d6a7950
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 18:09:52 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 18:09:52 2018 +0200

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template    | 1 +
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ea18963e/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
index 965fba9..50c227a 100644
--- a/gremlin-dotnet/glv/Gremlin.Net.csproj.template
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -49,6 +49,7 @@ Please see the reference documentation at Apache TinkerPop for more information
 
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition="'\$(TargetFramework)' == 'netstandard1.3'">

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ea18963e/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index e506bf5..476ca23 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -49,6 +49,7 @@ Please see the reference documentation at Apache TinkerPop for more information
 
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">


[05/15] tinkerpop git commit: TINKERPOP-1945 Updated changelog for additional exteded types for .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Updated changelog for additional exteded types for .NET


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

Branch: refs/heads/tp33
Commit: 1eb418f3f9be0d8e373c06115fdfbda0700b79d4
Parents: ddeaf41
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 10:46:21 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:28 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1eb418f3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 79db967..f9b8b2f 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Match numbers in `choose()` options using `NumberHelper` (match values, ignore data type).
 * Added support for GraphSON serialization of `Date` in Javascript.
 * Added better internal processing of `Column` in `by(Function)`.
+* Added support for additional extended types in Gremlin.Net with `decimal`, `TimeSpan`, `BigInteger`, `byte`, `byte[]`, `char` and `short`.
 * Fixed bug in Java driver where an disorderly shutdown of the server would cause the client to hang.
 * Added a dotnet template project that should make it easier to get started with Gremlin.Net.
 * Removed `ThreadInterruptCustomizerProvider` from documentation as a way to timeout.


[06/15] tinkerpop git commit: TINKERPOP-1945 Updated json version in .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Updated json version in .NET

The original PR modified the proj file directly rather than the template.


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

Branch: refs/heads/tp33
Commit: d6a7950678a5b0489af02087d35c296feb1e5718
Parents: 1eb418f
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 11:08:46 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:28 2018 -0400

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d6a79506/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
index 0770178..965fba9 100644
--- a/gremlin-dotnet/glv/Gremlin.Net.csproj.template
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -48,7 +48,7 @@ Please see the reference documentation at Apache TinkerPop for more information
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
   </ItemGroup>
 
   <ItemGroup Condition="'\$(TargetFramework)' == 'netstandard1.3'">


[11/15] tinkerpop git commit: Add dependency on Microsoft.CSharp TINKERPOP-1945 CTR

Posted by fl...@apache.org.
Add dependency on Microsoft.CSharp TINKERPOP-1945 CTR

We need this dependency to use dynamic in C#. We already had an indirect
dependency on it before through the dependency on Newtonsoft.Json.
Newtonsoft.Json dropped that dependency in version 11 for .NET Standard
2.0 which broke our build.
This commit only makes the dependency explicit.


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

Branch: refs/heads/master
Commit: ea18963e543de90668f401938217f5aa21f2ff29
Parents: d6a7950
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 18:09:52 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 18:09:52 2018 +0200

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template    | 1 +
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ea18963e/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
index 965fba9..50c227a 100644
--- a/gremlin-dotnet/glv/Gremlin.Net.csproj.template
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -49,6 +49,7 @@ Please see the reference documentation at Apache TinkerPop for more information
 
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition="'\$(TargetFramework)' == 'netstandard1.3'">

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ea18963e/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index e506bf5..476ca23 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -49,6 +49,7 @@ Please see the reference documentation at Apache TinkerPop for more information
 
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">


[07/15] tinkerpop git commit: TINKERPOP-1945 Updated changelog for additional exteded types for .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Updated changelog for additional exteded types for .NET


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

Branch: refs/heads/master
Commit: 1eb418f3f9be0d8e373c06115fdfbda0700b79d4
Parents: ddeaf41
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 10:46:21 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:28 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1eb418f3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 79db967..f9b8b2f 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Match numbers in `choose()` options using `NumberHelper` (match values, ignore data type).
 * Added support for GraphSON serialization of `Date` in Javascript.
 * Added better internal processing of `Column` in `by(Function)`.
+* Added support for additional extended types in Gremlin.Net with `decimal`, `TimeSpan`, `BigInteger`, `byte`, `byte[]`, `char` and `short`.
 * Fixed bug in Java driver where an disorderly shutdown of the server would cause the client to hang.
 * Added a dotnet template project that should make it easier to get started with Gremlin.Net.
 * Removed `ThreadInterruptCustomizerProvider` from documentation as a way to timeout.


[12/15] tinkerpop git commit: Add dependency on Microsoft.CSharp TINKERPOP-1945 CTR

Posted by fl...@apache.org.
Add dependency on Microsoft.CSharp TINKERPOP-1945 CTR

We need this dependency to use dynamic in C#. We already had an indirect
dependency on it before through the dependency on Newtonsoft.Json.
Newtonsoft.Json dropped that dependency in version 11 for .NET Standard
2.0 which broke our build.
This commit only makes the dependency explicit.


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

Branch: refs/heads/tp32
Commit: ea18963e543de90668f401938217f5aa21f2ff29
Parents: d6a7950
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 18:09:52 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 18:09:52 2018 +0200

----------------------------------------------------------------------
 gremlin-dotnet/glv/Gremlin.Net.csproj.template    | 1 +
 gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj | 1 +
 2 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ea18963e/gremlin-dotnet/glv/Gremlin.Net.csproj.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/Gremlin.Net.csproj.template b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
index 965fba9..50c227a 100644
--- a/gremlin-dotnet/glv/Gremlin.Net.csproj.template
+++ b/gremlin-dotnet/glv/Gremlin.Net.csproj.template
@@ -49,6 +49,7 @@ Please see the reference documentation at Apache TinkerPop for more information
 
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition="'\$(TargetFramework)' == 'netstandard1.3'">

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ea18963e/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index e506bf5..476ca23 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -49,6 +49,7 @@ Please see the reference documentation at Apache TinkerPop for more information
 
   <ItemGroup>
     <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
+    <PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">


[09/15] tinkerpop git commit: TINKERPOP-1945 Updated changelog for additional exteded types for .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Updated changelog for additional exteded types for .NET


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

Branch: refs/heads/tp32
Commit: 1eb418f3f9be0d8e373c06115fdfbda0700b79d4
Parents: ddeaf41
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Aug 13 10:46:21 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:28 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1eb418f3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 79db967..f9b8b2f 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -29,6 +29,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Match numbers in `choose()` options using `NumberHelper` (match values, ignore data type).
 * Added support for GraphSON serialization of `Date` in Javascript.
 * Added better internal processing of `Column` in `by(Function)`.
+* Added support for additional extended types in Gremlin.Net with `decimal`, `TimeSpan`, `BigInteger`, `byte`, `byte[]`, `char` and `short`.
 * Fixed bug in Java driver where an disorderly shutdown of the server would cause the client to hang.
 * Added a dotnet template project that should make it easier to get started with Gremlin.Net.
 * Removed `ThreadInterruptCustomizerProvider` from documentation as a way to timeout.


[02/15] tinkerpop git commit: TINKERPOP-1945 Added additional extended GraphSON types to .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Added additional extended GraphSON types to .NET

Support (de)serialization of GraphSON Duration-Types to TimeSpans.

Support (de)serialization of GraphSON BigInteger-Types to System.Numerics.BigInteger. An update to the latest version of Newtonsoft.Json would provide even better support.

Support (de)serialization of GraphSON Byte-Types to System.Byte.

Support (de)serialization of GraphSON Byte-Types to byte[].

Support (de)serialization of GraphSON Char-Types to System.Char.

Support deserialization of GraphSON Instant-Types to System.Date. It is up to discussion whether System.Date should be serialized to gx:Date or gx:Instant; currently it is neither.

Support deserialization of GraphSON LocalDate-Types to System.Date.

Support deserialization of GraphSON LocalDateTime-Types to System.DateTime.

Support deserialization of GraphSON LocalTime-Types to System.TimeSpan.

Support deserialization of GraphSON OffsetDateTime-Types to System.DateTimeOffset.

Support deserialization of GraphSON Period-Types to System.TimeSpan.

Support (de)serialization of GraphSON Int16-Types to System.Int16.

Update Newtonsoft.Json.

Explicitly reference Newtonsoft.Json 11.0.2 from Gremlin.Net.UnitTest.csproj.

Support deserialization of GraphSON ZoneOffset-Types to System.TimeSpan.

Support deserialization of GraphSON InetAddress-Types to string.

Split BigIntegerConverter and TimeSpanConverter into Serializer and Deserializer.

Split ByteBufferSerializer into ByteBufferSerializer and ByteBufferDeserializer.

Split DateSerializer into DateSerializer and DateDeserializer.

Remove InetAddressDeserializer for symmetry reasons.

Remove InstantDeserializer for symmetry reasons.

Remove LocalDateDeserializer, LocalDateTimeDeserializer and LocalTimeDeserializer for symmetry reasons.

Remove OffsetDateTimeDeserializer for symmetry reasons.

Remove ZoneOffsetDeserializer for symmetry reasons.

Remove registration for gx:Period for symmetry reasons.

Move Registration of DecimalConverter since it's in the extended (gx) namespace.

Remove unit tests that are now failing due to the removal of (de)serializers.

Add missing license headers.

Fix namespace of Int16.

Rename TimeSpan(De)serializer to Duration(De)serializer.


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

Branch: refs/heads/tp33
Commit: ddeaf4161e0d055046652033e3f1abaeecc66216
Parents: 180da8d
Author: Daniel Weber <dw...@exram.de>
Authored: Wed Apr 18 10:48:27 2018 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:05 2018 -0400

----------------------------------------------------------------------
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   2 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 ++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 ++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 110 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 17 files changed, 561 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index df4150a..e506bf5 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -48,7 +48,7 @@ Please see the reference documentation at Apache TinkerPop for more information
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
new file mode 100644
index 0000000..755dbcc
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Numerics;
+using System.Xml;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class BigIntegerDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var bigInteger = graphsonObject.ToObject<string>();
+            return BigInteger.Parse(bigInteger);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
new file mode 100644
index 0000000..b53f752
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Collections.Generic;
+using System.Numerics;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class BigIntegerSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            BigInteger value = objectData;
+            return GraphSONUtil.ToTypedValue("BigInteger", value.ToString(), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
new file mode 100644
index 0000000..f77abb0
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
@@ -0,0 +1,36 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteBufferDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var base64String = graphsonObject.ToObject<string>();
+            return Convert.FromBase64String(base64String);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
new file mode 100644
index 0000000..09d4f27
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
@@ -0,0 +1,36 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteBufferSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            byte[] value = objectData;
+            return GraphSONUtil.ToTypedValue("ByteBuffer", Convert.ToBase64String(value), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
new file mode 100644
index 0000000..6525d52
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
@@ -0,0 +1,33 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteConverter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Byte";
+        protected override Type HandledType => typeof(byte);
+        protected override string Prefix => "gx";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
new file mode 100644
index 0000000..b7023be
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class CharConverter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Char";
+        protected override Type HandledType => typeof(char);
+        protected override string Prefix => "gx";
+        protected override bool StringifyValue => true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
new file mode 100644
index 0000000..98ca25e
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DateDeserializer : IGraphSONDeserializer
+    {
+        private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
+
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var milliseconds = graphsonObject.ToObject<long>();
+            return UnixStart.AddTicks(TimeSpan.TicksPerMillisecond * milliseconds);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
index 3333f0c..d6c830a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
@@ -23,11 +23,10 @@
 
 using System;
 using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
-    internal class DateSerializer : IGraphSONSerializer, IGraphSONDeserializer
+    internal class DateSerializer : IGraphSONSerializer
     {
         private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
         
@@ -37,11 +36,5 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             var ticks = (value - UnixStart).Ticks;
             return GraphSONUtil.ToTypedValue("Date", ticks / TimeSpan.TicksPerMillisecond);
         }
-
-        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
-        {
-            var milliseconds = graphsonObject.ToObject<long>();
-            return UnixStart.AddTicks(TimeSpan.TicksPerMillisecond * milliseconds);
-        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
new file mode 100644
index 0000000..00a9a70
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Xml;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DurationDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var duration = graphsonObject.ToObject<string>();
+            return XmlConvert.ToTimeSpan(duration);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
new file mode 100644
index 0000000..9fe5fcd
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Xml;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DurationSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            TimeSpan value = objectData;
+            return GraphSONUtil.ToTypedValue("Duration", XmlConvert.ToString(value), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index db03dd4..d11b14c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@ -42,14 +42,22 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {"g:Float", new FloatConverter()},
                 {"g:Double", new DoubleConverter()},
                 {"g:UUID", new UuidDeserializer()},
-                {"g:Date", new DateSerializer()},
-                {"g:Timestamp", new DateSerializer()},
+                {"g:Date", new DateDeserializer()},
+                {"g:Timestamp", new DateDeserializer()},
                 {"g:Vertex", new VertexDeserializer()},
                 {"g:Edge", new EdgeDeserializer()},
                 {"g:Property", new PropertyDeserializer()},
                 {"g:VertexProperty", new VertexPropertyDeserializer()},
                 {"g:Path", new PathDeserializer()},
-                {"gx:BigDecimal", new DecimalConverter()}
+
+                //Extended
+                {"gx:BigDecimal", new DecimalConverter()},
+                {"gx:Duration", new DurationDeserializer()},
+                {"gx:BigInteger", new BigIntegerDeserializer()},
+                {"gx:Byte", new ByteConverter()},
+                {"gx:ByteBuffer", new ByteBufferDeserializer()},
+                {"gx:Char", new CharConverter()},
+                {"gx:Int16", new Int16Converter() }
             };
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
index 8926d23..5994180 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
@@ -25,6 +25,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using System.Numerics;
 using System.Reflection;
 using Gremlin.Net.Driver.Messages;
 using Gremlin.Net.Process.Traversal;
@@ -49,7 +50,6 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {typeof(long), new Int64Converter()},
                 {typeof(float), new FloatConverter()},
                 {typeof(double), new DoubleConverter()},
-                {typeof(decimal), new DecimalConverter()},
                 {typeof(Guid), new UuidSerializer()},
                 {typeof(DateTimeOffset), new DateSerializer()},
                 {typeof(Type), new ClassSerializer()},
@@ -60,7 +60,16 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {typeof(Property), new PropertySerializer()},
                 {typeof(VertexProperty), new VertexPropertySerializer()},
                 {typeof(AbstractTraversalStrategy), new TraversalStrategySerializer()},
-                {typeof(ILambda), new LambdaSerializer()}
+                {typeof(ILambda), new LambdaSerializer()},
+
+                //Extended
+                {typeof(decimal), new DecimalConverter()},
+                {typeof(TimeSpan), new DurationSerializer()},
+                {typeof(BigInteger), new BigIntegerSerializer()},
+                {typeof(byte), new ByteConverter()},
+                {typeof(byte[]), new ByteBufferSerializer()},
+                {typeof(char), new CharConverter() },
+                {typeof(short), new Int16Converter() }
             };
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
new file mode 100644
index 0000000..abe5a77
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class Int16Converter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Int16";
+        protected override Type HandledType => typeof(short);
+        protected override string Prefix => "gx";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
index d1d6372..0b44e57 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
@@ -15,6 +15,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
     <PackageReference Include="Moq" Version="4.7.99" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index d2ce40b..74bf385 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@ -23,9 +23,12 @@
 
 using System;
 using System.Collections.Generic;
+using System.Numerics;
+using Gremlin.Net.Process.Traversal;
 using Gremlin.Net.Structure;
 using Gremlin.Net.Structure.IO.GraphSON;
 using Moq;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Xunit;
 
@@ -38,6 +41,17 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             return new GraphSONReader();
         }
 
+        //During CI, we encountered a case where Newtonsoft.Json version 9.0.0
+        //was loaded although there is no obvious direct nor indirect dependency
+        //on that version of the library. An explicit reference to version
+        //11.0.0 from Gremlin.Net.UnitTest fixes that, however, it is
+        //still unclear what causes the downgrade. Until resolution, we keep this test.
+        [Fact]
+        public void NewtonsoftJsonVersionShouldSupportReallyBigIntegers()
+        {
+            Assert.Equal(new Version(11, 0, 0, 0), typeof(JToken).Assembly.GetName().Version);
+        }
+
         [Fact]
         public void ShouldDeserializeWithCustomDeserializerForNewType()
         {
@@ -320,6 +334,102 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             Assert.NotNull(d);
             Assert.Equal("g:Traverser", (string)d["@type"]);
         }
+
+        [Fact]
+        public void ShouldDeserializeDurationToTimeSpan()
+        {
+            var serializedValue = "{\"@type\":\"gx:Duration\",\"@value\":\"PT120H\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            TimeSpan deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(TimeSpan.FromDays(5), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeBigInteger()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeBigIntegerValueAsString()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeReallyBigIntegerValue()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789987654321123456789987654321}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789987654321123456789987654321"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeByte()
+        {
+            var serializedValue = "{\"@type\":\"gx:Byte\",\"@value\":1}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(1, deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeByteBuffer()
+        {
+            var serializedValue = "{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeChar()
+        {
+            var serializedValue = "{\"@type\":\"gx:Char\",\"@value\":\"x\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal('x', deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeInt16()
+        {
+            var serializedValue = "{\"@type\":\"gx:Int16\",\"@value\":100}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(100, deserializedValue);
+        }
     }
 
     internal class TestGraphSONDeserializer : IGraphSONDeserializer

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index 54dc8f3..a544fb3 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@ -23,6 +23,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Numerics;
 using Gremlin.Net.Process.Traversal;
 using Gremlin.Net.Process.Traversal.Strategy.Decoration;
 using Gremlin.Net.Structure;
@@ -346,6 +347,70 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
                 "{\"@type\":\"g:Lambda\",\"@value\":{\"script\":\"{ it.get() }\",\"language\":\"gremlin-groovy\",\"arguments\":-1}}";
             Assert.Equal(expected, graphSon);
         }
+
+        [Fact]
+        public void ShouldSerializeTimeSpan()
+        {
+            var writer = CreateStandardGraphSONWriter();
+            var timeSpan = new TimeSpan(5, 4, 3, 2, 1);
+
+            var graphSon = writer.WriteObject(timeSpan);
+
+            const string expected = "{\"@type\":\"gx:Duration\",\"@value\":\"P5DT4H3M2.001S\"}";
+            Assert.Equal(expected, graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeBigInteger()
+        {
+            var writer = CreateStandardGraphSONWriter();
+            var bigInteger = BigInteger.Parse("123456789987654321123456789987654321");
+
+            var graphSon = writer.WriteObject(bigInteger);
+
+            const string expected = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789987654321123456789987654321\"}";
+            Assert.Equal(expected, graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeByte()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject((byte)1);
+
+            Assert.Equal("{\"@type\":\"gx:Byte\",\"@value\":1}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeByteBuffer()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"));
+
+            Assert.Equal("{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeChar()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject('x');
+
+            Assert.Equal("{\"@type\":\"gx:Char\",\"@value\":\"x\"}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeInt16()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject((short)100);
+
+            Assert.Equal("{\"@type\":\"gx:Int16\",\"@value\":100}", graphSon);
+        }
     }
 
     internal class TestGraphSONSerializer : IGraphSONSerializer


[14/15] tinkerpop git commit: Merge branch 'tp32' into tp33

Posted by fl...@apache.org.
Merge branch 'tp32' into tp33


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

Branch: refs/heads/tp33
Commit: 25ae755118cc5d968652d4fd36bccb4d78ce9a7d
Parents: 5676e86 ea18963
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 19:23:39 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 19:23:39 2018 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 gremlin-dotnet/glv/Gremlin.Net.csproj.template  |   3 +-
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   3 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 +++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 +++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 108 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 19 files changed, 563 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index 94fcd8d,d11b14c..5ced99a
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@@ -52,8 -49,15 +52,16 @@@ namespace Gremlin.Net.Structure.IO.Grap
                  {"g:Property", new PropertyDeserializer()},
                  {"g:VertexProperty", new VertexPropertyDeserializer()},
                  {"g:Path", new PathDeserializer()},
 +                {"g:T", new TDeserializer()},
-                 {"gx:BigDecimal", new DecimalConverter()}
+ 
+                 //Extended
+                 {"gx:BigDecimal", new DecimalConverter()},
+                 {"gx:Duration", new DurationDeserializer()},
+                 {"gx:BigInteger", new BigIntegerDeserializer()},
+                 {"gx:Byte", new ByteConverter()},
+                 {"gx:ByteBuffer", new ByteBufferDeserializer()},
+                 {"gx:Char", new CharConverter()},
+                 {"gx:Int16", new Int16Converter() }
              };
  
          /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index c93630f,74bf385..00cf853
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@@ -34,32 -36,22 +35,43 @@@ namespace Gremlin.Net.UnitTest.Structur
  {
      public class GraphSONReaderTests
      {
 -        private GraphSONReader CreateStandardGraphSONReader()
 -        {
 -            return new GraphSONReader();
 +        /// <summary>
 +        /// Parameters for each test supporting multiple versions of GraphSON
 +        /// </summary>
 +        public static IEnumerable<object[]> Versions => new []
 +        {
 +            new object[] { 2 },
 +            new object[] { 3 }
 +        };
 +        
 +        /// <summary>
 +        /// Parameters for each collections test supporting multiple versions of GraphSON
 +        /// </summary>
 +        public static IEnumerable<object[]> VersionsSupportingCollections => new []
 +        {
 +            new object[] { 3 }
 +        };
 +        
 +        private GraphSONReader CreateStandardGraphSONReader(int version)
 +        {
 +            if (version == 3)
 +            {
 +                return new GraphSON3Reader();
 +            }
 +            return new GraphSON2Reader();
          }
  
+         //During CI, we encountered a case where Newtonsoft.Json version 9.0.0
+         //was loaded although there is no obvious direct nor indirect dependency
+         //on that version of the library. An explicit reference to version
+         //11.0.0 from Gremlin.Net.UnitTest fixes that, however, it is
+         //still unclear what causes the downgrade. Until resolution, we keep this test.
+         [Fact]
+         public void NewtonsoftJsonVersionShouldSupportReallyBigIntegers()
+         {
+             Assert.Equal(new Version(11, 0, 0, 0), typeof(JToken).Assembly.GetName().Version);
+         }
+ 
          [Fact]
          public void ShouldDeserializeWithCustomDeserializerForNewType()
          {
@@@ -416,6 -334,102 +428,102 @@@
              Assert.NotNull(d);
              Assert.Equal("g:Traverser", (string)d["@type"]);
          }
+ 
 -        [Fact]
 -        public void ShouldDeserializeDurationToTimeSpan()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeDurationToTimeSpan(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Duration\",\"@value\":\"PT120H\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             TimeSpan deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(TimeSpan.FromDays(5), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeBigInteger()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeBigInteger(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeBigIntegerValueAsString()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeBigIntegerValueAsString(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeReallyBigIntegerValue()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeReallyBigIntegerValue(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789987654321123456789987654321}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             BigInteger deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(BigInteger.Parse("123456789987654321123456789987654321"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeByte()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeByte(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Byte\",\"@value\":1}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(1, deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeByteBuffer()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeByteBuffer(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"), deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeChar()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeChar(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Char\",\"@value\":\"x\"}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal('x', deserializedValue);
+         }
+ 
 -        [Fact]
 -        public void ShouldDeserializeInt16()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldDeserializeInt16(int version)
+         {
+             var serializedValue = "{\"@type\":\"gx:Int16\",\"@value\":100}";
 -            var reader = CreateStandardGraphSONReader();
++            var reader = CreateStandardGraphSONReader(version);
+ 
+             var jObject = JObject.Parse(serializedValue);
+             var deserializedValue = reader.ToObject(jObject);
+ 
+             Assert.Equal(100, deserializedValue);
+         }
      }
  
      internal class TestGraphSONDeserializer : IGraphSONDeserializer

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25ae7551/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index 9f62abe,a544fb3..2d30fa1
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@@ -406,6 -347,70 +407,70 @@@ namespace Gremlin.Net.UnitTest.Structur
                  "{\"@type\":\"g:Lambda\",\"@value\":{\"script\":\"{ it.get() }\",\"language\":\"gremlin-groovy\",\"arguments\":-1}}";
              Assert.Equal(expected, graphSon);
          }
+ 
 -        [Fact]
 -        public void ShouldSerializeTimeSpan()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeTimeSpan(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+             var timeSpan = new TimeSpan(5, 4, 3, 2, 1);
+ 
+             var graphSon = writer.WriteObject(timeSpan);
+ 
+             const string expected = "{\"@type\":\"gx:Duration\",\"@value\":\"P5DT4H3M2.001S\"}";
+             Assert.Equal(expected, graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeBigInteger()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeBigInteger(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+             var bigInteger = BigInteger.Parse("123456789987654321123456789987654321");
+ 
+             var graphSon = writer.WriteObject(bigInteger);
+ 
+             const string expected = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789987654321123456789987654321\"}";
+             Assert.Equal(expected, graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeByte()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeByte(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject((byte)1);
+ 
+             Assert.Equal("{\"@type\":\"gx:Byte\",\"@value\":1}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeByteBuffer()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeByteBuffer(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"));
+ 
+             Assert.Equal("{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeChar()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeChar(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject('x');
+ 
+             Assert.Equal("{\"@type\":\"gx:Char\",\"@value\":\"x\"}", graphSon);
+         }
+ 
 -        [Fact]
 -        public void ShouldSerializeInt16()
++        [Theory, MemberData(nameof(Versions))]
++        public void ShouldSerializeInt16(int version)
+         {
 -            var writer = CreateStandardGraphSONWriter();
++            var writer = CreateGraphSONWriter(version);
+ 
+             var graphSon = writer.WriteObject((short)100);
+ 
+             Assert.Equal("{\"@type\":\"gx:Int16\",\"@value\":100}", graphSon);
+         }
      }
  
      internal class TestGraphSONSerializer : IGraphSONSerializer


[15/15] tinkerpop git commit: Merge branch 'tp33'

Posted by fl...@apache.org.
Merge branch 'tp33'


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

Branch: refs/heads/master
Commit: 1a7d50eea6790e6c0298eef750ba1c3b54165e0b
Parents: 0be7864 25ae755
Author: Florian Hockmann <fh...@florian-hockmann.de>
Authored: Mon Aug 13 19:30:07 2018 +0200
Committer: Florian Hockmann <fh...@florian-hockmann.de>
Committed: Mon Aug 13 19:30:07 2018 +0200

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   1 +
 gremlin-dotnet/glv/Gremlin.Net.csproj.template  |   3 +-
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   3 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 +++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 +++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 108 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 19 files changed, 563 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a7d50ee/CHANGELOG.asciidoc
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a7d50ee/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1a7d50ee/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------


[03/15] tinkerpop git commit: TINKERPOP-1945 Added additional extended GraphSON types to .NET

Posted by fl...@apache.org.
TINKERPOP-1945 Added additional extended GraphSON types to .NET

Support (de)serialization of GraphSON Duration-Types to TimeSpans.

Support (de)serialization of GraphSON BigInteger-Types to System.Numerics.BigInteger. An update to the latest version of Newtonsoft.Json would provide even better support.

Support (de)serialization of GraphSON Byte-Types to System.Byte.

Support (de)serialization of GraphSON Byte-Types to byte[].

Support (de)serialization of GraphSON Char-Types to System.Char.

Support deserialization of GraphSON Instant-Types to System.Date. It is up to discussion whether System.Date should be serialized to gx:Date or gx:Instant; currently it is neither.

Support deserialization of GraphSON LocalDate-Types to System.Date.

Support deserialization of GraphSON LocalDateTime-Types to System.DateTime.

Support deserialization of GraphSON LocalTime-Types to System.TimeSpan.

Support deserialization of GraphSON OffsetDateTime-Types to System.DateTimeOffset.

Support deserialization of GraphSON Period-Types to System.TimeSpan.

Support (de)serialization of GraphSON Int16-Types to System.Int16.

Update Newtonsoft.Json.

Explicitly reference Newtonsoft.Json 11.0.2 from Gremlin.Net.UnitTest.csproj.

Support deserialization of GraphSON ZoneOffset-Types to System.TimeSpan.

Support deserialization of GraphSON InetAddress-Types to string.

Split BigIntegerConverter and TimeSpanConverter into Serializer and Deserializer.

Split ByteBufferSerializer into ByteBufferSerializer and ByteBufferDeserializer.

Split DateSerializer into DateSerializer and DateDeserializer.

Remove InetAddressDeserializer for symmetry reasons.

Remove InstantDeserializer for symmetry reasons.

Remove LocalDateDeserializer, LocalDateTimeDeserializer and LocalTimeDeserializer for symmetry reasons.

Remove OffsetDateTimeDeserializer for symmetry reasons.

Remove ZoneOffsetDeserializer for symmetry reasons.

Remove registration for gx:Period for symmetry reasons.

Move Registration of DecimalConverter since it's in the extended (gx) namespace.

Remove unit tests that are now failing due to the removal of (de)serializers.

Add missing license headers.

Fix namespace of Int16.

Rename TimeSpan(De)serializer to Duration(De)serializer.


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

Branch: refs/heads/tp32
Commit: ddeaf4161e0d055046652033e3f1abaeecc66216
Parents: 180da8d
Author: Daniel Weber <dw...@exram.de>
Authored: Wed Apr 18 10:48:27 2018 +0200
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Aug 13 11:17:05 2018 -0400

----------------------------------------------------------------------
 .../src/Gremlin.Net/Gremlin.Net.csproj          |   2 +-
 .../IO/GraphSON/BigIntegerDeserializer.cs       |  38 +++++++
 .../IO/GraphSON/BigIntegerSerializer.cs         |  37 +++++++
 .../IO/GraphSON/ByteBufferDeserializer.cs       |  36 ++++++
 .../IO/GraphSON/ByteBufferSerializer.cs         |  36 ++++++
 .../Structure/IO/GraphSON/ByteConverter.cs      |  33 ++++++
 .../Structure/IO/GraphSON/CharConverter.cs      |  34 ++++++
 .../Structure/IO/GraphSON/DateDeserializer.cs   |  38 +++++++
 .../Structure/IO/GraphSON/DateSerializer.cs     |   9 +-
 .../IO/GraphSON/DurationDeserializer.cs         |  37 +++++++
 .../Structure/IO/GraphSON/DurationSerializer.cs |  38 +++++++
 .../Structure/IO/GraphSON/GraphSONReader.cs     |  14 ++-
 .../Structure/IO/GraphSON/GraphSONWriter.cs     |  13 ++-
 .../Structure/IO/GraphSON/Int16Converter.cs     |  34 ++++++
 .../Gremlin.Net.UnitTest.csproj                 |   1 +
 .../IO/GraphSON/GraphSONReaderTests.cs          | 110 +++++++++++++++++++
 .../IO/GraphSON/GraphSONWriterTests.cs          |  65 +++++++++++
 17 files changed, 561 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
index df4150a..e506bf5 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
+++ b/gremlin-dotnet/src/Gremlin.Net/Gremlin.Net.csproj
@@ -48,7 +48,7 @@ Please see the reference documentation at Apache TinkerPop for more information
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
   </ItemGroup>
 
   <ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
new file mode 100644
index 0000000..755dbcc
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerDeserializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Numerics;
+using System.Xml;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class BigIntegerDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var bigInteger = graphsonObject.ToObject<string>();
+            return BigInteger.Parse(bigInteger);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
new file mode 100644
index 0000000..b53f752
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/BigIntegerSerializer.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Collections.Generic;
+using System.Numerics;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class BigIntegerSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            BigInteger value = objectData;
+            return GraphSONUtil.ToTypedValue("BigInteger", value.ToString(), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
new file mode 100644
index 0000000..f77abb0
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferDeserializer.cs
@@ -0,0 +1,36 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteBufferDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var base64String = graphsonObject.ToObject<string>();
+            return Convert.FromBase64String(base64String);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
new file mode 100644
index 0000000..09d4f27
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteBufferSerializer.cs
@@ -0,0 +1,36 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteBufferSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            byte[] value = objectData;
+            return GraphSONUtil.ToTypedValue("ByteBuffer", Convert.ToBase64String(value), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
new file mode 100644
index 0000000..6525d52
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/ByteConverter.cs
@@ -0,0 +1,33 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class ByteConverter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Byte";
+        protected override Type HandledType => typeof(byte);
+        protected override string Prefix => "gx";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
new file mode 100644
index 0000000..b7023be
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/CharConverter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class CharConverter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Char";
+        protected override Type HandledType => typeof(char);
+        protected override string Prefix => "gx";
+        protected override bool StringifyValue => true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
new file mode 100644
index 0000000..98ca25e
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateDeserializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+#endregion
+
+using System;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DateDeserializer : IGraphSONDeserializer
+    {
+        private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
+
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var milliseconds = graphsonObject.ToObject<long>();
+            return UnixStart.AddTicks(TimeSpan.TicksPerMillisecond * milliseconds);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
index 3333f0c..d6c830a 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DateSerializer.cs
@@ -23,11 +23,10 @@
 
 using System;
 using System.Collections.Generic;
-using Newtonsoft.Json.Linq;
 
 namespace Gremlin.Net.Structure.IO.GraphSON
 {
-    internal class DateSerializer : IGraphSONSerializer, IGraphSONDeserializer
+    internal class DateSerializer : IGraphSONSerializer
     {
         private static readonly DateTimeOffset UnixStart = new DateTimeOffset(1970, 1, 1, 0, 0, 0, 0, TimeSpan.Zero);
         
@@ -37,11 +36,5 @@ namespace Gremlin.Net.Structure.IO.GraphSON
             var ticks = (value - UnixStart).Ticks;
             return GraphSONUtil.ToTypedValue("Date", ticks / TimeSpan.TicksPerMillisecond);
         }
-
-        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
-        {
-            var milliseconds = graphsonObject.ToObject<long>();
-            return UnixStart.AddTicks(TimeSpan.TicksPerMillisecond * milliseconds);
-        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
new file mode 100644
index 0000000..00a9a70
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationDeserializer.cs
@@ -0,0 +1,37 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System.Xml;
+using Newtonsoft.Json.Linq;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DurationDeserializer : IGraphSONDeserializer
+    {
+        public dynamic Objectify(JToken graphsonObject, GraphSONReader reader)
+        {
+            var duration = graphsonObject.ToObject<string>();
+            return XmlConvert.ToTimeSpan(duration);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
new file mode 100644
index 0000000..9fe5fcd
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/DurationSerializer.cs
@@ -0,0 +1,38 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Xml;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class DurationSerializer : IGraphSONSerializer
+    {
+        public Dictionary<string, dynamic> Dictify(dynamic objectData, GraphSONWriter writer)
+        {
+            TimeSpan value = objectData;
+            return GraphSONUtil.ToTypedValue("Duration", XmlConvert.ToString(value), "gx");
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
index db03dd4..d11b14c 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONReader.cs
@@ -42,14 +42,22 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {"g:Float", new FloatConverter()},
                 {"g:Double", new DoubleConverter()},
                 {"g:UUID", new UuidDeserializer()},
-                {"g:Date", new DateSerializer()},
-                {"g:Timestamp", new DateSerializer()},
+                {"g:Date", new DateDeserializer()},
+                {"g:Timestamp", new DateDeserializer()},
                 {"g:Vertex", new VertexDeserializer()},
                 {"g:Edge", new EdgeDeserializer()},
                 {"g:Property", new PropertyDeserializer()},
                 {"g:VertexProperty", new VertexPropertyDeserializer()},
                 {"g:Path", new PathDeserializer()},
-                {"gx:BigDecimal", new DecimalConverter()}
+
+                //Extended
+                {"gx:BigDecimal", new DecimalConverter()},
+                {"gx:Duration", new DurationDeserializer()},
+                {"gx:BigInteger", new BigIntegerDeserializer()},
+                {"gx:Byte", new ByteConverter()},
+                {"gx:ByteBuffer", new ByteBufferDeserializer()},
+                {"gx:Char", new CharConverter()},
+                {"gx:Int16", new Int16Converter() }
             };
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
index 8926d23..5994180 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs
@@ -25,6 +25,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Linq;
+using System.Numerics;
 using System.Reflection;
 using Gremlin.Net.Driver.Messages;
 using Gremlin.Net.Process.Traversal;
@@ -49,7 +50,6 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {typeof(long), new Int64Converter()},
                 {typeof(float), new FloatConverter()},
                 {typeof(double), new DoubleConverter()},
-                {typeof(decimal), new DecimalConverter()},
                 {typeof(Guid), new UuidSerializer()},
                 {typeof(DateTimeOffset), new DateSerializer()},
                 {typeof(Type), new ClassSerializer()},
@@ -60,7 +60,16 @@ namespace Gremlin.Net.Structure.IO.GraphSON
                 {typeof(Property), new PropertySerializer()},
                 {typeof(VertexProperty), new VertexPropertySerializer()},
                 {typeof(AbstractTraversalStrategy), new TraversalStrategySerializer()},
-                {typeof(ILambda), new LambdaSerializer()}
+                {typeof(ILambda), new LambdaSerializer()},
+
+                //Extended
+                {typeof(decimal), new DecimalConverter()},
+                {typeof(TimeSpan), new DurationSerializer()},
+                {typeof(BigInteger), new BigIntegerSerializer()},
+                {typeof(byte), new ByteConverter()},
+                {typeof(byte[]), new ByteBufferSerializer()},
+                {typeof(char), new CharConverter() },
+                {typeof(short), new Int16Converter() }
             };
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
new file mode 100644
index 0000000..abe5a77
--- /dev/null
+++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/Int16Converter.cs
@@ -0,0 +1,34 @@
+#region License
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#endregion
+
+using System;
+
+namespace Gremlin.Net.Structure.IO.GraphSON
+{
+    internal class Int16Converter : NumberConverter
+    {
+        protected override string GraphSONTypeName => "Int16";
+        protected override Type HandledType => typeof(short);
+        protected override string Prefix => "gx";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
index d1d6372..0b44e57 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Gremlin.Net.UnitTest.csproj
@@ -15,6 +15,7 @@
   </ItemGroup>
 
   <ItemGroup>
+    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.3.0" />
     <PackageReference Include="Moq" Version="4.7.99" />
     <PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
index d2ce40b..74bf385 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONReaderTests.cs
@@ -23,9 +23,12 @@
 
 using System;
 using System.Collections.Generic;
+using System.Numerics;
+using Gremlin.Net.Process.Traversal;
 using Gremlin.Net.Structure;
 using Gremlin.Net.Structure.IO.GraphSON;
 using Moq;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Xunit;
 
@@ -38,6 +41,17 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             return new GraphSONReader();
         }
 
+        //During CI, we encountered a case where Newtonsoft.Json version 9.0.0
+        //was loaded although there is no obvious direct nor indirect dependency
+        //on that version of the library. An explicit reference to version
+        //11.0.0 from Gremlin.Net.UnitTest fixes that, however, it is
+        //still unclear what causes the downgrade. Until resolution, we keep this test.
+        [Fact]
+        public void NewtonsoftJsonVersionShouldSupportReallyBigIntegers()
+        {
+            Assert.Equal(new Version(11, 0, 0, 0), typeof(JToken).Assembly.GetName().Version);
+        }
+
         [Fact]
         public void ShouldDeserializeWithCustomDeserializerForNewType()
         {
@@ -320,6 +334,102 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
             Assert.NotNull(d);
             Assert.Equal("g:Traverser", (string)d["@type"]);
         }
+
+        [Fact]
+        public void ShouldDeserializeDurationToTimeSpan()
+        {
+            var serializedValue = "{\"@type\":\"gx:Duration\",\"@value\":\"PT120H\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            TimeSpan deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(TimeSpan.FromDays(5), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeBigInteger()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeBigIntegerValueAsString()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeReallyBigIntegerValue()
+        {
+            var serializedValue = "{\"@type\":\"gx:BigInteger\",\"@value\":123456789987654321123456789987654321}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            BigInteger deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(BigInteger.Parse("123456789987654321123456789987654321"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeByte()
+        {
+            var serializedValue = "{\"@type\":\"gx:Byte\",\"@value\":1}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(1, deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeByteBuffer()
+        {
+            var serializedValue = "{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"), deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeChar()
+        {
+            var serializedValue = "{\"@type\":\"gx:Char\",\"@value\":\"x\"}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal('x', deserializedValue);
+        }
+
+        [Fact]
+        public void ShouldDeserializeInt16()
+        {
+            var serializedValue = "{\"@type\":\"gx:Int16\",\"@value\":100}";
+            var reader = CreateStandardGraphSONReader();
+
+            var jObject = JObject.Parse(serializedValue);
+            var deserializedValue = reader.ToObject(jObject);
+
+            Assert.Equal(100, deserializedValue);
+        }
     }
 
     internal class TestGraphSONDeserializer : IGraphSONDeserializer

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ddeaf416/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
index 54dc8f3..a544fb3 100644
--- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Structure/IO/GraphSON/GraphSONWriterTests.cs
@@ -23,6 +23,7 @@
 
 using System;
 using System.Collections.Generic;
+using System.Numerics;
 using Gremlin.Net.Process.Traversal;
 using Gremlin.Net.Process.Traversal.Strategy.Decoration;
 using Gremlin.Net.Structure;
@@ -346,6 +347,70 @@ namespace Gremlin.Net.UnitTest.Structure.IO.GraphSON
                 "{\"@type\":\"g:Lambda\",\"@value\":{\"script\":\"{ it.get() }\",\"language\":\"gremlin-groovy\",\"arguments\":-1}}";
             Assert.Equal(expected, graphSon);
         }
+
+        [Fact]
+        public void ShouldSerializeTimeSpan()
+        {
+            var writer = CreateStandardGraphSONWriter();
+            var timeSpan = new TimeSpan(5, 4, 3, 2, 1);
+
+            var graphSon = writer.WriteObject(timeSpan);
+
+            const string expected = "{\"@type\":\"gx:Duration\",\"@value\":\"P5DT4H3M2.001S\"}";
+            Assert.Equal(expected, graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeBigInteger()
+        {
+            var writer = CreateStandardGraphSONWriter();
+            var bigInteger = BigInteger.Parse("123456789987654321123456789987654321");
+
+            var graphSon = writer.WriteObject(bigInteger);
+
+            const string expected = "{\"@type\":\"gx:BigInteger\",\"@value\":\"123456789987654321123456789987654321\"}";
+            Assert.Equal(expected, graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeByte()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject((byte)1);
+
+            Assert.Equal("{\"@type\":\"gx:Byte\",\"@value\":1}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeByteBuffer()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject(Convert.FromBase64String("c29tZSBieXRlcyBmb3IgeW91"));
+
+            Assert.Equal("{\"@type\":\"gx:ByteBuffer\",\"@value\":\"c29tZSBieXRlcyBmb3IgeW91\"}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeChar()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject('x');
+
+            Assert.Equal("{\"@type\":\"gx:Char\",\"@value\":\"x\"}", graphSon);
+        }
+
+        [Fact]
+        public void ShouldSerializeInt16()
+        {
+            var writer = CreateStandardGraphSONWriter();
+
+            var graphSon = writer.WriteObject((short)100);
+
+            Assert.Equal("{\"@type\":\"gx:Int16\",\"@value\":100}", graphSon);
+        }
     }
 
     internal class TestGraphSONSerializer : IGraphSONSerializer