Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,7 +12,7 @@
using NUnit.Framework;

namespace Java.InteropTests {
[TestFixture, Category ("NativeTypeMap")]
[TestFixture]
public class AndroidValueManagerContractTests : JniRuntimeJniValueManagerContract {

[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -478,24 +478,24 @@ public void MoarThreadingTests ()
Assert.IsNull (ignore_t2, string.Format ("No exception should be thrown [t2]! Got: {0}", ignore_t2));
}

[Test, Category ("NativeTypeMap")]
[Test]
public void JavaToManagedTypeMapping ()
{
Type m = Java.Interop.TypeManager.GetJavaToManagedType ("android/content/res/Resources");
Type m = JniRuntime.CurrentRuntime.TypeManager.GetType (new JniTypeSignature ("android/content/res/Resources"));
Assert.AreNotEqual (null, m);
m = Java.Interop.TypeManager.GetJavaToManagedType ("this/type/does/not/exist");
m = JniRuntime.CurrentRuntime.TypeManager.GetType (new JniTypeSignature ("this/type/does/not/exist"));
Assert.AreEqual (null, m);
}

[Test, Category ("NativeTypeMap")]
[Test]
public void ManagedToJavaTypeMapping ()
{
Type type = typeof(Activity);
string m = JNIEnv.TypemapManagedToJava (type);
string m = JniRuntime.CurrentRuntime.TypeManager.GetTypeSignature (type).SimpleReference;
Assert.AreNotEqual (null, m, "`Activity` subclasses Java.Lang.Object, it should be in the typemap!");

type = typeof (JnienvTest);
m = JNIEnv.TypemapManagedToJava (type);
m = JniRuntime.CurrentRuntime.TypeManager.GetTypeSignature (type).SimpleReference;
Assert.AreEqual (null, m, "`JnienvTest` does *not* subclass Java.Lang.Object, it should *not* be in the typemap!");
}

Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -31,7 +31,7 @@
<!-- TODO: https://github.com/dotnet/android/issues/10069 -->
<ExcludeCategories Condition=" '$(UseMonoRuntime)' != 'true' and '$(_AndroidTypeMapImplementation)' != 'trimmable' ">$(ExcludeCategories):CoreCLRIgnore:NTLM</ExcludeCategories>
<!-- TODO: https://github.com/dotnet/android/issues/10079 -->
<ExcludeCategories Condition=" '$(PublishAot)' == 'true' ">$(ExcludeCategories):NativeAOTIgnore:SSL:NTLM:Export:NativeTypeMap</ExcludeCategories>
<ExcludeCategories Condition=" '$(PublishAot)' == 'true' ">$(ExcludeCategories):NativeAOTIgnore:SSL:NTLM:Export</ExcludeCategories>
<!-- FIXME: LLVMIgnore https://github.com/dotnet/runtime/issues/89190 -->
<ExcludeCategories Condition=" '$(EnableLLVM)' == 'true' ">$(ExcludeCategories):LLVMIgnore</ExcludeCategories>
<ExcludeCategories Condition=" '$(EnableLLVM)' == 'true' ">$(ExcludeCategories):InetAccess:NetworkInterfaces</ExcludeCategories>
Expand All@@ -40,7 +40,6 @@
<PropertyGroup>
<UseMonoRuntime Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' and '$(PublishAot)' != 'true' ">false</UseMonoRuntime>
<TestsFlavor Condition=" '$(TestsFlavor)' == '' and '$(_AndroidTypeMapImplementation)' == 'trimmable' ">CoreCLRTrimmable</TestsFlavor>
<ExcludeCategories Condition=" '$(_AndroidTypeMapImplementation)' == 'trimmable' ">$(ExcludeCategories):NativeTypeMap</ExcludeCategories>
</PropertyGroup>

<ItemGroup>
Expand Down