فهرست منبع

Port NUnit tests to TARGET_JVM configuration.

svn path=/trunk/mcs/; revision=73714
Eyal Alalouf 19 سال پیش
والد
کامیت
f65669f34f

+ 5 - 1
mcs/class/corlib/Test/ChangeLog

@@ -1,4 +1,8 @@
-200703-05	Roei Erez <[email protected]>
+200703-05	Eyal Alaluf <[email protected]>
+
+	* Port tests to run under TARGET_JVM.
+
+200703-05	Roei Erez <[email protected]>
 
 	* StringTest.cs: add test for string properties.
 

+ 3 - 78
mcs/class/corlib/Test/Mscorlib.Test20.csproj

@@ -24,6 +24,7 @@
     <DefineConstants>TRACE;DEBUG;JAVA;NET_2_0;NET_1_1;TARGET_JVM</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <NoWarn>67, 169, 168, 219, 414, 618, 628, 649, 672, 688</NoWarn>
     <BaseAddress>285212672</BaseAddress>
     <SkipValidation>True</SkipValidation>
     <KeepIntermediate>False</KeepIntermediate>
@@ -38,6 +39,7 @@
     <DefineConstants>TRACE;JAVA</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <NoWarn>67, 169, 168, 219, 414, 618, 628, 649, 672, 688</NoWarn>
     <BaseAddress>285212672</BaseAddress>
     <SkipValidation>false</SkipValidation>
     <KeepIntermediate>false</KeepIntermediate>
@@ -86,34 +88,21 @@
     <Compile Include="System.Collections\ReadOnlyCollectionBaseTest.cs" />
     <Compile Include="System.Collections\SortedListTest.cs" />
     <Compile Include="System.Collections\StackTest.cs" />
-    <Compile Include="System.Diagnostics\DebugTest.cs" />
-    <Compile Include="System.Diagnostics\StackFrameCas.cs" />
-    <Compile Include="System.Diagnostics\StackFrameTest.cs" />
-    <Compile Include="System.Diagnostics\StackTraceCas.cs" />
-    <Compile Include="System.Diagnostics\StackTraceTest.cs" />
-    <Compile Include="System.Diagnostics\TextWriterTraceListenerTest.cs" />
     <Compile Include="System.Globalization\CalendarTest.cs" />
     <Compile Include="System.Globalization\CompareInfoTest.cs" />
     <Compile Include="System.Globalization\CultureInfoTest.cs" />
     <Compile Include="System.Globalization\DateTimeFormatInfoTest.cs" />
     <Compile Include="System.Globalization\DaylightTimeTest.cs" />
     <Compile Include="System.Globalization\TextInfoTest.cs" />
-    <Compile Include="System.IO.IsolatedStorage\IsolatedStorageFileCas.cs" />
-    <Compile Include="System.IO.IsolatedStorage\IsolatedStorageFileStreamCas.cs" />
-    <Compile Include="System.IO.IsolatedStorage\IsolatedStorageFileStreamTest.cs" />
-    <Compile Include="System.IO.IsolatedStorage\IsolatedStorageFileTest.cs" />
-    <Compile Include="System.IO.IsolatedStorage\IsolatedStorageTest.cs" />
     <Compile Include="System.IO\BinaryReaderTest.cs" />
     <Compile Include="System.IO\BinaryWriterTest.cs" />
     <Compile Include="System.IO\BufferedStreamTest.cs" />
-    <Compile Include="System.IO\DirectoryCas.cs" />
     <Compile Include="System.IO\DirectoryInfoTest.cs" />
     <Compile Include="System.IO\DirectoryTest.cs" />
     <Compile Include="System.IO\FileInfoTest.cs" />
     <Compile Include="System.IO\FileLoadExceptionCas.cs" />
     <Compile Include="System.IO\FileNotFoundExceptionCas.cs" />
     <Compile Include="System.IO\FileNotFoundExceptionTest.cs" />
-    <Compile Include="System.IO\FileStreamCas.cs" />
     <Compile Include="System.IO\FileStreamTest.cs" />
     <Compile Include="System.IO\FileSystemInfoTest.cs" />
     <Compile Include="System.IO\FileTest.cs" />
