Issue #1650 - testcase stability effort
This commit is contained in:
parent
ed692f3917
commit
2fc86c209b
|
@ -111,9 +111,7 @@ public class BasicAppTest
|
||||||
socket.close(StatusCode.NORMAL,"Test complete");
|
socket.close(StatusCode.NORMAL,"Test complete");
|
||||||
socket.awaitClose(5,TimeUnit.SECONDS);
|
socket.awaitClose(5,TimeUnit.SECONDS);
|
||||||
|
|
||||||
assertThat("Messages received",socket.getTextMessages().size(),is(1));
|
|
||||||
String response = socket.getTextMessages().poll(5, TimeUnit.SECONDS);
|
String response = socket.getTextMessages().poll(5, TimeUnit.SECONDS);
|
||||||
|
|
||||||
assertThat("Message[0]",response,is("Hello World"));
|
assertThat("Message[0]",response,is("Hello World"));
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
|
@ -21,6 +21,7 @@ package org.eclipse.jetty.cdi.websocket.cdiapp;
|
||||||
import static org.hamcrest.Matchers.allOf;
|
import static org.hamcrest.Matchers.allOf;
|
||||||
import static org.hamcrest.Matchers.containsString;
|
import static org.hamcrest.Matchers.containsString;
|
||||||
import static org.hamcrest.Matchers.is;
|
import static org.hamcrest.Matchers.is;
|
||||||
|
import static org.hamcrest.Matchers.notNullValue;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -139,8 +140,7 @@ public class CdiAppTest
|
||||||
socket.close(StatusCode.NORMAL,"Test complete");
|
socket.close(StatusCode.NORMAL,"Test complete");
|
||||||
socket.awaitClose(2,TimeUnit.SECONDS);
|
socket.awaitClose(2,TimeUnit.SECONDS);
|
||||||
|
|
||||||
assertThat("Messages received",socket.getTextMessages().size(),is(1));
|
String response = socket.getTextMessages().poll(5, TimeUnit.SECONDS);
|
||||||
String response = socket.getTextMessages().poll();
|
|
||||||
|
|
||||||
assertThat("Message[0]",response,
|
assertThat("Message[0]",response,
|
||||||
allOf(
|
allOf(
|
||||||
|
@ -170,9 +170,10 @@ public class CdiAppTest
|
||||||
socket.close(StatusCode.NORMAL,"Test complete");
|
socket.close(StatusCode.NORMAL,"Test complete");
|
||||||
socket.awaitClose(2,TimeUnit.SECONDS);
|
socket.awaitClose(2,TimeUnit.SECONDS);
|
||||||
|
|
||||||
assertThat("Messages received",socket.getTextMessages().size(),is(2));
|
String response = socket.getTextMessages().poll(5, TimeUnit.SECONDS);
|
||||||
String response = socket.getTextMessages().poll();
|
|
||||||
assertThat("Message[0]",response,containsString("Hello there stuff"));
|
assertThat("Message[0]",response,containsString("Hello there stuff"));
|
||||||
|
response = socket.getTextMessages().poll(5, TimeUnit.SECONDS);
|
||||||
|
assertThat("Message[1]",response,notNullValue());
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue