You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2018/03/19 14:55:49 UTC

[1/2] tinkerpop git commit: TINKERPOP-1920 Fixed P.within/without() handling for collections

Repository: tinkerpop
Updated Branches:
  refs/heads/tp33 764e888f2 -> 94484e278


TINKERPOP-1920 Fixed P.within/without() handling for collections


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

Branch: refs/heads/tp33
Commit: 8c87fcfb06cc09b36e6c91bda88b61ea8ab68379
Parents: 3aa7336
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Mar 15 12:19:48 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 19 10:16:44 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 gremlin-dotnet/glv/P.template                   | 17 ++++++++++++++-
 .../src/Gremlin.Net/Process/Traversal/P.cs      | 22 ++++++++++++++++++--
 .../Gherkin/GherkinTestRunner.cs                |  6 +-----
 .../Gherkin/IgnoreException.cs                  | 10 +++------
 5 files changed, 41 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c87fcfb/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 8fcbe1a..0ec6f6d 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -42,6 +42,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 * Added `IndexedTraverserSet` which indexes on the value of a `Traverser` thus improving performance when used.
 * Utilized `IndexedTraverserSet` in `TraversalVertexProgram` to avoid extra iteration when doing `Vertex` lookups.
 * Bumped to Netty 4.0.56.Final.
+* Fixed .NET GraphSON serialization of `P.Within()` and `P.without()` when passing a `Collection` as an argument.
 * Fixed a bug in Gremlin Console which prevented handling of `gremlin.sh` flags that had an "=" between the flag and its arguments.
 * Fixed bug where `SparkMessenger` was not applying the `edgeFunction` from `MessageScope`.
 * Fixed a bug in `ComputerAwareStep` that didn't handle `reset()` properly and thus occasionally produced some extra traversers.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c87fcfb/gremlin-dotnet/glv/P.template
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/glv/P.template b/gremlin-dotnet/glv/P.template
index ad037c1..fd3b752 100644
--- a/gremlin-dotnet/glv/P.template
+++ b/gremlin-dotnet/glv/P.template
@@ -22,6 +22,12 @@
 #endregion
 
 // THIS IS A GENERATED FILE - DO NOT MODIFY THIS FILE DIRECTLY - see pom.xml
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
 namespace Gremlin.Net.Process.Traversal
 {
 #pragma warning disable 1591
@@ -88,9 +94,18 @@ namespace Gremlin.Net.Process.Traversal
 <% } %><% pmethods.findAll{ it in ["within", "without"] }.each { method -> %>
         public static P <%= toCSharpMethodName.call(method) %>(params object[] args)
         {
-            return new P("<%= method %>", args);
+            if (args.Length == 1 && args[0] is ICollection<object> collection)
+                return new P("<%= method %>", ToGenericArray(collection));
+            else
+                return new P("<%= method %>", args);
         }
 <% } %>