@@ -127,40 +116,12 @@
     <Compile Include="System.IO\StringReaderTest.cs" />
     <Compile Include="System.IO\StringWriterTest.cs" />
     <Compile Include="System.IO\TextWriterTest.cs" />
-    <Compile Include="System.IO\UnmanagedMemoryStreamTest.cs" />
-    <Compile Include="System.Reflection.Emit\AssemblyBuilderAccessTest.cs" />
-    <Compile Include="System.Reflection.Emit\AssemblyBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\ConstructorBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\CustomAttributeBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\DynamicMethodTest.cs" />
-    <Compile Include="System.Reflection.Emit\EnumBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\EventBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\FieldBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\ILGeneratorTest.cs" />
-    <Compile Include="System.Reflection.Emit\MethodBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\MethodRentalCas.cs" />
-    <Compile Include="System.Reflection.Emit\MethodRentalTest.cs" />
-    <Compile Include="System.Reflection.Emit\ModuleBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\PropertyBuilderTest.cs" />
-    <Compile Include="System.Reflection.Emit\TypeBuilderTest.cs" />
-    <Compile Include="System.Reflection\AssemblyAlgorithmIdAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyCas.cs" />
-    <Compile Include="System.Reflection\AssemblyConfigurationAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyCopyrightAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyCultureAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyDelaySignAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyDescriptionAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyFileVersionAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyInformationalVersionAttributeTest.cs" />
-    <Compile Include="System.Reflection\AssemblyNameCas.cs" />
     <Compile Include="System.Reflection\AssemblyNameTest.cs" />
     <Compile Include="System.Reflection\AssemblyTest.cs" />
     <Compile Include="System.Reflection\BinderTests.cs" />
     <Compile Include="System.Reflection\EventInfoTest.cs" />
     <Compile Include="System.Reflection\FieldInfoTest.cs" />
     <Compile Include="System.Reflection\MethodInfoTest.cs" />
-    <Compile Include="System.Reflection\ModuleCas.cs" />
-    <Compile Include="System.Reflection\ModuleTest.cs" />
     <Compile Include="System.Reflection\ParameterInfoTest.cs" />
     <Compile Include="System.Reflection\PropertyInfoTest.cs" />
     <Compile Include="System.Reflection\ReflectedTypeTest.cs" />
@@ -171,14 +132,6 @@
     <Compile Include="System.Resources\ResourceReaderCas.cs" />
     <Compile Include="System.Resources\ResourceReaderTest.cs" />
     <Compile Include="System.Resources\ResourceSetCas.cs" />
-    <Compile Include="System.Runtime.CompilerServices\RuntimeHelpersTest.cs" />
-    <Compile Include="System.Runtime.CompilerServices\RuntimeWrappedExceptionCas.cs" />
-    <Compile Include="System.Runtime.CompilerServices\RuntimeWrappedExceptionTest.cs" />
-    <Compile Include="System.Runtime.InteropServices\GCHandleTest.cs" />
-    <Compile Include="System.Runtime.InteropServices\MarshalTest.cs" />
-    <Compile Include="System.Runtime.InteropServices\RuntimeEnvironmentCas.cs" />
-    <Compile Include="System.Runtime.InteropServices\RuntimeEnvironmentTest.cs" />
-    <Compile Include="System.Runtime.InteropServices\SafeHandleTest.cs" />
     <Compile Include="System.Runtime.Remoting.Contexts\SynchronizationAttributeTest.cs" />
     <Compile Include="System.Runtime.Remoting\ContextTest.cs" />
     <Compile Include="System.Runtime.Remoting\RemotingConfigurationTest.cs" />
@@ -213,10 +166,6 @@
     <Compile Include="System.Text\UTF7EncodingTest.cs" />
     <Compile Include="System.Text\UTF8EncodingTest.cs" />
     <Compile Include="System.Threading\AutoResetEventTest.cs" />
-    <Compile Include="System.Threading\CompressedStackCas.cs" />
-    <Compile Include="System.Threading\CompressedStackTest.cs" />
-    <Compile Include="System.Threading\ExecutionContextCas.cs" />
-    <Compile Include="System.Threading\ExecutionContextTest.cs" />
     <Compile Include="System.Threading\InterlockedTest.cs" />
     <Compile Include="System.Threading\MonitorTest.cs" />
     <Compile Include="System.Threading\MutexCas.cs" />
