[ 
https://issues.apache.org/jira/browse/TINKERPOP-1972?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16640002#comment-16640002
 ] 

ASF GitHub Bot commented on TINKERPOP-1972:
-------------------------------------------

GitHub user FlorianHockmann opened a pull request:

    https://github.com/apache/tinkerpop/pull/953

    TINKERPOP-1972 Fix inject step in Gremlin.Net

    https://issues.apache.org/jira/browse/TINKERPOP-1972
    
    We had two issues with the `inject` step in Gremlin.Net. The first one 
prevented the Gherkin test runner from executing scenarios that included an 
`inject` step. This was fixed by @jorgebay with the first commit in this PR. 
Thanks for that, Jorge!
    
    The second issue was that the arguments passed to the `inject` step were 
always wrapped in an array which was caused by the fact that the `inject` step 
takes a `params` array with a generic member type. We created a `List<S>` for 
these arguments and provided that to the method `ByteCode.AddStep()` which 
expects a `params object[]` argument. Since the compiler can't convert 
`List<S>` into `object[]`, it simply treated the `List<S>` as the first 
argument which resulted in an `object[]` with just one element, namely the 
`List<S>`.
    Simply using a `List<object>` for the arguments and then converting each 
argument to `object` fixes the problem.
    This could also have affected other steps, but `inject` was the only one 
with such a generic `params` array which is probably why we didn't notice the 
problem before. 
    
    All .NET tests, including the GLV scenarios, are now passing again 🎉
    
    VOTE +1

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/apache/tinkerpop TINKERPOP-1972

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tinkerpop/pull/953.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #953
    
----
commit 2a2e47ebdb5342c30ebee2e9a0cca138e07fc58c
Author: Jorge Bay Gondra <jorgebaygondra@...>
Date:   2018-09-12T09:17:54Z

    TINKERPOP-1972 Fix test harness, extract child type in generic params array

commit dee155e50eab747afa1d302ed0c027c8c3629e2b
Author: Florian Hockmann <fh@...>
Date:   2018-10-05T15:32:09Z

    TINKERPOP-1972 Fix arg handling for inject step
    
    To be precise, this affects all steps that have a params array with a
    generic type parameter as the member type but currently inject is the
    only step in Gremlin.Net that has such an array as an argument.
    
    The arguments passed as such a params array were incorrectly wrapped in
    one array before instead of individual arguments.

----


> 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: Florian Hockmann
>            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)

Reply via email to