+
+        private static T[] ToGenericArray<T>(ICollection<T> collection)
+        {
+            return collection?.ToArray() ?? new T[0];;
+        }
+
         /// <inheritdoc />
         public override string ToString()
         {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c87fcfb/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/P.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/P.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/P.cs
index e3a1e76..e718bbe 100644
--- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/P.cs
+++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/P.cs
@@ -22,6 +22,12 @@
 #endregion
 
 // THIS IS A GENERATED FILE - DO NOT MODIFY THIS FILE DIRECTLY - see pom.xml
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+
 namespace Gremlin.Net.Process.Traversal
 {
 #pragma warning disable 1591
@@ -148,12 +154,24 @@ namespace Gremlin.Net.Process.Traversal
 
         public static P Within(params object[] args)
         {
-            return new P("within", args);
+            if (args.Length == 1 && args[0] is ICollection<object> collection)
+                return new P("within", ToGenericArray(collection));
+            else
+                return new P("within", args);
         }
 
         public static P Without(params object[] args)
         {
-            return new P("without", args);
+            if (args.Length == 1 && args[0] is ICollection<object> collection)
+                return new P("without", ToGenericArray(collection));
+            else
+                return new P("without", args);
+        }
+
+
+        private static T[] ToGenericArray<T>(ICollection<T> collection)
+        {
+            return collection?.ToArray() ?? new T[0];;
         }
 
         /// <inheritdoc />

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c87fcfb/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index e15a492..6d38ccc 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@ -38,11 +38,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
     public class GherkinTestRunner
     {
         private static readonly IDictionary<string, IgnoreReason> IgnoredScenarios =
-            new Dictionary<string, IgnoreReason>
-            {
-                {"g_V_hasIdXwithinXemptyXX_count", IgnoreReason.PWithinWrapsArgumentsInArray},
-                {"g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX", IgnoreReason.PWithinWrapsArgumentsInArray}
-            };
+            new Dictionary<string, IgnoreReason>();
         
         private static class Keywords
         {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8c87fcfb/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
----------------------------------------------------------------------
diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
index 9aa5213..860c11d 100644
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
@@ -40,11 +40,8 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
             string reasonSuffix = null;
             switch (reason)
             {
-                case IgnoreReason.PWithinWrapsArgumentsInArray:
-                    reasonSuffix = " because P.Within() arguments are incorrectly wrapped in an array (TINKERPOP-1920)";
-                    break;
-                case IgnoreReason.PNotDeserializationProblem:
-                    reasonSuffix = " because P.Not() cannot be deserialized by Gremlin Server (TINKERPOP-1922)";
+                case IgnoreReason.NoReason:
+                    reasonSuffix = "";
                     break;
             }
             return $"Scenario ignored" + reasonSuffix;
@@ -53,7 +50,6 @@ namespace Gremlin.Net.IntegrationTest.Gherkin
     
     public enum IgnoreReason
     {
-        PWithinWrapsArgumentsInArray,
-        PNotDeserializationProblem
+        NoReason
     }
 }
\ No newline at end of file


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

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

Conflicts:
	gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
	gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs


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

Branch: refs/heads/tp33
Commit: 94484e278481e0bb7add3400981993118d127fbe
Parents: 764e888 8c87fcf
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Mon Mar 19 10:55:23 2018 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Mon Mar 19 10:55:23 2018 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  1 +
 gremlin-dotnet/glv/P.template                   | 17 ++++++++++++++-
 .../src/Gremlin.Net/Process/Traversal/P.cs      | 22 ++++++++++++++++++--
 .../Gherkin/GherkinTestRunner.cs                |  4 +---
 .../Gherkin/IgnoreException.cs                  | 10 +++------
 5 files changed, 41 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


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

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/94484e27/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
index 2dac7c4,6d38ccc..02bf546
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs
@@@ -38,14 -38,7 +38,12 @@@ namespace Gremlin.Net.IntegrationTest.G
      public class GherkinTestRunner
      {
          private static readonly IDictionary<string, IgnoreReason> IgnoredScenarios =
 -            new Dictionary<string, IgnoreReason>();
 +            new Dictionary<string, IgnoreReason>
 +            {
 +                { "g_V_valueMapXtrueX", IgnoreReason.TraversalTDeserializationNotSupported },   // TINKERPOP-1866
 +                { "g_V_valueMapXtrue_name_ageX", IgnoreReason.TraversalTDeserializationNotSupported }, // TINKERPOP-1866
-                 { "g_V_hasLabelXpersonX_filterXoutEXcreatedXX_valueMapXtrueX", IgnoreReason.TraversalTDeserializationNotSupported }, // TINKERPOP-1866
-                 {"g_V_hasIdXwithinXemptyXX_count", IgnoreReason.PWithinWrapsArgumentsInArray},
-                 {"g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX", IgnoreReason.PWithinWrapsArgumentsInArray}
++                { "g_V_hasLabelXpersonX_filterXoutEXcreatedXX_valueMapXtrueX", IgnoreReason.TraversalTDeserializationNotSupported } // TINKERPOP-1866
 +            };
          
          private static class Keywords
          {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/94484e27/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
----------------------------------------------------------------------
diff --cc gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
index 9bcb860,860c11d..9eb3021
--- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
+++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs
@@@ -40,14 -40,8 +40,11 @@@ namespace Gremlin.Net.IntegrationTest.G
              string reasonSuffix = null;
              switch (reason)
              {
 +                case IgnoreReason.TraversalTDeserializationNotSupported:
 +                    reasonSuffix = " as deserialization of g:T on GraphSON3 is not supported";
 +                    break;
-                 case IgnoreReason.PWithinWrapsArgumentsInArray:
-                     reasonSuffix = " because P.Within() arguments are incorrectly wrapped in an array (TINKERPOP-1920)";
-                     break;
-                 case IgnoreReason.PNotDeserializationProblem:
-                     reasonSuffix = " because P.Not() cannot be deserialized by Gremlin Server (TINKERPOP-1922)";
+                 case IgnoreReason.NoReason:
+                     reasonSuffix = "";
                      break;
              }
              return $"Scenario ignored" + reasonSuffix;
@@@ -56,11 -50,6 +53,10 @@@
      
      public enum IgnoreReason
      {
 +        /// <summary>
 +        /// Deserialization of g:T on GraphSON3 is not supported.
 +        /// </summary>
 +        TraversalTDeserializationNotSupported,
-         PWithinWrapsArgumentsInArray,
-         PNotDeserializationProblem
+         NoReason
      }
  }