@@ -229,18 +178,9 @@
     <Compile Include="System\ActivatorTest.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\AppDomainCas.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\AppDomainSetupTest.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\AppDomainTest.cs">
-      <SubType>Code</SubType>
-    </Compile>
-    <Compile Include="System\ApplicationIdentityTest.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\ApplicationIdTest.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -311,9 +251,6 @@
     <Compile Include="System\EnumTest.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\EnvironmentCas.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\EnvironmentTest.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -341,18 +278,12 @@
     <Compile Include="System\IntegerFormatterTest.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\IntPtrTest.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\MarshalByRefObjectCas.cs">
       <SubType>Code</SubType>
     </Compile>
     <Compile Include="System\MathTest.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\ModuleHandleTest.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\MulticastDelegate.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -389,9 +320,6 @@
     <Compile Include="System\TimeZoneTest.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\TypedReferenceCas.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\TypeTest.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -404,9 +332,6 @@
     <Compile Include="System\UInt64Test.cs">
       <SubType>Code</SubType>
     </Compile>
-    <Compile Include="System\UIntPtrTest.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="System\ValueTypeTest.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -453,4 +378,4 @@
       <UserProperties REFS-JarPath-system-runtime-remoting="..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Runtime.Remoting.jar;..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Runtime.Serialization.Formatters.Soap.jar" REFS-JarPath-nunit-framework="..\..\..\nunit20\framework\bin\Debug_Java20\nunit.framework.jar" REFS-JarPath-rt="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jre5\lib\rt.jar" REFS-JarPath-system-xml="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Xml.jar" REFS-JarPath-system-data="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.Data.jar" REFS-JarPath-system="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\System.jar" REFS-JarPath-mscorlib="..\..\..\..\..\..\..\Program Files\Mainsoft\Visual MainWin for J2EE 2\jgac\vmw4j2ee_110\mscorlib.jar" />
     </VisualStudio>
   </ProjectExtensions>
-</Project>
+</Project>

+ 2 - 0
mcs/class/corlib/Test/System.IO/DirectoryTest.cs

@@ -250,6 +250,7 @@ public class DirectoryTest
 		Assert.IsFalse (Directory.Exists (null as string));
 	}
 
+#if !TARGET_JVM // We don't support yet the Process class.
 	[Test]
 	[Category("NotDotNet")]
 	public void ExistsAccessDenied ()
@@ -270,6 +271,7 @@ public class DirectoryTest
 			Directory.Delete (path);
 		}
 	}
+#endif
 	
 	[Test]
 	[ExpectedException(typeof(ArgumentNullException))]

+ 6 - 0
mcs/class/corlib/Test/System.IO/FileStreamTest.cs

@@ -698,6 +698,7 @@ namespace MonoTests.System.IO
 			}
 		}
 
+#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
 		[Test, ExpectedException (typeof (IOException))]
 		public void CtorIOException2 ()
 		{
@@ -709,6 +710,7 @@ namespace MonoTests.System.IO
 					stream.Close ();
 			}
 		}
+#endif // TARGET_JVM
 
 		[Test, ExpectedException (typeof (IOException))]
 		public void CtorIOException ()
@@ -1260,6 +1262,7 @@ namespace MonoTests.System.IO
 			}
 		}
 
+#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
 		// Check that the stream is flushed even when it doesn't own the
 		// handle
 		[Test]
@@ -1279,6 +1282,7 @@ namespace MonoTests.System.IO
 			Assert.AreEqual ((int) '1', s.ReadByte ());
 			s.Close ();
 		}
+#endif // TARGET_JVM
 
 		private void DeleteFile (string path)
 		{
@@ -1394,12 +1398,14 @@ namespace MonoTests.System.IO
 			}
 		}
 
+#if !TARGET_JVM // No support IntPtr file handles under TARGET_JVM
 		[Test]
 		[ExpectedException (typeof (ArgumentException))]
 		public void Constructor_InvalidFileHandle ()
 		{
 			new FileStream ((IntPtr) (-1L), FileAccess.Read);
 		}
