using System.Configuration.Assemblies;
using System.IO;
using System.Reflection;
+#if !TARGET_JVM
using System.Reflection.Emit;
+#endif
using System.Runtime.Serialization;
using System.Threading;
using System.Globalization;
private string tempDir = Path.Combine (Path.GetTempPath (), "MonoTests.System.Reflection.AssemblyNameTest");
+#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
private AppDomain domain;
+#endif // TARGET_JVM
// created with "sn -o test.snk test.txt"
static byte[] publicKey = { 0x07, 0x02, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x52, 0x53, 0x41, 0x32, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x3D, 0xBD, 0x72, 0x08, 0xC6, 0x2B, 0x0E, 0xA8, 0xC1, 0xC0, 0x58, 0x07, 0x2B, 0x63, 0x5F, 0x7C, 0x9A, 0xBD, 0xCB, 0x22, 0xDB, 0x20, 0xB2, 0xA9, 0xDA, 0xDA, 0xEF, 0xE8, 0x00, 0x64, 0x2F, 0x5D, 0x8D, 0xEB, 0x78, 0x02, 0xF7, 0xA5, 0x36, 0x77, 0x28, 0xD7, 0x55, 0x8D, 0x14, 0x68, 0xDB, 0xEB, 0x24, 0x09, 0xD0, 0x2B, 0x13, 0x1B, 0x92, 0x6E, 0x2E, 0x59, 0x54, 0x4A, 0xAC, 0x18, 0xCF, 0xC9, 0x09, 0x02, 0x3F, 0x4F, 0xA8, 0x3E, 0x94, 0x00, 0x1F, 0xC2, 0xF1, 0x1A, 0x27, 0x47, 0x7D, 0x10, 0x84, 0xF5, 0x14, 0xB8, 0x61, 0x62, 0x1A, 0x0C, 0x66, 0xAB, 0xD2, 0x4C, 0x4B, 0x9F, 0xC9, 0x0F, 0x3C, 0xD8, 0x92, 0x0F, 0xF5, 0xFF, 0xCE, 0xD7, 0x6E, 0x5C, 0x6F, 0xB1, 0xF5, 0x7D, 0xD3, 0x56, 0xF9, 0x67, 0x27, 0xA4, 0xA5, 0x48, 0x5B, 0x07, 0x93, 0x44, 0x00, 0x4A, 0xF8, 0xFF, 0xA4, 0xCB, 0x73, 0xC0, 0x6A, 0x62, 0xB4, 0xB7, 0xC8, 0x92, 0x58, 0x87, 0xCD, 0x07,
Directory.CreateDirectory (tempDir);
+#if !TARGET_JVM // Thread.GetDomain is not supported for TARGET_JVM.
domain = Thread.GetDomain ();
+#endif // TARGET_JVM
}
[TearDown]
return assemblyName;
}
+#if !TARGET_JVM // Reflection.Emit is not supported for TARGET_JVM.
private Assembly GenerateAssembly (AssemblyName name)
{
AssemblyBuilder ab = domain.DefineDynamicAssembly (
Assert.AreEqual ("1.2.65535.65535", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic");
#endif
}
+#endif // TARGET_JVM
[Test]
public void HashAlgorithm ()
AssertEqualsByteArrays ("PublicToken", an.GetPublicKeyToken (), dsAssemblyName.GetPublicKeyToken ());
}
+#if !TARGET_JVM // Assemblyname.GetObjectData not implemented yet for TARGET_JVM
[Test]
[ExpectedException (typeof (ArgumentNullException))]
public void GetObjectData_Null ()
AssemblyName an = new AssemblyName ();
an.GetObjectData (null, new StreamingContext (StreamingContextStates.All));
}
+#endif // TARGET_JVM
[Test]
#if NET_2_0
}
[Test]
+ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Ctor2 ()
{
const string assemblyName = "TestAssembly";
}
[Test]
+ [Category("TargetJvmNotWorking")] // Not yet supported for TARGET_JVM.
public void Ctor5 ()
{
const string assemblyName = "TestAssembly";