From 4f20447a5a9a1a7ced92183f53c88dd1a75fab9f Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Tue, 29 May 2018 14:58:05 +0200 Subject: [PATCH] Fixed #2585 Signed-off-by: Greg Wilkins --- .../eclipse/jetty/http/client/HttpClientStreamTest.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientStreamTest.java b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientStreamTest.java index e3589ecf482..30f6dc551b2 100644 --- a/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientStreamTest.java +++ b/tests/test-http-client-transport/src/test/java/org/eclipse/jetty/http/client/HttpClientStreamTest.java @@ -43,7 +43,6 @@ import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import javax.servlet.AsyncContext; -import javax.servlet.DispatcherType; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; @@ -60,7 +59,6 @@ import org.eclipse.jetty.client.util.InputStreamResponseListener; import org.eclipse.jetty.client.util.OutputStreamContentProvider; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.server.Request; -import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.AbstractHandler; import org.eclipse.jetty.toolchain.test.MavenTestingUtils; @@ -459,13 +457,12 @@ public class HttpClientStreamTest extends AbstractTest public void testInputStreamResponseListenerFailedBeforeResponse() throws Exception { start(new EmptyServerHandler()); - //int port = connector.getLocalPort(); + int port = connector instanceof ServerConnector?ServerConnector.class.cast( connector ).getLocalPort():1; server.stop(); - + InputStreamResponseListener listener = new InputStreamResponseListener(); // Connect to the wrong port - client.newRequest("localhost", - (connector instanceof ServerConnector?ServerConnector.class.cast( connector ).getLocalPort():1)) + client.newRequest("localhost",port) .scheme(getScheme()) .send(listener); Result result = listener.await(5, TimeUnit.SECONDS);