Imported Upstream version 4.2.0.179

Former-commit-id: 0a113cb3a6feb7873f632839b1307cc6033cd595
This commit is contained in:
Xamarin Public Jenkins
2015-08-26 07:17:56 -04:00
committed by Jo Shields
parent 183bba2c9a
commit 6992685b86
7507 changed files with 90259 additions and 657307 deletions

View File

@ -10,6 +10,7 @@ using System.Text;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.System.Net.WebSockets
{
@ -17,7 +18,7 @@ namespace MonoTests.System.Net.WebSockets
public class ClientWebSocketTest
{
const string EchoServerUrl = "ws://echo.websocket.org";
const int Port = 42123;
int Port = NetworkHelpers.FindFreePort ();
HttpListener listener;
ClientWebSocket socket;
MethodInfo headerSetMethod;
@ -47,6 +48,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void ServerHandshakeReturnCrapStatusCodeTest ()
{
// On purpose,
@ -63,6 +65,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void ServerHandshakeReturnWrongUpgradeHeader ()
{
#pragma warning disable 4014
@ -81,6 +84,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void ServerHandshakeReturnWrongConnectionHeader ()
{
#pragma warning disable 4014
@ -101,6 +105,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // The test hangs when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void EchoTest ()
{
const string Payload = "This is a websocket test";
@ -125,6 +130,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void CloseOutputAsyncTest ()
{
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
@ -141,6 +147,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void CloseAsyncTest ()
{
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
@ -157,6 +164,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test, ExpectedException (typeof (ArgumentNullException))]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void SendAsyncArgTest_NoArray ()
{
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
@ -170,6 +178,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test, ExpectedException (typeof (ArgumentNullException))]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void ReceiveAsyncArgTest_NoArray ()
{
Assert.IsTrue (socket.ConnectAsync (new Uri (EchoServerUrl), CancellationToken.None).Wait (5000));
@ -177,6 +186,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void ReceiveAsyncWrongState_Closed ()
{
try {
@ -191,6 +201,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void SendAsyncWrongState_Closed ()
{
try {
@ -205,6 +216,7 @@ namespace MonoTests.System.Net.WebSockets
}
[Test]
[Category ("AndroidNotWorking")] // Fails when ran as part of the entire BCL test suite. Works when only this fixture is ran
public void SendAsyncWrongState_CloseSent ()
{
try {