+#endif // TARGET_JVM
 
 		[Test]
 		public void PositionAfterSetLength ()

+ 6 - 0
mcs/class/corlib/Test/System.Reflection/AssemblyNameTest.cs

@@ -13,7 +13,9 @@ using System;
 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;
@@ -296,6 +298,7 @@ public class AssemblyNameTest {
 		return assemblyName;
 	}
 
+#if !TARGET_JVM // Reflection.Emit is not supported for TARGET_JVM.
 	private Assembly GenerateAssembly (AssemblyName name) 
 	{
 		AssemblyBuilder ab = domain.DefineDynamicAssembly (
@@ -379,6 +382,7 @@ public class AssemblyNameTest {
 		Assert.AreEqual ("1.2.65535.65535", ab.GetName ().Version.ToString (), "1.2.0.0 dynamic");
 #endif
 	}
+#endif // TARGET_JVM
 
 	[Test]
 	public void HashAlgorithm ()
@@ -469,6 +473,7 @@ public class AssemblyNameTest {
 		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 ()
@@ -476,6 +481,7 @@ public class AssemblyNameTest {
 		AssemblyName an = new AssemblyName ();
 		an.GetObjectData (null, new StreamingContext (StreamingContextStates.All));
 	}
+#endif // TARGET_JVM
 
 	[Test]
 #if NET_2_0

+ 11 - 2
mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs

@@ -35,7 +35,9 @@ using System.Configuration.Assemblies;
 using System.Globalization;
 using System.IO;
 using System.Reflection;
+#if !TARGET_JVM
 using System.Reflection.Emit;
+#endif
 using System.Runtime.Serialization;
 using System.Security;
 
@@ -83,16 +85,18 @@ namespace MonoTests.System.Reflection
 			string fname = AppDomain.CurrentDomain.FriendlyName;
 			if (fname.EndsWith (".dll")) { // nunit-console
 				Assert.IsNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
-#if NET_2_0
+#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM
 				Assert.IsFalse (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
 #endif
 			} else { // gnunit
 				Assert.IsNotNull (Assembly.GetEntryAssembly (), "GetEntryAssembly");
-#if NET_2_0
+#if NET_2_0 && !TARGET_JVM // IsDefaultAppDomain not supported for TARGET_JVM
 				Assert.IsTrue (AppDomain.CurrentDomain.IsDefaultAppDomain (), "!default appdomain");
 #endif
 			}
 		}
+
+#if !TARGET_JVM // ManifestModule not supported under TARGET_JVM.
 #if NET_2_0
 		[Category ("NotWorking")]
 #endif
@@ -141,6 +145,7 @@ namespace MonoTests.System.Reflection
 			Assert.AreEqual ("v1.1.4322", corlib_test.ImageRuntimeVersion, "ImageRuntimeVersion");
 #endif
 		}
+#endif
 
 		[Test]
 		public void GetAssembly ()
@@ -251,6 +256,7 @@ namespace MonoTests.System.Reflection
 			Assertion.Fail ("Was not able to load any corlib test");
 		}
 
+#if !TARGET_JVM // GetObjectData currently not implemented for Assembly.
 		[Test]
 		[ExpectedException (typeof (ArgumentNullException))]
 		public void GetObjectData_Null ()
@@ -258,6 +264,7 @@ namespace MonoTests.System.Reflection
 			Assembly corlib = typeof (int).Assembly;
 			corlib.GetObjectData (null, new StreamingContext (StreamingContextStates.All));
 		}
+#endif // TARGET_JVM
 
 		[Test]
 		public void GetReferencedAssemblies ()
@@ -279,6 +286,7 @@ namespace MonoTests.System.Reflection
 			}
 		}
 
