Imported Upstream version 3.10.0

Former-commit-id: 172c8e3c300b39d5785c7a3e8dfb08ebdbc1a99b
This commit is contained in:
Jo Shields
2014-10-04 11:27:48 +01:00
parent fe777c5c82
commit 8b9b85e7f5
970 changed files with 20242 additions and 31308 deletions

View File

@@ -28,8 +28,8 @@ namespace MonoTests.System.Net
[TestFixture]
public class DnsTest
{
private String site1Name = "xamarin.com",
site1Dot = "50.19.126.231",
private String site1Name = "jenkins.mono-project.com",
site1Dot = "162.253.133.196",
site2Name = "info.diku.dk",
site2Dot = "130.225.96.4",
noneExistingSite = "unlikely.xamarin.com";
@@ -44,7 +44,7 @@ namespace MonoTests.System.Net
IAsyncResult async = Dns.BeginGetHostByName (site1Name, null, null);
IPHostEntry entry = Dns.EndGetHostByName (async);
SubTestValidIPHostEntry (entry);
Assert.IsTrue (entry.HostName == "www.xamarin.com" || entry.HostName == "xamarin.com");
Assert.IsTrue (entry.HostName == "jenkins.mono-project.com");
}
void GetHostByNameCallback (IAsyncResult ar)
@@ -191,7 +191,7 @@ namespace MonoTests.System.Net
[Test]
public void GetHostByName ()
{
SubTestGetHostByName ("www.xamarin.com", site1Dot);
SubTestGetHostByName ("jenkins.mono-project.com", site1Dot);
SubTestGetHostByName (site2Name, site2Dot);
try {
var entry = Dns.GetHostByName (noneExistingSite);
@@ -252,9 +252,6 @@ namespace MonoTests.System.Net
[Test]
[ExpectedException (typeof (SocketException))]
#if TARGET_JVM
[Ignore ("Ignore failures in Sys.Net")]
#endif
public void GetHostByAddressString2 ()
{
Dns.GetHostByAddress ("123.255.23");

View File

@@ -21,10 +21,6 @@ using System.Security.Permissions;
using NUnit.Framework;
#if TARGET_JVM
using System.Globalization;
using System.Reflection;
#endif
namespace MonoTests.System.Net
{
@@ -363,13 +359,11 @@ namespace MonoTests.System.Net
#else
Assert.AreEqual ("value", ex.Message, "#4");
#endif
#if !TARGET_JVM
#if NET_2_0
Assert.IsNotNull (ex.ParamName, "#5");
Assert.AreEqual ("value", ex.ParamName, "#6");
#else
Assert.IsNull (ex.ParamName, "#5");
#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
@@ -588,11 +582,9 @@ namespace MonoTests.System.Net
} catch (WebException ex) {
Assert.AreEqual (typeof (WebException), ex.GetType (), "#1");
Assert.IsNotNull (ex.Message, "#2");
#if !TARGET_JVM
Assert.IsTrue (ex.Message.IndexOf ("FileWebRequestTest.tmp") != -1, "#3");
Assert.IsNull (ex.Response, "#4");
Assert.IsNotNull (ex.InnerException, "#5");
#endif
#if ONLY_1_1
FileNotFoundException fnf = ex.InnerException as FileNotFoundException;
@@ -631,12 +623,10 @@ namespace MonoTests.System.Net
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
@@ -652,12 +642,10 @@ namespace MonoTests.System.Net
} catch (ArgumentException ex) {
Assert.AreEqual (typeof (ArgumentException), ex.GetType (), "#2");
Assert.IsNotNull (ex.Message, "#3");
#if !TARGET_JVM
#if NET_2_0
Assert.AreEqual ("value", ex.ParamName, "#4");
#else
Assert.IsNull (ex.ParamName, "#4");
#endif
#endif
Assert.IsNull (ex.InnerException, "#5");
}
@@ -713,23 +701,17 @@ namespace MonoTests.System.Net
} catch (ArgumentOutOfRangeException ex) {
Assert.AreEqual (typeof (ArgumentOutOfRangeException), ex.GetType (), "#3");
Assert.IsNotNull (ex.Message, "#4");
#if !TARGET_JVM
Assert.IsNotNull (ex.ParamName, "#5");
#if NET_2_0
Assert.IsFalse (ex.ParamName == "value", "#6");
#else
Assert.AreEqual ("value", ex.ParamName, "#6");
#endif
#endif
Assert.IsNull (ex.InnerException, "#7");
}
}
[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");
@@ -833,9 +815,6 @@ 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 ();
@@ -888,23 +867,6 @@ 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
@@ -913,7 +875,6 @@ namespace MonoTests.System.Net
return ((platform == 4) || (platform == 128) || (platform == 6));
}
}
#endif
private static readonly byte [] _serialized = new byte [] {
#if NET_2_0

View File

@@ -13,10 +13,6 @@ using System.Net;
using NUnit.Framework;
#if TARGET_JVM
using System.Globalization;
using System.Reflection;
#endif
namespace MonoTests.System.Net
@@ -225,23 +221,6 @@ 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
@@ -250,6 +229,5 @@ namespace MonoTests.System.Net
return ((platform == 4) || (platform == 128));
}
}
#endif
}
}

