2
0
Эх сурвалжийг харах

Excluded the tests, which are not working under Grasshopper (all changes under 'TARGET_JVM' directive)

svn path=/trunk/mcs/; revision=72030
Ilya Kharmatsky 19 жил өмнө
parent
commit
66285529d7

+ 14 - 0
mcs/class/System/Test/System.Net/ChangeLog

@@ -1,3 +1,17 @@
+2007-01-31  Ilya Kharmatsky  <ilyak -at- mainsoft.com>
+
+	* IPAddressTest.cs, WebProxyTest.cs, WebHeaderCollectionTest.cs,
+	  ServicePointManagerTest.cs, ServicePointTest.cs:
+	  Excluded not working in Grasshopper tests, under 'TARGET_JVM'
+	  directive
+	* HttpListenerPrefixCollectionTest.cs, HttpListenerTest.cs,
+	  HttpListenerBasicIdentityTest.cs, HttpListener2Test.cs:
+	  Excluded entire test fixture, since HttpListener still not 
+	  implemented in Grasshopper.
+	* FileWebRequestTest.cs, FileWebResponseTest.cs:
+	  Excluded not working in Grasshopper tests and provided different
+	  implementation of helper methods - under 'TARGET_JVM'
+
 2007-01-30  Atsushi Enomoto  <[email protected]>
 
 	* HttpWebRequestTest.cs : use correct attribute.

+ 33 - 4
mcs/class/System/Test/System.Net/FileWebRequestTest.cs

@@ -21,6 +21,11 @@ using System.Security.Permissions;
 
 using NUnit.Framework;
 
