Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11 Preview 7, CoreCLR with _AndroidTypeMapImplementation=trimmable
Description
Restoring Java.InteropTests.JniRuntimeJniValueManagerTests device-test coverage shows that four of its five tests pass under the trimmable typemap. CreateValue fails because its test ReflectionJniValueManager delegates marshaler lookup to the current runtime value manager, and TrimmableTypeMapValueManager.GetValueMarshalerCore(Type) throws NotSupportedException.
Expected: either the test's reflection value manager can resolve the IJavaPeerable marshaler under the trimmable typemap, or the test can be adapted to exercise supported trimmable behavior.
Actual: the test fails with GetValueMarshalerCore should not be called in the trimmable typemap path.
This is the only failing method in the restored fixture; GetValue_ReturnsAlias, GetValue_ReturnsNullWithInvalidSafeHandle, GetValue_ReturnsNullWithNullHandle, and PeekValue pass.
Steps to Reproduce
- Include
external/Java.Interop/tests/Java.Interop-Tests/Java.Interop/JniRuntime.JniValueManagerTests.cs in Java.Interop-Tests.NET.csproj.
- Build and install
tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj with -p:UseMonoRuntime=false -p:_AndroidTypeMapImplementation=trimmable.
- Run the on-device test suite.
- Observe
Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValue fail.
Did you find any workaround?
Exclude only Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValue by fully-qualified NUnit test name when RuntimeFeature.TrimmableTypeMap is enabled. This retains the other four tests and all non-trimmable runtime coverage.
Relevant log output
System.NotSupportedException : GetValueMarshalerCore should not be called in the trimmable typemap path.
at Microsoft.Android.Runtime.TrimmableTypeMapValueManager.GetValueMarshalerCore(Type type)
at Java.Interop.JniRuntime.JniValueManager.GetValueMarshaler(Type type)
at Java.Interop.JavaPeerableValueMarshaler.CreateGenericValue(...)
at Java.Interop.JniRuntime.ReflectionJniValueManager.CreateValueCore(...)
at Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValue()
Android framework version
net11.0-android (Preview)
Affected platform version
.NET 11 Preview 7, CoreCLR with
_AndroidTypeMapImplementation=trimmableDescription
Restoring
Java.InteropTests.JniRuntimeJniValueManagerTestsdevice-test coverage shows that four of its five tests pass under the trimmable typemap.CreateValuefails because its testReflectionJniValueManagerdelegates marshaler lookup to the current runtime value manager, andTrimmableTypeMapValueManager.GetValueMarshalerCore(Type)throwsNotSupportedException.Expected: either the test's reflection value manager can resolve the
IJavaPeerablemarshaler under the trimmable typemap, or the test can be adapted to exercise supported trimmable behavior.Actual: the test fails with
GetValueMarshalerCore should not be called in the trimmable typemap path.This is the only failing method in the restored fixture;
GetValue_ReturnsAlias,GetValue_ReturnsNullWithInvalidSafeHandle,GetValue_ReturnsNullWithNullHandle, andPeekValuepass.Steps to Reproduce
external/Java.Interop/tests/Java.Interop-Tests/Java.Interop/JniRuntime.JniValueManagerTests.csinJava.Interop-Tests.NET.csproj.tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csprojwith-p:UseMonoRuntime=false -p:_AndroidTypeMapImplementation=trimmable.Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValuefail.Did you find any workaround?
Exclude only
Java.InteropTests.JniRuntimeJniValueManagerTests.CreateValueby fully-qualified NUnit test name whenRuntimeFeature.TrimmableTypeMapis enabled. This retains the other four tests and all non-trimmable runtime coverage.Relevant log output