X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fclass%2FSystem%2FTest%2FSystem.Net%2FHttpWebRequestTest.cs;h=0d5763967b0d01256f3504a608fc899dfa65941e;hb=3fd54893bc792eee42164bfb605b418105a92f92;hp=ea928e50b3028df3f637377e58caab11f8e20610;hpb=7dc7782f832b270b3649d1b4f1244d7464e6c3b7;p=mono.git diff --git a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs index ea928e50b30..0d5763967b0 100644 --- a/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs +++ b/mcs/class/System/Test/System.Net/HttpWebRequestTest.cs @@ -36,6 +36,7 @@ using MonoTests.Helpers; namespace MonoTests.System.Net { [TestFixture] + [Category ("RequiresBSDSockets")] public class HttpWebRequestTest { private Random rand = new Random (); @@ -958,7 +959,7 @@ namespace MonoTests.System.Net [Ignore ("This does not timeout any more. That's how MS works when reading small responses")] public void ReadTimeout () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8764); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; using (SocketResponder responder = new SocketResponder (localEP, s => RedirectRequestHandler (s))) { @@ -988,7 +989,7 @@ namespace MonoTests.System.Net [Test] // bug #324300 public void AllowAutoRedirect () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8765); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; // allow autoredirect @@ -1034,7 +1035,7 @@ namespace MonoTests.System.Net [Test] public void PostAndRedirect_NoCL () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8769); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; using (SocketResponder responder = new SocketResponder (localEP, s => RedirectRequestHandler (s))) { @@ -1062,7 +1063,7 @@ namespace MonoTests.System.Net [Test] public void PostAndRedirect_CL () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8770); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; using (SocketResponder responder = new SocketResponder (localEP, s => RedirectRequestHandler (s))) { @@ -1090,7 +1091,7 @@ namespace MonoTests.System.Net [Test] public void PostAnd401 () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8771); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; using (SocketResponder responder = new SocketResponder (localEP, s => RedirectRequestHandler (s))) { @@ -1119,7 +1120,7 @@ namespace MonoTests.System.Net [Category ("NotWorking")] public void InternalServerError () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8766); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; // POST @@ -1176,7 +1177,7 @@ namespace MonoTests.System.Net [Category ("NotWorking")] // #B3 fails; we get a SocketException: An existing connection was forcibly closed by the remote host public void NoContentLength () { - IPEndPoint localEP = new IPEndPoint (IPAddress.Loopback, 8767); + IPEndPoint localEP = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + localEP.ToString () + "/original/"; // POST @@ -1417,7 +1418,7 @@ namespace MonoTests.System.Net [Test] // 1st possible case of https://bugzilla.novell.com/show_bug.cgi?id=MONO74177 public void TestTimeoutPropertyWithServerThatExistsAndRespondsButTooLate () { - var ep = new IPEndPoint (IPAddress.Loopback, 8123); + var ep = NetworkHelpers.LocalEphemeralEndPoint (); string url = "http://" + ep + "/foobar/"; using (var responder = new SocketResponder (ep, TimeOutHandler)) @@ -1718,7 +1719,9 @@ namespace MonoTests.System.Net Where = "first write"; StreamWriter writer = new StreamWriter (ns, Encoding.ASCII); writer.Write ( "HTTP/1.1 401 Unauthorized\r\n" + - "WWW-Authenticate: NTLM\r\n" + + "WWW-Authenticate: ignore\r\n" + + "WWW-Authenticate: NTLM\r\n" + + "WWW-Authenticate: ignore,K\r\n" + "Content-Length: 5\r\n\r\nWRONG"); writer.Flush (); @@ -2309,7 +2312,6 @@ namespace MonoTests.System.Net completed [1] = new ManualResetEvent (false); using (ListenerScope scope = new ListenerScope (processor, port, completed [0])) { - ManualResetEvent clientCompleted = new ManualResetEvent (false); Uri address = new Uri (string.Format ("http://localhost:{0}", port)); HttpWebRequest client = (HttpWebRequest) WebRequest.Create (address); @@ -2480,7 +2482,6 @@ namespace MonoTests.System.Net } } -#if NET_4_5 [Test] public void AllowReadStreamBuffering () { @@ -2492,7 +2493,6 @@ namespace MonoTests.System.Net } catch (InvalidOperationException) { } } -#endif class ListenerScope : IDisposable { EventWaitHandle completed; @@ -2761,6 +2761,7 @@ namespace MonoTests.System.Net } [TestFixture] + [Category ("RequiresBSDSockets")] public class HttpRequestStreamTest { [Test]