+#if !TARGET_JVM // Reflection.Emit is not supported.
 		[Test]
 		public void Location_Empty() {
 			string assemblyFileName = Path.Combine (
@@ -897,6 +905,7 @@ namespace MonoTests.System.Reflection
 
 			Directory.Delete (outdir, true);
 		}
+#endif // TARGET_JVM
 
 		[Serializable ()]
 		private class AssemblyResolveHandler

+ 2 - 0
mcs/class/corlib/Test/System.Reflection/EventInfoTest.cs

@@ -28,7 +28,9 @@
 using System;
 using System.Threading;
 using System.Reflection;
+#if !TARGET_JVM
 using System.Reflection.Emit;
+#endif // TARGET_JVM
 using System.Runtime.InteropServices;
 
 using NUnit.Framework;

+ 6 - 0
mcs/class/corlib/Test/System.Reflection/FieldInfoTest.cs

@@ -29,7 +29,9 @@
 using System;
 using System.Threading;
 using System.Reflection;
+#if !TARGET_JVM
 using System.Reflection.Emit;
+#endif // TARGET_JVM
 using System.Runtime.InteropServices;
 
 using NUnit.Framework;
@@ -96,6 +98,7 @@ public class FieldInfoTest : Assertion
 		*/
 	}
 
+#if !TARGET_JVM // ReflectionOnlyLoad not supported for TARGET_JVM
 	[Test]
 	[ExpectedException (typeof (InvalidOperationException))]
 	public void GetValueOnRefOnlyAssembly ()
@@ -117,6 +120,7 @@ public class FieldInfoTest : Assertion
 
 		f.SetValue (null, 8);
 	}
+#endif // TARGET_JVM
 
 	const int literal = 42;
 
@@ -152,6 +156,7 @@ public class FieldInfoTest : Assertion
 		AssertEquals (null, fi2.GetValue (t));
 	}
 	
+#if !TARGET_JVM // TypeBuilder not supported for TARGET_JVM
 	[Test]
 	public void NonPublicTests ()
 	{		
@@ -169,6 +174,7 @@ public class FieldInfoTest : Assertion
 		FieldInfo f = TypeBuilder.GetField (t, fi);
 		AssertNotNull (f);	
 	}
+#endif // TARGET_JVM
 	
 #endif
 }		

+ 4 - 0
mcs/class/corlib/Test/System.Reflection/MethodInfoTest.cs

@@ -175,6 +175,7 @@ namespace MonoTests.System.Reflection
 			Assert.AreEqual (typeof (GBD_D), typeof (GBD_E).GetMethod ("f").GetBaseDefinition ().DeclaringType);
 		}
 
+#if !TARGET_JVM // MethodBody not supported for TARGET_JVM
 #if NET_2_0
 		[Test]
 		public void GetMethodBody_Abstract () {
@@ -231,6 +232,7 @@ namespace MonoTests.System.Reflection
 			else
 				Assert.AreEqual (false, locals [1].IsPinned, "#6");
 		}
+#endif // TARGET_JVM
 
 		public int return_parameter_test () {
 			return 0;
@@ -246,6 +248,7 @@ namespace MonoTests.System.Reflection
 			//Assert.AreEqual (True, pi.IsRetval);
 		}
 
+#if !TARGET_JVM // ReflectionOnlyLoad not supported for TARGET_JVM
 		[Test]
 		[ExpectedException (typeof (InvalidOperationException))]
 		public void InvokeOnRefOnlyAssembly ()
@@ -256,6 +259,7 @@ namespace MonoTests.System.Reflection
 			
 			m.Invoke (null, new object [0]);
 		}
+#endif // TARGET_JVM
 
 		[Test]
 		public void InvokeGenericVtype ()

+ 2 - 0
mcs/class/corlib/Test/System.Reflection/ParameterInfoTest.cs

@@ -10,7 +10,9 @@
 using System;
 using System.Threading;
 using System.Reflection;
+#if !TARGET_JVM
 using System.Reflection.Emit;
+#endif // TARGET_JVM
 using System.Runtime.InteropServices;
 
 using NUnit.Framework;

+ 2 - 0
mcs/class/corlib/Test/System.Reflection/TypeDelegatorTest.cs

@@ -28,7 +28,9 @@
 using System;
 using System.Threading;
 using System.Reflection;
+#if !TARGET_JVM
 using System.Reflection.Emit;
+#endif // TARGET_JVM
 
 using NUnit.Framework;
 

+ 8 - 0
mcs/class/corlib/Test/System.Threading/InterlockedTest.cs

@@ -38,9 +38,11 @@ namespace MonoTests.System.Threading
 		readonly object obj_1 = "obj_1";
 		readonly object obj_2 = "obj_2";
 		readonly object obj_3 = "obj_3";