View File

@@ -45,9 +45,6 @@ using NUnit.Framework;
namespace MonoTests.System.Net {
[TestFixture]
#if TARGET_JVM
[Ignore ("The class HttpListener is not supported")]
#endif
public class HttpListener2Test {
private HttpListener _listener = null;

View File

@@ -33,9 +33,6 @@ 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))]

View File

@@ -34,11 +34,7 @@ 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 {
#if !TARGET_JVM
// NL -> Not listening -> tests when listener.IsListening == false
[Test]
public void NL_DefaultProperties ()
@@ -250,7 +246,6 @@ namespace MonoTests.System.Net {
}
Assert.AreEqual (items, 1);
}
#endif
}
}
#endif

View File

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

View File

@@ -35,11 +35,7 @@ using NUnit.Framework;
namespace MonoTests.System.Net {
[TestFixture]
#if TARGET_JVM
[Ignore ("The class HttpListener is not implemented")]
#endif
public class HttpListenerTest {
#if !TARGET_JVM
[Test]
public void DefaultProperties ()
{
@@ -454,7 +450,6 @@ namespace MonoTests.System.Net {
Event.Close ();
}
}
#endif
}
}
#endif

View File

@@ -1 +1 @@
ccf2484dfdddf2db7e554b5b4176c004fc9f9a94
889ad1b0a7c9785aae07b1b882ea1fc00716d176

View File

@@ -666,9 +666,6 @@ namespace MonoTests.System.Net
#if NET_2_0
[Test] // bug #324182
#if TARGET_JVM
[Category ("NotWorking")]
#endif
public void CanTimeout ()
{
IPEndPoint ep = new IPEndPoint (IPAddress.Loopback, 8000);

View File

@@ -416,9 +416,6 @@ public class IPAddressTest
}
[Test]
#if TARGET_JVM
[Ignore ("TD BUG ID: 7213")]
#endif
public void Constructor0_Address_Invalid ()
{
try {
@@ -473,9 +470,6 @@ 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 };

View File

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

View File

@@ -35,9 +35,6 @@ public class ServicePointTest
[Test]
[Category ("InetAccess")]
#if TARGET_JVM
[Ignore ("Unsupported - ServicePointManager.FindServicePoint")]
#endif
public void All ()
{
ServicePoint p = ServicePointManager.FindServicePoint (new Uri ("mailto:xx@yyy.com"));
@@ -119,9 +116,6 @@ 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..
@@ -155,9 +149,6 @@ public class ServicePointTest
#if NET_2_0
[Test]
[Category ("InetAccess")]
#if TARGET_JVM
[Ignore ("The System.Net.ServicePointManager.FindServicePoint(Uri) is not supported")]
#endif
public void EndPointBind ()
{
Uri uri = new Uri ("http://www.go-mono.com/");
@@ -166,26 +157,22 @@ public class ServicePointTest
HttpWebRequest req = (HttpWebRequest) WebRequest.Create (uri);
bool called = false;
#if !TARGET_JVM
sp.BindIPEndPointDelegate = delegate {
Assert.IsTrue (!called);
called = true;
return null;
};
#endif
req.GetResponse ().Close ();
Assert.IsTrue (called);
req = (HttpWebRequest) WebRequest.Create (uri);
called = false;
#if !TARGET_JVM
sp.BindIPEndPointDelegate = delegate(ServicePoint point, IPEndPoint remote, int times) {
Assert.IsTrue (times < 5);
called = true;
return new IPEndPoint(IPAddress.Parse("0.0.0.0"), 12345 + times);
};
#endif
req.GetResponse ().Close ();
Assert.IsTrue (called);

View File

@@ -277,11 +277,6 @@ 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),
@@ -342,10 +337,6 @@ 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 ();
@@ -366,10 +357,6 @@ 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 ();

View File

@@ -171,9 +171,6 @@ 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);
@@ -229,9 +226,6 @@ 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),

View File

@@ -60,9 +60,6 @@ namespace MonoTests.System.Net {
[Test]
[Category ("NotDotNet")]
#if TARGET_JVM
[Ignore ("TD #6954")]
#endif
public void HtmlEncode_XSS ()
{
string problem = "\xff1cscript\xff1e"; // unicode looks alike <script>