Issue #1650 - testcase stability effort (take 5 w/debug)
This commit is contained in:
parent
a3427cc32d
commit
07c287c5cb
|
@ -23,6 +23,7 @@ import static org.junit.Assert.assertThat;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import javax.websocket.server.ServerContainer;
|
import javax.websocket.server.ServerContainer;
|
||||||
|
@ -36,6 +37,7 @@ import org.eclipse.jetty.util.log.JettyLogHandler;
|
||||||
import org.eclipse.jetty.util.log.Log;
|
import org.eclipse.jetty.util.log.Log;
|
||||||
import org.eclipse.jetty.util.log.Logger;
|
import org.eclipse.jetty.util.log.Logger;
|
||||||
import org.eclipse.jetty.util.resource.Resource;
|
import org.eclipse.jetty.util.resource.Resource;
|
||||||
|
import org.eclipse.jetty.websocket.api.Session;
|
||||||
import org.eclipse.jetty.websocket.api.StatusCode;
|
import org.eclipse.jetty.websocket.api.StatusCode;
|
||||||
import org.eclipse.jetty.websocket.api.util.WSURI;
|
import org.eclipse.jetty.websocket.api.util.WSURI;
|
||||||
import org.eclipse.jetty.websocket.client.WebSocketClient;
|
import org.eclipse.jetty.websocket.client.WebSocketClient;
|
||||||
|
@ -102,10 +104,10 @@ public class BasicAppTest
|
||||||
{
|
{
|
||||||
client.start();
|
client.start();
|
||||||
CheckSocket socket = new CheckSocket();
|
CheckSocket socket = new CheckSocket();
|
||||||
client.connect(socket,serverWebsocketURI.resolve("/echo"));
|
Future<Session> futureSession = client.connect(socket,serverWebsocketURI.resolve("/echo"));
|
||||||
|
|
||||||
socket.awaitOpen(5,TimeUnit.SECONDS);
|
Session session = futureSession.get(5, TimeUnit.SECONDS);
|
||||||
socket.sendText("Hello World");
|
session.getRemote().sendString("Hello World");
|
||||||
|
|
||||||
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"));
|
||||||
|
|
Loading…
Reference in New Issue