[
https://issues.apache.org/jira/browse/TINKERPOP-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16638884#comment-16638884
]
Florian Hockmann commented on TINKERPOP-1972:
---------------------------------------------
I'm not sure yet where the problem exactly is, but it seems to be not a problem
of the traversal generation that we use for the Gherkin tests. I created a
small test that builds the same traversal directly in C# and it had the same
problem. So, the problem seems to be with the {{Inject}} step itself in
Gremlin.Net which probably means that other steps that take a {{params}} array
have the same problem which is what I meant with that it seems to be a general
problem.
I just used your {{inject}} traversal with its GraphSON 2 representation to
write a unit test in C#:
{code}
var graphsonWriter = CreateGraphSONWriter();
var g = new Graph().Traversal();
var graphSON = graphsonWriter.WriteObject(g.Inject(1,2,3).Bytecode);
Assert.Equal(
"{\"@type\":\"g:Bytecode\",\"@value\":{\"step\":[[\"inject\",{\"@type\":\"g:Int32\",\"@value\":1},{\"@type\":\"g:Int32\",\"@value\":2},{\"@type\":\"g:Int32\",\"@value\":3}]]}}",
graphSON);
{code}
This test fails because Gremlin.Net adds square brackets around the integers.
However, the same test succeeds for this traversal: {{g.V().Out("a", "b")}}
with the GraphSON representation taken from Java again which also doesn't
contain square brackets.
So, the problem seems to be specific to {{Inject}} or maybe to steps that take
a generic {{params}} array. That is at least the only difference I can see
between those two steps.
> inject() tests are throwing exceptions in .NET GLV tests
> --------------------------------------------------------
>
> Key: TINKERPOP-1972
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1972
> Project: TinkerPop
> Issue Type: Bug
> Components: dotnet
> Affects Versions: 3.2.9
> Reporter: stephen mallette
> Assignee: stephen mallette
> Priority: Minor
>
> New GLV tests were added in TINKERPOP-1963 and are generating this error:
> {code}
> Failures:
> 1) g_injectX1X_chooseXisX1X__constantX10Xfold__foldX: Failed
> System.NotSupportedException: Type is not supported.
> at System.Array.InternalCreate(Void* elementType, Int32 rank, Int32*
> pLengths, Int32* pLowerBounds)
> at System.Array.CreateInstance(Type elementType, Int32 length)
> at
> Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation.TraversalParser.BuildParameters(MethodInfo
> method, Token token, IDictionary`2& genericParameterTypes) in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs:line
> 268
> at
> Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation.TraversalParser.GetTraversalFromTokens(IList`1
> tokens, GraphTraversalSource g, IDictionary`2 contextParameterValues, String
> traversalText) in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs:line
> 90
> at
> Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation.TraversalParser.GetTraversal(String
> traversalText, GraphTraversalSource g, IDictionary`2 contextParameterValues)
> in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs:line
> 62
> at
> Gremlin.Net.IntegrationTest.Gherkin.CommonSteps.TranslateTraversal(String
> traversalText) in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs:line
> 101
> 2) g_injectX2X_chooseXisX1X__constantX10Xfold__foldX: Failed
> System.NotSupportedException: Type is not supported.
> at System.Array.InternalCreate(Void* elementType, Int32 rank, Int32*
> pLengths, Int32* pLowerBounds)
> at System.Array.CreateInstance(Type elementType, Int32 length)
> at
> Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation.TraversalParser.BuildParameters(MethodInfo
> method, Token token, IDictionary`2& genericParameterTypes) in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs:line
> 268
> at
> Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation.TraversalParser.GetTraversalFromTokens(IList`1
> tokens, GraphTraversalSource g, IDictionary`2 contextParameterValues, String
> traversalText) in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs:line
> 90
> at
> Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation.TraversalParser.GetTraversal(String
> traversalText, GraphTraversalSource g, IDictionary`2 contextParameterValues)
> in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/TraversalParser.cs:line
> 62
> at
> Gremlin.Net.IntegrationTest.Gherkin.CommonSteps.TranslateTraversal(String
> traversalText) in
> /home/smallette/git/apache/incubator-tinkerpop/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/CommonSteps.cs:line
> 101
> {code}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)