+#if !TARGET_JVM // No support for exchanging two IntPtrs
 		readonly IntPtr iptr_1 = (IntPtr)int32_1;
 		readonly IntPtr iptr_2 = (IntPtr)int32_2;
 		readonly IntPtr iptr_3 = (IntPtr)int32_3;
+#endif // TARGET_JVM
 
 		[Test]
 		public void TestExchange_Int32 ()
@@ -83,6 +85,7 @@ namespace MonoTests.System.Threading
 			Assert.AreEqual(dbl_2, dbl);
 		}
 
+#if !TARGET_JVM // No support for exchanging two IntPtrs
 		[Test]
 		public void TestExchange_Iptr ()
 		{
@@ -90,6 +93,7 @@ namespace MonoTests.System.Threading
 			Assert.AreEqual(iptr_1, Interlocked.Exchange(ref iptr, iptr_2));
 			Assert.AreEqual(iptr_2, iptr);
 		}
+#endif // TARGET_JVM
 #endif
 
 		[Test]
@@ -133,6 +137,7 @@ namespace MonoTests.System.Threading
 			Assert.AreEqual(dbl_2, dbl);
 		}
 
+#if !TARGET_JVM // No support for compare exchanging two IntPtrs
 		[Test]
 		public void TestCompareExchange_Iptr ()
 		{
@@ -140,6 +145,7 @@ namespace MonoTests.System.Threading
 			Assert.AreEqual(iptr_1, Interlocked.CompareExchange(ref iptr, iptr_2, iptr_1));
 			Assert.AreEqual(iptr_2, iptr);
 		}
+#endif // TARGET_JVM
 #endif
 
 		[Test]
@@ -183,6 +189,7 @@ namespace MonoTests.System.Threading
 			Assert.AreEqual(dbl_1, dbl);
 		}
 
+#if !TARGET_JVM // No support for compare exchanging two IntPtrs
 		[Test]
 		public void TestCompareExchange_Failed_Iptr ()
 		{
@@ -190,6 +197,7 @@ namespace MonoTests.System.Threading
 			Assert.AreEqual(iptr_1, Interlocked.CompareExchange(ref iptr, iptr_2, iptr_3));
 			Assert.AreEqual(iptr_1, iptr);
 		}
+#endif // TARGET_JVM
 #endif
 
 		[Test]

+ 6 - 6
mcs/class/corlib/Test/System.Threading/MutexTest.cs

@@ -25,11 +25,11 @@ namespace MonoTests.System.Threading
 				this.id = id;
 				this.mut = mut;
 			}
-			public void wait()
+			public void Wait()
 			{
 				mut.WaitOne();
 			}
-			public void signal()
+			public void Signal()
 			{
 				mut.ReleaseMutex();
 			}
@@ -47,7 +47,7 @@ namespace MonoTests.System.Threading
 			public void WithoutWait()
 			{
 				this.marker = this.id;
-				this.signal();
+				this.Signal();
 			}
 
 
@@ -55,15 +55,15 @@ namespace MonoTests.System.Threading
 			{
 				while (this.marker<100)
 				{
-					this.wait();
+					this.Wait();
 					this.marker++;
-					this.signal();
+					this.Signal();
 				}
 			}
 
 			public void WaitAndForget()
 			{
-				this.wait();
+				this.Wait();
 				this.marker = id;
 			}
 			public void WaitAndWait()

+ 6 - 0
mcs/class/corlib/Test/System.Threading/ThreadTest.cs