+#if TARGET_JVM
+using System.Globalization;
+using System.Reflection;
+#endif
+
 namespace MonoTests.System.Net
 {
 	[TestFixture]
@@ -58,6 +63,9 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		[Ignore ("Bug in resource releasing - cannot delete file")]
+#endif
 		public void Async ()
 		{
 			WebResponse res = null;
@@ -184,10 +192,6 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
-#if TARGET_JVM
-	[Ignore ("TD BUG ID: 7205")]
-	[Category ("NotWorking")]
-#endif	
 		public void Sync ()
 		{
 			WebResponse res = null;
@@ -676,6 +680,10 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		//FIXME: include Java serialization compliant tests
+		[Ignore ("The MS compliant binary serialization is not supported")]
+#endif			
 		public void GetObjectData ()
 		{
 			FileWebRequest fwr = (FileWebRequest) WebRequest.Create ("file:///test.txt");
@@ -779,6 +787,9 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		[Ignore ("The MS compliant binary serialization is not supported")]
+#endif		
 		public void Deserialize ()
 		{
 			MemoryStream ms = new MemoryStream ();
@@ -831,6 +842,23 @@ namespace MonoTests.System.Net
 			return new Uri ("file:///" + tempFile);
 		}
 
+#if TARGET_JVM
+        
+        private bool RunningOnUnix {
+			get {
+                Type t = Type.GetType("java.lang.System");
+                MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
+                string osName = (string) mi.Invoke(null, new object[] { "os.name" });
+				
+				if(osName == null) {
+					return false;
+				}
+				
+				return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
+			}
+		}
+				
+#else
 		private bool RunningOnUnix {
 			get {
 				// check for Unix platforms - see FAQ for more details
@@ -839,6 +867,7 @@ namespace MonoTests.System.Net
 				return ((platform == 4) || (platform == 128));
 			}
 		}
+#endif		
 
 		private static readonly byte [] _serialized = new byte [] {
 #if NET_2_0

+ 24 - 1
mcs/class/System/Test/System.Net/FileWebResponseTest.cs

@@ -13,6 +13,12 @@ using System.Net;
 
 using NUnit.Framework;
 
+#if TARGET_JVM
+using System.Globalization;
+using System.Reflection;
+#endif
+
+
 namespace MonoTests.System.Net
 {
 	[TestFixture]
@@ -219,7 +225,23 @@ namespace MonoTests.System.Net
 			}
 			return new Uri ("file:///" + tempFile);
 		}
-
+#if TARGET_JVM
+        
+        private bool RunningOnUnix {
+			get {
+                		Type t = Type.GetType("java.lang.System");
+                		MethodInfo mi = t.GetMethod("getProperty", new Type[] { typeof(string) });
+                		string osName = (string) mi.Invoke(null, new object[] { "os.name" });
+				
+				if(osName == null) {
+					return false;
+				}
+				
+				return !osName.StartsWith("win", true, CultureInfo.InvariantCulture);
+			}
+		}
+				
+#else
 		private bool RunningOnUnix {
 			get {
 				// check for Unix platforms - see FAQ for more details
@@ -228,5 +250,6 @@ namespace MonoTests.System.Net
 				return ((platform == 4) || (platform == 128));
 			}
 		}
+#endif		
 	}
 }

+ 3 - 0
mcs/class/System/Test/System.Net/HttpListener2Test.cs

@@ -41,6 +41,9 @@ using NUnit.Framework;
 // ***************************************************************************************
 namespace MonoTests.System.Net {
 	[TestFixture]
+#if TARGET_JVM	
+	[Ignore ("The class HttpListener is not supported")]
+#endif
 	public class HttpListener2Test {
 		public class MyNetworkStream : NetworkStream {
 			public MyNetworkStream (Socket sock) : base (sock, true)

+ 3 - 0
mcs/class/System/Test/System.Net/HttpListenerBasicIdentityTest.cs

@@ -33,6 +33,9 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Net {
 	[TestFixture]
+#if TARGET_JVM
+	[Ignore ("The class HttpListenerBasicIdentity - is not supported")]
+#endif
 	public class HttpListenerBasicIdentityTest {
 		[Test]
 		[ExpectedException (typeof (ArgumentNullException))]

+ 3 - 0
mcs/class/System/Test/System.Net/HttpListenerPrefixCollectionTest.cs

@@ -34,6 +34,9 @@ using HLPC=System.Net.HttpListenerPrefixCollection;
 
 namespace MonoTests.System.Net {
 	[TestFixture]
+#if TARGET_JVM
+	[Ignore ("The class System.Net.HttpListenerPrefixCollection - is not supported")]
+#endif
 	public class HttpListenerPrefixCollectionTest {
 		// NL -> Not listening -> tests when listener.IsListening == false
 		[Test]

+ 3 - 0
mcs/class/System/Test/System.Net/HttpListenerTest.cs

@@ -34,6 +34,9 @@ using NUnit.Framework;
 
 namespace MonoTests.System.Net {
 	[TestFixture]
+#if TARGET_JVM
+	[Ignore ("The class HttpListener is not implemented")]
+#endif
 	public class HttpListenerTest {
 		[Test]
 		public void DefaultProperties ()

+ 3 - 0
mcs/class/System/Test/System.Net/IPAddressTest.cs

@@ -412,6 +412,9 @@ public class IPAddressTest
 	}
 
 	[Test]
+#if TARGET_JVM
+	[Ignore ("TD BUG ID: 7213")]
+#endif
 	public void Constructor1_Address_4Byte ()
 	{
 		byte [] bytes = new byte [4] { 192, 202, 112, 37 };

+ 3 - 0
mcs/class/System/Test/System.Net/ServicePointManagerTest.cs

@@ -44,6 +44,9 @@ public class ServicePointManagerTest : Assertion
 
         [Test, ExpectedException (typeof (InvalidOperationException))]
 		[Category ("InetAccess")]
+#if TARGET_JVM
+	[Ignore ("Unsupported property - ServicePointManager.MaxServicePoints")]
+#endif
         public void MaxServicePointManagers ()
         {
 		AssertEquals ("#1", 0, ServicePointManager.MaxServicePoints);

+ 6 - 0
mcs/class/System/Test/System.Net/ServicePointTest.cs

@@ -35,6 +35,9 @@ public class ServicePointTest
 
         [Test]
 		[Category ("InetAccess")]
+#if TARGET_JVM
+	[Ignore ("Unsupported - ServicePointManager.FindServicePoint")]
+#endif
         public void All ()
         {
 		ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:[email protected]"));
@@ -116,6 +119,9 @@ public class ServicePointTest
 
 	[Test]
 	[Category ("InetAccess")]
+#if TARGET_JVM
+	[Ignore ("The System.Net.ServicePointManager.FindServicePoint(Uri) is not supported")]
+#endif	
 	public void ConnectionLimit ()
 	{		
 		// the default is already 2, just in case it isn't..

+ 13 - 0
mcs/class/System/Test/System.Net/WebHeaderCollectionTest.cs

@@ -219,6 +219,11 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		//FIXME: include Java serialization compliant tests - the order of object
+		// in SerializationInfo should stay same to MS format...
+		[Ignore ("The MS compliant binary serialization is not supported")]
+#endif			
 		public void GetObjectData ()
 		{
 			SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),
@@ -279,6 +284,10 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		//FIXME: include Java serialization compliant tests
+		[Ignore ("The MS compliant binary serialization is not supported")]
+#endif		
 		public void Serialize ()
 		{
 			WebHeaderCollection headers = new WebHeaderCollection ();
@@ -299,6 +308,10 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		//FIXME: include Java serialization compliant tests
+		[Ignore ("The MS compliant binary serialization format is not supported")]
+#endif				
 		public void Deserialize ()
 		{
 			MemoryStream ms = new MemoryStream ();

+ 6 - 0
mcs/class/System/Test/System.Net/WebProxyTest.cs

@@ -173,6 +173,9 @@ namespace MonoTests.System.Net
 		}
 
 		[Test]
+#if TARGET_JVM
+		[Ignore ("TD BUG ID: 7213")]
+#endif		
 		public void IsByPassed_Host_Null ()
 		{
 			WebProxy p = new WebProxy ("http://proxy.contoso.com", true);
@@ -212,6 +215,9 @@ namespace MonoTests.System.Net
 
 
 		[Test]
+#if TARGET_JVM
+		[Ignore ("The MS compliant binary serialization is not supported")]
+#endif		
 		public void GetObjectData ()
 		{
 			SerializationInfo si = new SerializationInfo (typeof (WebHeaderCollection),