Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests] enable FixJavaAbstractMethod tests #8582

Merged

Conversation

jonathanpeppers
Copy link
Member

Context: #7794

This ports the following projects to .NET 9 (for main):

  • Xamarin.Android.FixJavaAbstractMethod-APIv1Binding.csproj
  • Xamarin.Android.FixJavaAbstractMethod-APIv2Binding.csproj
  • Xamarin.Android.FixJavaAbstractMethod-Library.csproj

Which allows us to enable JavaAbstractMethodTest in Xamarin.Android.JcwGen-Tests/BindingTests.cs

One difference in the test appears to be System.Reflection, I am unable to retrieve an explicit interface method via:

var mi = ic.GetType ().GetMethod ("MethodWithCursor");

Instead, I had to do:

var mi = ic.GetType ().GetMethod ("global::Test.Bindings.ICursor.MethodWithCursor", BindingFlags.Instance | BindingFlags.NonPublic);

This seems be a difference between Mono/Xamarin.Android and .NET 6+.

Note this doesn't fully finish #7794 as there is still a test + more test projects to port.

Context: dotnet#7794

This ports the following projects to .NET 9 (for main):

* `Xamarin.Android.FixJavaAbstractMethod-APIv1Binding.csproj`
* `Xamarin.Android.FixJavaAbstractMethod-APIv2Binding.csproj`
* `Xamarin.Android.FixJavaAbstractMethod-Library.csproj`

Which allows us to enable `JavaAbstractMethodTest` in
`Xamarin.Android.JcwGen-Tests/BindingTests.cs`

One difference in the test appears to be System.Reflection, I am unable
to retrieve an explicit interface method via:

    var mi = ic.GetType ().GetMethod ("MethodWithCursor");

Instead, I had to do:

    var mi = ic.GetType ().GetMethod ("global::Test.Bindings.ICursor.MethodWithCursor", BindingFlags.Instance | BindingFlags.NonPublic);

This seems be a difference between Mono/Xamarin.Android and .NET 6+.

Note this doesn't fully finish dotnet#7794 as there is still a test + more
test projects to port.
Copy link
Contributor

@jpobst jpobst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! ❤️

image

@jonathanpeppers
Copy link
Member Author

Looks like the test still works:

image

So don't see a need to rerun the lane that timed out, going to merge.

@jonathanpeppers jonathanpeppers merged commit d51ffca into dotnet:main Dec 12, 2023
44 of 47 checks passed
@jonathanpeppers jonathanpeppers deleted the FixJavaAbstractMethodTests branch December 12, 2023 18:47
grendello added a commit that referenced this pull request Dec 12, 2023
* main:
  [tests] enable FixJavaAbstractMethod tests (#8582)
  LEGO: Merge pull request 8587
@github-actions github-actions bot locked and limited conversation to collaborators Jan 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants