Merged branch 'jetty-9.4.x' into 'jetty-10.0.x'.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
commit
38aec0b081
|
@ -57,8 +57,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
public class WebSocketProxyTest
|
public class WebSocketProxyTest
|
||||||
{
|
{
|
||||||
private static final int PORT = 49998;
|
|
||||||
|
|
||||||
private Server server;
|
private Server server;
|
||||||
private EventSocket serverSocket;
|
private EventSocket serverSocket;
|
||||||
private WebSocketProxy webSocketProxy;
|
private WebSocketProxy webSocketProxy;
|
||||||
|
@ -70,15 +68,8 @@ public class WebSocketProxyTest
|
||||||
{
|
{
|
||||||
server = new Server();
|
server = new Server();
|
||||||
ServerConnector connector = new ServerConnector(server);
|
ServerConnector connector = new ServerConnector(server);
|
||||||
connector.setPort(PORT);
|
|
||||||
server.addConnector(connector);
|
server.addConnector(connector);
|
||||||
|
|
||||||
client = new WebSocketClient();
|
|
||||||
client.start();
|
|
||||||
proxyUri = URI.create("ws://localhost:" + PORT + "/proxy");
|
|
||||||
URI echoUri = URI.create("ws://localhost:" + PORT + "/echo");
|
|
||||||
webSocketProxy = new WebSocketProxy(client, echoUri);
|
|
||||||
|
|
||||||
ServletContextHandler contextHandler = new ServletContextHandler();
|
ServletContextHandler contextHandler = new ServletContextHandler();
|
||||||
serverSocket = new EchoSocket();
|
serverSocket = new EchoSocket();
|
||||||
JettyWebSocketServletContainerInitializer.configure(contextHandler, ((context, container) ->
|
JettyWebSocketServletContainerInitializer.configure(contextHandler, ((context, container) ->
|
||||||
|
@ -94,6 +85,14 @@ public class WebSocketProxyTest
|
||||||
|
|
||||||
server.setHandler(contextHandler);
|
server.setHandler(contextHandler);
|
||||||
server.start();
|
server.start();
|
||||||
|
|
||||||
|
int port = connector.getLocalPort();
|
||||||
|
|
||||||
|
client = new WebSocketClient();
|
||||||
|
client.start();
|
||||||
|
proxyUri = URI.create("ws://localhost:" + port + "/proxy");
|
||||||
|
URI echoUri = URI.create("ws://localhost:" + port + "/echo");
|
||||||
|
webSocketProxy = new WebSocketProxy(client, echoUri);
|
||||||
}
|
}
|
||||||
|
|
||||||
@AfterEach
|
@AfterEach
|
||||||
|
|
Loading…
Reference in New Issue