From e9376eeb6d72fbd83ed893c9b1ddfa57cb7220f6 Mon Sep 17 00:00:00 2001 From: olivier lamy Date: Fri, 12 May 2017 16:19:41 +1000 Subject: migrate all tests to jetty 9.4 Signed-off-by: olivier lamy --- .../test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'archiva-modules/archiva-base/archiva-proxy') diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java index f0ca4f596..d85d5016e 100644 --- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java +++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java @@ -38,8 +38,10 @@ import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.archiva.repository.ManagedRepositoryContent; import org.assertj.core.api.Assertions; import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.HttpConnectionFactory; 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.junit.After; import org.junit.Before; @@ -164,11 +166,13 @@ public class HttpProxyTransferTest } }; - server = new Server( 0 ); + server = new Server( ); + ServerConnector serverConnector = new ServerConnector( server, new HttpConnectionFactory()); + server.addConnector( serverConnector ); server.setHandler( handler ); server.start(); - int port = server.getConnectors()[0].getLocalPort(); + int port = serverConnector.getLocalPort(); NetworkProxyConfiguration proxyConfig = new NetworkProxyConfiguration(); proxyConfig.setHost( "localhost" ); -- cgit v1.2.3