@@ -23,7 +23,9 @@ namespace MonoTests.System.Threading {
 
 		public static void NoPrincipal () 
 		{
+#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
 			AppDomain.CurrentDomain.SetPrincipalPolicy (PrincipalPolicy.NoPrincipal);
+#endif
 			IPrincipal p = Thread.CurrentPrincipal;
 			AssertNull ("Thread.CurrentPrincipal-1", p);
 
@@ -35,6 +37,7 @@ namespace MonoTests.System.Threading {
 			// in this case we can return to null
 		}
 
+#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
 		public static void UnauthenticatedPrincipal () 
 		{
 			AppDomain.CurrentDomain.SetPrincipalPolicy (PrincipalPolicy.UnauthenticatedPrincipal);
@@ -71,6 +74,7 @@ namespace MonoTests.System.Threading {
 			AssertNotNull ("Thread.CurrentPrincipal-3", Thread.CurrentPrincipal);
 			// in this case we can't return to null
 		}
+#endif // TARGET_JVM
 
 		public static void CopyOnNewThread ()
 		{
@@ -491,6 +495,7 @@ namespace MonoTests.System.Threading {
 			}
 		}
 
+#if !TARGET_JVM // AppDomain.SetPrincipalPolicy not supported for TARGET_JVM
 		[Test]
 		[Ignore ("see comment below.")]
 		public void CurrentPrincipal_PrincipalPolicy_UnauthenticatedPrincipal () 
@@ -521,6 +526,7 @@ namespace MonoTests.System.Threading {
 				t.Abort ();
 			}
 		}
+#endif // TARGET_JVM
 		
 		[Test]
 		public void IPrincipal_CopyOnNewThread () 

+ 6 - 0
mcs/class/corlib/Test/System/ActivatorTest.cs

@@ -13,7 +13,9 @@ using System;
 using System.Globalization;
 using System.IO;
 using System.Reflection;
+#if !TARGET_JVM // Reflection.Emit not supported for TARGET_JVM
 using System.Reflection.Emit;
+#endif
 using System.Runtime.InteropServices;
 using System.Runtime.Remoting;
 using System.Runtime.Remoting.Channels;
@@ -117,6 +119,7 @@ namespace MonoTests.System {
 			Assert.AreEqual (7, objCOMTest.Id, "#A05");
 		}
 
+#if !TARGET_JVM // Reflection.Emit not supported for TARGET_JVM
 		[Test]
 		[ExpectedException (typeof (MissingMethodException))]
 		public void CreateInstance_TypeBuilder ()
@@ -139,6 +142,7 @@ namespace MonoTests.System {
 		{
 			Activator.CreateInstance (typeof (ArgIterator), null);
 		}
+#endif // TARGET_JVM
 
 		[Test]
 		[ExpectedException (typeof (NotSupportedException))]
@@ -147,12 +151,14 @@ namespace MonoTests.System {
 			Activator.CreateInstance (typeof (void), null);
 		}
 
+#if !TARGET_JVM // RuntimeArgumentHandle not supported for TARGET_JVM
 		[Test]
 		[ExpectedException (typeof (NotSupportedException))]
 		public void CreateInstance_RuntimeArgumentHandle ()
 		{
 			Activator.CreateInstance (typeof (RuntimeArgumentHandle), null);
 		}
+#endif // TARGET_JVM
 
 		[Test]
 		[ExpectedException (typeof (NotSupportedException))]

+ 2 - 0
mcs/class/corlib/Test/System/EnvironmentTest.cs

@@ -151,6 +151,7 @@ namespace MonoTests.System {
 			Environment.GetEnvironmentVariables ((EnvironmentVariableTarget)Int32.MinValue);
 		}
 
+#if !TARGET_JVM // Environment.SetEnvironmentVariable not supported under TARGET_JVM
 		[Test]
 		[ExpectedException (typeof (ArgumentException))]
 		public void SetEnvironmentVariable_Target ()
@@ -202,6 +203,7 @@ namespace MonoTests.System {
 			Environment.SetEnvironmentVariable ("A3", "\0");
 			Assert.AreEqual (Environment.GetEnvironmentVariables ()["A3"], null);
 		}
+#endif // TARGET_JVM
 #endif
 	}
 }

+ 2 - 0
mcs/class/corlib/Test/System/TypeTest.cs

@@ -217,6 +217,7 @@ namespace MonoTests.System
 			Assert.AreEqual (1, typeof (Derived1).GetProperties ().Length, "#03");
 		}
 
+#if !TARGET_JVM // StructLayout not supported for TARGET_JVM
 		[StructLayout(LayoutKind.Explicit, Pack = 4, Size = 64)]
 		public class Class1 {
 		}
@@ -241,6 +242,7 @@ namespace MonoTests.System
 			Assert.AreEqual (CharSet.Unicode, attr3.CharSet);
 		}
 #endif
+#endif // TARGET_JVM
 
 		[Test]
 		public void Namespace () {