maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [5/5] maven-wagon git commit: upgrade to jetty 9.2.9.v20150224
Date Tue, 04 Jul 2017 12:12:46 GMT
upgrade to jetty 9.2.9.v20150224

Signed-off-by: olivier lamy <olamy@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/maven-wagon/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-wagon/commit/3856f0fa
Tree: http://git-wip-us.apache.org/repos/asf/maven-wagon/tree/3856f0fa
Diff: http://git-wip-us.apache.org/repos/asf/maven-wagon/diff/3856f0fa

Branch: refs/heads/feature/webdav_upgrade
Commit: 3856f0face1e4aa809c52072eab22fba26fbd17e
Parents: 0835a84
Author: olivier lamy <olamy@apache.org>
Authored: Tue Jul 4 22:12:15 2017 +1000
Committer: olivier lamy <olamy@apache.org>
Committed: Tue Jul 4 22:12:15 2017 +1000

----------------------------------------------------------------------
 pom.xml                                         |   4 +-
 .../maven/wagon/http/HttpWagonTestCase.java     | 165 +++++++++++--------
 .../http/LightweightHttpsWagonTest.java         |  24 +--
 .../http/HttpsWagonPreemptiveTest.java          |  24 +--
 .../wagon/providers/http/HttpsWagonTest.java    |  23 +--
 .../providers/http/HugeFileDownloadTest.java    |  16 +-
 .../ssh/jsch/ScpWagonWithProxyTest.java         |   9 +-
 .../providers/webdav/WebDavsWagonTest.java      |  24 +--
 .../wagon/tck/http/fixture/ServerFixture.java   |  39 ++---
 9 files changed, 183 insertions(+), 145 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 2536df6..2be6a49 100644
--- a/pom.xml
+++ b/pom.xml
@@ -316,12 +316,12 @@ under the License.
       <dependency>
         <groupId>org.eclipse.jetty.aggregate</groupId>
         <artifactId>jetty-all</artifactId>
-        <version>8.1.22.v20160922</version>
+        <version>9.2.9.v20150224</version>
       </dependency>
       <dependency>
         <groupId>javax.servlet</groupId>
         <artifactId>javax.servlet-api</artifactId>
-        <version>3.0.1</version>
+        <version>3.1.0</version>
     </dependency>
     </dependencies>
   </dependencyManagement>

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
----------------------------------------------------------------------
diff --git a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
b/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
index d7587f0..3acf1ee 100644
--- a/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
+++ b/wagon-provider-test/src/main/java/org/apache/maven/wagon/http/HttpWagonTestCase.java
@@ -39,9 +39,13 @@ import org.eclipse.jetty.security.ConstraintSecurityHandler;
 import org.eclipse.jetty.security.HashLoginService;
 import org.eclipse.jetty.security.SecurityHandler;
 import org.eclipse.jetty.security.authentication.BasicAuthenticator;
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
 import org.eclipse.jetty.server.Request;
 import org.eclipse.jetty.server.Response;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.server.handler.AbstractHandler;
 import org.eclipse.jetty.server.handler.HandlerCollection;
 import org.eclipse.jetty.servlet.DefaultServlet;
@@ -81,6 +85,13 @@ public abstract class HttpWagonTestCase
     public static final int SC_TOO_MANY_REQUESTS = 429;
 
     private Server server;
+    private ServerConnector connector;
+
+    protected int getLocalPort( Server server)
+    {
+        Connector connector = server.getConnectors()[0];
+        return ((ServerConnector)connector).getLocalPort();
+    }
 
     protected void setupWagonTestingFixtures()
         throws Exception
@@ -97,7 +108,10 @@ public abstract class HttpWagonTestCase
         FileUtils.deleteDirectory( repositoryDirectory );
         repositoryDirectory.mkdirs();
 
-        server = new Server( 0 );
+        server = new Server( );
+        //connector = new ServerConnector( server, new HttpConnectionFactory( new HttpConfiguration()
) );
+        //server.addConnector( connector );
+        connector = addConnector( server );
 
         PutHandler putHandler = new PutHandler( repositoryDirectory );
 
@@ -107,8 +121,6 @@ public abstract class HttpWagonTestCase
         handlers.addHandler( context );
         server.setHandler( handlers );
 
-        addConnectors( server );
-
         server.start();
 
         testRepository.setUrl( getTestRepositoryUrl() );
@@ -121,7 +133,7 @@ public abstract class HttpWagonTestCase
         {
             return 0;
         }
-        return server.getConnectors()[0].getLocalPort();
+        return connector.getLocalPort();
     }
 
     protected ServletContextHandler createContext( Server server, File repositoryDirectory
)
@@ -162,14 +174,14 @@ public abstract class HttpWagonTestCase
 
         setHttpHeaders( wagon, properties );
 
-        Server server = new Server( 0 );
+        Server server = new Server(  );
         TestHeaderHandler handler = new TestHeaderHandler();
         server.setHandler( handler );
-        addConnectors( server );
+        ServerConnector serverConnector = addConnector( server );
         server.start();
 
         wagon.connect(
-            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort()
) );
+            new Repository( "id", getProtocol() + "://localhost:" + serverConnector.getLocalPort()
) );
 
         wagon.getToStream( "resource", new ByteArrayOutputStream() );
 
@@ -194,14 +206,19 @@ public abstract class HttpWagonTestCase
         Method setHttpHeaders = wagon.getClass().getMethod( "setHttpHeaders", Properties.class
);
         setHttpHeaders.invoke( wagon, properties );
 
-        Server server = new Server( 0 );
+        Server server = new Server( );
+        /*
+        ServerConnector serverConnector = new ServerConnector( server, new HttpConnectionFactory(
new HttpConfiguration() ) );
+        server.addConnector( serverConnector );
+        */
+        ServerConnector serverConnector = addConnector( server );
         TestHeaderHandler handler = new TestHeaderHandler();
         server.setHandler( handler );
-        addConnectors( server );
+        addConnector( server );
         server.start();
 
         wagon.connect(
-            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort()
) );
+            new Repository( "id", getProtocol() + "://localhost:" + serverConnector.getLocalPort()
) );
 
         wagon.getToStream( "resource", new ByteArrayOutputStream() );
 
@@ -216,13 +233,13 @@ public abstract class HttpWagonTestCase
         throws Exception
     {
         StreamingWagon wagon = (StreamingWagon) getWagon();
-        Server server = new Server( 0 );
+        Server server = new Server(  );
         TestHeaderHandler handler = new TestHeaderHandler();
         server.setHandler( handler );
-        addConnectors( server );
+        addConnector( server );
         server.start();
         wagon.connect( new Repository( "id", getProtocol() + "://localhost:"
-          + server.getConnectors()[0].getLocalPort() ) );
+          + getLocalPort( server )));
         wagon.getToStream( "resource", new ByteArrayOutputStream() );
         wagon.disconnect();
         server.stop();
@@ -247,13 +264,13 @@ public abstract class HttpWagonTestCase
         Method setHttpHeaders = wagon.getClass().getMethod( "setHttpHeaders", Properties.class
);
         setHttpHeaders.invoke( wagon, headers2 );
 
-        Server server = new Server( 0 );
+        Server server = new Server(  );
         TestHeaderHandler handler = new TestHeaderHandler();
         server.setHandler( handler );
-        addConnectors( server );
+        addConnector( server );
         server.start();
         wagon.connect( new Repository( "id", getProtocol() + "://localhost:"
-          + server.getConnectors()[0].getLocalPort() ) );
+          + getLocalPort( server ) ));
         wagon.getToStream( "resource", new ByteArrayOutputStream() );
         wagon.disconnect();
         server.stop();
@@ -264,13 +281,16 @@ public abstract class HttpWagonTestCase
 
     protected abstract void setHttpHeaders( StreamingWagon wagon, Properties properties );
 
-    protected void addConnectors( Server server )
+    protected ServerConnector addConnector( Server server )
     {
+        ServerConnector serverConnector = new ServerConnector( server, new HttpConnectionFactory(
new HttpConfiguration() ) );
+        server.addConnector( serverConnector );
+        return serverConnector;
     }
 
     protected String getRepositoryUrl( Server server )
     {
-        int localPort = server.getConnectors()[0].getLocalPort();
+        int localPort = getLocalPort( server );
         return getProtocol() + "://localhost:" + localPort;
     }
 
@@ -309,7 +329,7 @@ public abstract class HttpWagonTestCase
         try
         {
 
-            Server server = new Server( 0 );
+            Server server = new Server(  );
             final AtomicBoolean called = new AtomicBoolean();
 
             AbstractHandler handler = new AbstractHandler()
@@ -333,7 +353,7 @@ public abstract class HttpWagonTestCase
             };
 
             server.setHandler( handler );
-            addConnectors( server );
+            ServerConnector serverConnector = addConnector( server );
             server.start();
 
             wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );
@@ -388,11 +408,11 @@ public abstract class HttpWagonTestCase
     {
         StreamingWagon wagon = (StreamingWagon) getWagon();
 
-        Server server = new Server( 0 );
+        Server server = new Server(  );
         StatusHandler handler = new StatusHandler();
         handler.setStatusToReturn( status );
         server.setHandler( handler );
-        addConnectors( server );
+        addConnector( server );
         server.start();
 
         wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );
@@ -479,9 +499,9 @@ public abstract class HttpWagonTestCase
             };
 
             StreamingWagon wagon = (StreamingWagon) getWagon();
-            Server server = new Server( 0 );
+            Server server = new Server(  );
             server.setHandler( handler );
-            addConnectors( server );
+            addConnector( server );
             server.start();
             wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );
 
@@ -510,11 +530,11 @@ public abstract class HttpWagonTestCase
     {
         StreamingWagon wagon = (StreamingWagon) getWagon();
 
-        Server server = new Server( 0 );
+        Server server = new Server( );
         StatusHandler handler = new StatusHandler();
         handler.setStatusToReturn( status );
         server.setHandler( handler );
-        addConnectors( server );
+        addConnector( server );
         server.start();
 
         wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );
@@ -545,7 +565,7 @@ public abstract class HttpWagonTestCase
     public void testGzipGet()
         throws Exception
     {
-        Server server = new Server( getTestRepositoryPort() );
+        Server server = new Server( );
 
         String localRepositoryPath = FileTestUtils.getTestOutputDir().toString();
         ServletContextHandler root = new ServletContextHandler( ServletContextHandler.SESSIONS
);
@@ -553,7 +573,7 @@ public abstract class HttpWagonTestCase
         ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
         servletHolder.setInitParameter( "gzip", "true" );
         root.addServlet( servletHolder, "/*" );
-        addConnectors( server );
+        addConnector( server );
         server.setHandler( root );
         server.start();
 
@@ -661,16 +681,16 @@ public abstract class HttpWagonTestCase
     {
         StreamingWagon wagon = (StreamingWagon) getWagon();
 
-        Server realServer = new Server( 0 );
+        Server realServer = new Server(  );
         TestHeaderHandler handler = new TestHeaderHandler();
 
         realServer.setHandler( handler );
-        addConnectors( realServer );
+        addConnector( realServer );
         realServer.start();
 
-        Server redirectServer = new Server( 0 );
+        Server redirectServer = new Server(  );
 
-        addConnectors( redirectServer );
+        addConnector( redirectServer );
 
         String protocol = getProtocol();
 
@@ -685,7 +705,7 @@ public abstract class HttpWagonTestCase
             protocol = "https";
         }
 
-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
+        String redirectUrl = protocol + "://localhost:" + getLocalPort( realServer );
 
         RedirectHandler redirectHandler =
             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl,
null );
@@ -725,16 +745,16 @@ public abstract class HttpWagonTestCase
     {
         StreamingWagon wagon = (StreamingWagon) getWagon();
 
-        Server realServer = new Server( 0 );
+        Server realServer = new Server( );
         TestHeaderHandler handler = new TestHeaderHandler();
 
         realServer.setHandler( handler );
-        addConnectors( realServer );
+        addConnector( realServer );
         realServer.start();
 
-        Server redirectServer = new Server( 0 );
+        Server redirectServer = new Server( );
 
-        addConnectors( redirectServer );
+        addConnector( redirectServer );
 
         String protocol = getProtocol();
 
@@ -749,7 +769,7 @@ public abstract class HttpWagonTestCase
             protocol = "https";
         }
 
-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
+        String redirectUrl = protocol + "://localhost:" + getLocalPort( realServer );
 
         RedirectHandler redirectHandler =
             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl,
null );
@@ -786,9 +806,9 @@ public abstract class HttpWagonTestCase
     public void testRedirectPutFromStreamWithFullUrl()
         throws Exception
     {
-        Server realServer = new Server( 0 );
+        Server realServer = new Server( );
 
-        addConnectors( realServer );
+        addConnector( realServer );
 
         File repositoryDirectory = getRepositoryDirectory();
         FileUtils.deleteDirectory( repositoryDirectory );
@@ -800,9 +820,9 @@ public abstract class HttpWagonTestCase
 
         realServer.start();
 
-        Server redirectServer = new Server( 0 );
+        Server redirectServer = new Server( );
 
-        addConnectors( redirectServer );
+        addConnector( redirectServer );
 
         String protocol = getProtocol();
 
@@ -817,7 +837,7 @@ public abstract class HttpWagonTestCase
             protocol = "https";
         }
 
-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
+        String redirectUrl = protocol + "://localhost:" + getLocalPort( realServer );
 
         RedirectHandler redirectHandler =
             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl,
repositoryDirectory );
@@ -872,8 +892,8 @@ public abstract class HttpWagonTestCase
     public void testRedirectPutFromStreamRelativeUrl()
         throws Exception
     {
-        Server realServer = new Server( 0 );
-        addConnectors( realServer );
+        Server realServer = new Server( );
+        addConnector( realServer );
         File repositoryDirectory = getRepositoryDirectory();
         FileUtils.deleteDirectory( repositoryDirectory );
         repositoryDirectory.mkdirs();
@@ -884,9 +904,9 @@ public abstract class HttpWagonTestCase
 
         realServer.start();
 
-        Server redirectServer = new Server( 0 );
+        Server redirectServer = new Server( );
 
-        addConnectors( redirectServer );
+        addConnector( redirectServer );
 
         RedirectHandler redirectHandler =
             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, "/redirectRequest/foo",
@@ -961,9 +981,9 @@ public abstract class HttpWagonTestCase
     public void testRedirectPutFileWithFullUrl()
         throws Exception
     {
-        Server realServer = new Server( 0 );
+        Server realServer = new Server( );
 
-        addConnectors( realServer );
+        addConnector( realServer );
 
         File repositoryDirectory = getRepositoryDirectory();
         FileUtils.deleteDirectory( repositoryDirectory );
@@ -975,9 +995,9 @@ public abstract class HttpWagonTestCase
 
         realServer.start();
 
-        Server redirectServer = new Server( 0 );
+        Server redirectServer = new Server( );
 
-        addConnectors( redirectServer );
+        addConnector( redirectServer );
 
         String protocol = getProtocol();
 
@@ -992,7 +1012,7 @@ public abstract class HttpWagonTestCase
             protocol = "https";
         }
 
-        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
+        String redirectUrl = protocol + "://localhost:" + getLocalPort( realServer );
 
         RedirectHandler redirectHandler =
             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, redirectUrl,
repositoryDirectory );
@@ -1041,8 +1061,8 @@ public abstract class HttpWagonTestCase
     public void testRedirectPutFileRelativeUrl()
         throws Exception
     {
-        Server realServer = new Server( 0 );
-        addConnectors( realServer );
+        Server realServer = new Server( );
+        addConnector( realServer );
         File repositoryDirectory = getRepositoryDirectory();
         FileUtils.deleteDirectory( repositoryDirectory );
         repositoryDirectory.mkdirs();
@@ -1053,9 +1073,9 @@ public abstract class HttpWagonTestCase
 
         realServer.start();
 
-        Server redirectServer = new Server( 0 );
+        Server redirectServer = new Server( );
 
-        addConnectors( redirectServer );
+        addConnector( redirectServer );
 
         RedirectHandler redirectHandler =
             new RedirectHandler( "See Other", HttpServletResponse.SC_SEE_OTHER, "/redirectRequest/foo",
@@ -1162,13 +1182,14 @@ public abstract class HttpWagonTestCase
         Thread.sleep( 5001L );
         // CHECKSTYLE_ON: MagicNumber
 
-        Server proxyServer = new Server( 0 );
-
+        Server proxyServer = new Server( );
+        ServerConnector serverConnector = new ServerConnector( proxyServer, new HttpConnectionFactory(
new HttpConfiguration() ) );
+        proxyServer.addConnector( serverConnector );
         proxyServer.setHandler( handler );
 
         proxyServer.start();
 
-        proxyInfo.setPort( proxyServer.getConnectors()[0].getLocalPort() );
+        proxyInfo.setPort( getLocalPort( proxyServer ) );
 
         System.out.println(
             "start proxy on host/port " + proxyInfo.getHost() + "/" + proxyInfo.getPort()
+ " with non proxyHosts "
@@ -1220,13 +1241,15 @@ public abstract class HttpWagonTestCase
         Thread.sleep( 5001L );
         // CHECKSTYLE_ON: MagicNumber
 
-        Server proxyServer = new Server( 0 );
+        Server proxyServer = new Server( );
+        ServerConnector serverConnector = new ServerConnector( proxyServer, new HttpConnectionFactory(
new HttpConfiguration() ) );
+        proxyServer.addConnector( serverConnector );
 
         proxyServer.setHandler( handler );
 
         proxyServer.start();
 
-        proxyInfoProvider.getProxyInfo( null ).setPort( proxyServer.getConnectors()[0].getLocalPort()
);
+        proxyInfoProvider.getProxyInfo( null ).setPort( getLocalPort( proxyServer ) );
 
         System.out.println( "start proxy on host/port " + proxyInfoProvider.getProxyInfo(
null ).getHost() + "/"
                                 + proxyInfoProvider.getProxyInfo( null ).getPort() + " with
non proxyHosts "
@@ -1509,7 +1532,7 @@ public abstract class HttpWagonTestCase
 
     private Server createSecurityServer( String localRepositoryPath )
     {
-        Server server = new Server( 0 );
+        Server server = new Server( );
 
         SecurityHandler sh = createSecurityHandler();
 
@@ -1521,7 +1544,7 @@ public abstract class HttpWagonTestCase
         root.addServlet( servletHolder, "/*" );
 
         server.setHandler( root );
-        addConnectors( server );
+        addConnector( server );
         return server;
     }
 
@@ -1612,7 +1635,7 @@ public abstract class HttpWagonTestCase
         {
 
             StreamingWagon wagon = (StreamingWagon) getWagon();
-            Server server = new Server( 0 );
+            Server server = new Server( );
             final AtomicBoolean called = new AtomicBoolean();
 
             AbstractHandler handler = new AbstractHandler()
@@ -1635,7 +1658,7 @@ public abstract class HttpWagonTestCase
             };
 
             server.setHandler( handler );
-            addConnectors( server );
+            addConnector( server );
             server.start();
 
             wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );
@@ -1671,11 +1694,11 @@ public abstract class HttpWagonTestCase
     {
         StreamingWagon wagon = (StreamingWagon) getWagon();
 
-        Server server = new Server( 0 );
+        Server server = new Server( );
         StatusHandler handler = new StatusHandler();
         handler.setStatusToReturn( status );
         server.setHandler( handler );
-        addConnectors( server );
+        addConnector( server );
         server.start();
 
         wagon.connect( new Repository( "id", getRepositoryUrl( server ) ) );
@@ -1749,7 +1772,7 @@ public abstract class HttpWagonTestCase
         throws Exception
     {
         String localRepositoryPath = FileTestUtils.getTestOutputDir().toString();
-        Server server = new Server( 0 );
+        Server server = new Server( );
 
         TestSecurityHandler sh = createSecurityHandler();
 
@@ -1757,7 +1780,7 @@ public abstract class HttpWagonTestCase
 
         sh.setHandler( putHandler );
         server.setHandler( sh );
-        addConnectors( server );
+        addConnector( server );
         server.start();
 
         StreamingWagon wagon = (StreamingWagon) getWagon();
@@ -1818,7 +1841,7 @@ public abstract class HttpWagonTestCase
         throws Exception
     {
         String localRepositoryPath = FileTestUtils.getTestOutputDir().toString();
-        Server server = new Server( 0 );
+        Server server = new Server( );
 
         TestSecurityHandler sh = createSecurityHandler();
 
@@ -1833,7 +1856,7 @@ public abstract class HttpWagonTestCase
         {
             server.setHandler( putHandler );
         }
-        addConnectors( server );
+        addConnector( server );
         server.start();
 
         StreamingWagon wagon = (StreamingWagon) getWagon();

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
b/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
index fe30c83..e9ab42d 100644
--- a/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
+++ b/wagon-providers/wagon-http-lightweight/src/test/java/org/apache/maven/wagon/providers/http/LightweightHttpsWagonTest.java
@@ -19,9 +19,9 @@ package org.apache.maven.wagon.providers.http;
  * under the License.
  */
 
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
 
 public class LightweightHttpsWagonTest
     extends LightweightHttpWagonTest
@@ -31,19 +31,21 @@ public class LightweightHttpsWagonTest
         return "https";
     }
 
-    protected void addConnectors( Server server )
+    protected ServerConnector addConnector( Server server )
     {
         System.setProperty( "javax.net.ssl.trustStore",
                             getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath()
);
 
-        SslSocketConnector connector = new SslSocketConnector();
-        connector.setPort( server.getConnectors()[0].getPort() );
-        connector.setKeystore( getTestPath( "src/test/resources/ssl/keystore" ) );
-        connector.setPassword( "wagonhttp" );
-        connector.setKeyPassword( "wagonhttp" );
-        connector.setTruststore( getTestPath( "src/test/resources/ssl/keystore" ) );
-        connector.setTrustPassword( "wagonhttp" );
-        server.setConnectors( new Connector[] { connector } );
+        SslContextFactory sslContextFactory = new SslContextFactory();
+        sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setKeyStorePassword( "wagonhttp" );
+        sslContextFactory.setKeyManagerPassword( "wagonhttp" );
+        sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setTrustStorePassword( "wagonhttp" );
+
+        ServerConnector serverConnector = new ServerConnector( server, sslContextFactory
);
+        server.addConnector( serverConnector );
+        return serverConnector;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
index 25cc61c..c4740a2 100644
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonPreemptiveTest.java
@@ -22,9 +22,9 @@ package org.apache.maven.wagon.providers.http;
 import org.apache.maven.wagon.Wagon;
 import org.apache.maven.wagon.shared.http.HttpConfiguration;
 import org.apache.maven.wagon.shared.http.HttpMethodConfiguration;
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
 
 public class HttpsWagonPreemptiveTest
     extends HttpWagonTest
@@ -34,19 +34,19 @@ public class HttpsWagonPreemptiveTest
         return "https";
     }
 
-    protected void addConnectors( Server server )
+    protected ServerConnector addConnector( Server server )
     {
         System.setProperty( "javax.net.ssl.trustStore",
                             getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath()
);
-
-        SslSocketConnector connector = new SslSocketConnector();
-        connector.setPort( server.getConnectors()[0].getPort() );
-        connector.setKeystore( getTestPath( "src/test/resources/ssl/keystore" ) );
-        connector.setPassword( "wagonhttp" );
-        connector.setKeyPassword( "wagonhttp" );
-        connector.setTruststore( getTestPath( "src/test/resources/ssl/keystore" ) );
-        connector.setTrustPassword( "wagonhttp" );
-        server.setConnectors( new Connector[]{ connector } );
+        SslContextFactory sslContextFactory = new SslContextFactory();
+        sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setKeyStorePassword( "wagonhttp" );
+        sslContextFactory.setKeyManagerPassword( "wagonhttp" );
+        sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setTrustStorePassword( "wagonhttp" );
+        ServerConnector serverConnector = new ServerConnector( server, sslContextFactory
);
+        server.addConnector( serverConnector );
+        return serverConnector;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
index 9612a3a..b34733f 100644
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpsWagonTest.java
@@ -19,9 +19,9 @@ package org.apache.maven.wagon.providers.http;
  * under the License.
  */
 
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
 
 public class HttpsWagonTest
     extends HttpWagonTest
@@ -36,18 +36,19 @@ public class HttpsWagonTest
         return false;
     }
 
-    protected void addConnectors( Server server )
+    protected ServerConnector addConnector( Server server )
     {
         System.setProperty( "javax.net.ssl.trustStore",
                             getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath()
);
 
-        SslSocketConnector connector = new SslSocketConnector();
-        connector.setPort( server.getConnectors()[0].getPort() );
-        connector.getSslContextFactory().setKeyStorePath( "src/test/resources/ssl/keystore"
);
-        connector.getSslContextFactory().setKeyStorePassword( "wagonhttp" );
-        connector.getSslContextFactory().setKeyManagerPassword( "wagonhttp" );
-        connector.getSslContextFactory().setTrustStore( getTestPath( "src/test/resources/ssl/keystore"
) );
-        connector.getSslContextFactory().setTrustStorePassword( "wagonhttp" );
-        server.setConnectors( new Connector[]{ connector } );
+        SslContextFactory sslContextFactory = new SslContextFactory();
+        sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setKeyStorePassword( "wagonhttp" );
+        sslContextFactory.setKeyManagerPassword( "wagonhttp" );
+        sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setTrustStorePassword( "wagonhttp" );
+        ServerConnector serverConnector = new ServerConnector( server, sslContextFactory
);
+        server.addConnector( serverConnector );
+        return serverConnector;
     }
 }

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
index ae9046f..3fb4e0b 100644
--- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HugeFileDownloadTest.java
@@ -25,7 +25,10 @@ import org.apache.maven.wagon.observers.Debug;
 import org.apache.maven.wagon.repository.Repository;
 import org.codehaus.plexus.PlexusTestCase;
 import org.codehaus.plexus.util.IOUtil;
+import org.eclipse.jetty.server.HttpConfiguration;
+import org.eclipse.jetty.server.HttpConnectionFactory;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.slf4j.Logger;
@@ -53,6 +56,7 @@ public class HugeFileDownloadTest
         Integer.valueOf( Integer.MAX_VALUE ).longValue() + Integer.valueOf( Integer.MAX_VALUE
).longValue();
 
     private Server server;
+    private ServerConnector connector;
 
     public void testDownloadHugeFileWithContentLength()
         throws Exception
@@ -63,7 +67,9 @@ public class HugeFileDownloadTest
             makeHugeFile( hugeFile );
         }
 
-        server = new Server( 0 );
+        server = new Server(  );
+        connector = new ServerConnector( server, new HttpConnectionFactory( new HttpConfiguration()
) );
+        server.addConnector( connector );
 
         ServletContextHandler root = new ServletContextHandler( ServletContextHandler.SESSIONS
);
         root.setResourceBase( new File( getBasedir(), "target" ).getAbsolutePath() );
@@ -89,7 +95,7 @@ public class HugeFileDownloadTest
         try
         {
             Wagon wagon = getWagon();
-            wagon.connect( new Repository( "id", "http://localhost:" + server.getConnectors()[0].getLocalPort()
) );
+            wagon.connect( new Repository( "id", "http://localhost:" + connector.getLocalPort()
) );
 
             dest = File.createTempFile( "huge", "txt" );
 
@@ -119,7 +125,9 @@ public class HugeFileDownloadTest
             makeHugeFile( hugeFile );
         }
 
-        server = new Server( 0 );
+        server = new Server(  );
+        connector = new ServerConnector( server, new HttpConnectionFactory( new HttpConfiguration()
) );
+        server.addConnector( connector );
 
         ServletContextHandler root = new ServletContextHandler( ServletContextHandler.SESSIONS
);
         root.setResourceBase( new File( getBasedir(), "target" ).getAbsolutePath() );
@@ -144,7 +152,7 @@ public class HugeFileDownloadTest
         try
         {
             Wagon wagon = getWagon();
-            wagon.connect( new Repository( "id", "http://localhost:" + server.getConnectors()[0].getLocalPort()
) );
+            wagon.connect( new Repository( "id", "http://localhost:" + connector.getLocalPort()
) );
 
             dest = File.createTempFile( "huge", "txt" );
 

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithProxyTest.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithProxyTest.java
b/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithProxyTest.java
index f21a6f5..2d3fbd6 100644
--- a/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithProxyTest.java
+++ b/wagon-providers/wagon-ssh/src/test/java/org/apache/maven/wagon/providers/ssh/jsch/ScpWagonWithProxyTest.java
@@ -35,8 +35,11 @@ import org.apache.maven.wagon.proxy.ProxyInfo;
 import org.apache.maven.wagon.repository.Repository;
 import org.codehaus.plexus.PlexusTestCase;
 import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.HttpConfiguration;
+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;
 
 public class ScpWagonWithProxyTest
@@ -60,11 +63,13 @@ public class ScpWagonWithProxyTest
             }
         };
 
-        Server server = new Server( 0 );
+        Server server = new Server(  );
+        ServerConnector connector = new ServerConnector( server, new HttpConnectionFactory(
new HttpConfiguration() ) );
+        server.addConnector( connector );
         server.setHandler( handler );
         server.start();
 
-        int port = server.getConnectors()[0].getLocalPort();
+        int port = connector.getLocalPort();
         ProxyInfo proxyInfo = new ProxyInfo();
         proxyInfo.setHost( "localhost" );
         proxyInfo.setPort( port );

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-providers/wagon-webdav-jackrabbit/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavsWagonTest.java
----------------------------------------------------------------------
diff --git a/wagon-providers/wagon-webdav-jackrabbit/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavsWagonTest.java
b/wagon-providers/wagon-webdav-jackrabbit/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavsWagonTest.java
index f959a47..9e5a997 100644
--- a/wagon-providers/wagon-webdav-jackrabbit/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavsWagonTest.java
+++ b/wagon-providers/wagon-webdav-jackrabbit/src/test/java/org/apache/maven/wagon/providers/webdav/WebDavsWagonTest.java
@@ -1,8 +1,8 @@
 package org.apache.maven.wagon.providers.webdav;
 
-import org.eclipse.jetty.server.Connector;
 import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
+import org.eclipse.jetty.server.ServerConnector;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -38,19 +38,21 @@ public class WebDavsWagonTest
         return "davs";
     }
 
-    protected void addConnectors( Server server )
+    protected ServerConnector addConnector( Server server )
     {
         System.setProperty( "javax.net.ssl.trustStore",
                             getTestFile( "src/test/resources/ssl/keystore" ).getAbsolutePath()
);
 
-        SslSocketConnector connector = new SslSocketConnector();
-        connector.setPort( server.getConnectors()[0].getPort() );
-        connector.getSslContextFactory().setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
-        connector.getSslContextFactory().setKeyStorePassword( "wagonhttp" );
-        connector.getSslContextFactory().setKeyManagerPassword( "wagonhttp" );
-        connector.getSslContextFactory().setTrustStore( getTestPath( "src/test/resources/ssl/keystore"
) );
-        connector.getSslContextFactory().setTrustStorePassword( "wagonhttp" );
-        server.setConnectors( new Connector[] { connector } );
+        SslContextFactory sslContextFactory = new SslContextFactory();
+        sslContextFactory.setKeyStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setKeyStorePassword( "wagonhttp" );
+        sslContextFactory.setKeyManagerPassword( "wagonhttp" );
+        sslContextFactory.setTrustStorePath( getTestPath( "src/test/resources/ssl/keystore"
) );
+        sslContextFactory.setTrustStorePassword( "wagonhttp" );
+
+        ServerConnector serverConnector = new ServerConnector( server, sslContextFactory
);
+        server.addConnector( serverConnector );
+        return serverConnector;
     }
 
 }

http://git-wip-us.apache.org/repos/asf/maven-wagon/blob/3856f0fa/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
----------------------------------------------------------------------
diff --git a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
index 063f47b..e8ca1ed 100644
--- a/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
+++ b/wagon-tcks/wagon-tck-http/src/main/java/org/apache/maven/wagon/tck/http/fixture/ServerFixture.java
@@ -19,24 +19,25 @@ package org.apache.maven.wagon.tck.http.fixture;
  * under the License.
  */
 
-import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.security.ConstraintMapping;
+import org.eclipse.jetty.security.ConstraintSecurityHandler;
+import org.eclipse.jetty.security.HashLoginService;
 import org.eclipse.jetty.server.Handler;
 import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
 import org.eclipse.jetty.server.handler.DefaultHandler;
 import org.eclipse.jetty.server.handler.HandlerCollection;
-import org.eclipse.jetty.server.nio.SelectChannelConnector;
 import org.eclipse.jetty.server.session.AbstractSessionManager;
 import org.eclipse.jetty.server.session.SessionHandler;
-import org.eclipse.jetty.security.ConstraintMapping;
-import org.eclipse.jetty.security.ConstraintSecurityHandler;
-import org.eclipse.jetty.security.HashLoginService;
-import org.eclipse.jetty.server.ssl.SslSocketConnector;
 import org.eclipse.jetty.servlet.FilterHolder;
 import org.eclipse.jetty.servlet.FilterMapping;
 import org.eclipse.jetty.servlet.ServletHolder;
 import org.eclipse.jetty.util.security.Constraint;
 import org.eclipse.jetty.util.security.Password;
+import org.eclipse.jetty.util.ssl.SslContextFactory;
 import org.eclipse.jetty.webapp.WebAppContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.servlet.Filter;
 import javax.servlet.Servlet;
@@ -46,9 +47,6 @@ import java.net.URISyntaxException;
 
 import static org.apache.maven.wagon.tck.http.util.TestUtil.getResource;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 /**
  *
  */
@@ -67,6 +65,7 @@ public class ServerFixture
     public static final String SERVER_HOST = "localhost";
 
     private final Server server;
+    private ServerConnector serverConnector;
 
     private final WebAppContext webappContext;
 
@@ -84,27 +83,25 @@ public class ServerFixture
         server = new Server();
         if ( ssl )
         {
-            SslSocketConnector connector = new SslSocketConnector();
             String keystore = getResource( SERVER_SSL_KEYSTORE_RESOURCE_PATH ).getAbsolutePath();
 
             LoggerFactory.getLogger( ServerFixture.class ).info( "TCK Keystore path: " +
keystore );
             System.setProperty( "javax.net.ssl.keyStore", keystore );
             System.setProperty( "javax.net.ssl.trustStore", keystore );
 
-            // connector.setHost( SERVER_HOST );
-            //connector.setPort( port );
-            connector.setKeystore( keystore );
-            connector.setPassword( SERVER_SSL_KEYSTORE_PASSWORD );
-            connector.setKeyPassword( SERVER_SSL_KEYSTORE_PASSWORD );
-
-            server.addConnector( connector );
+            SslContextFactory sslContextFactory = new SslContextFactory();
+            sslContextFactory.setKeyStorePath( keystore );
+            sslContextFactory.setKeyStorePassword( SERVER_SSL_KEYSTORE_PASSWORD );
+            sslContextFactory.setKeyManagerPassword( SERVER_SSL_KEYSTORE_PASSWORD );
+            serverConnector = new ServerConnector( server, sslContextFactory );
+            server.addConnector( serverConnector );
         }
         else
         {
-            Connector connector = new SelectChannelConnector();
-            connector.setHost( "localhost" );
+            serverConnector = new ServerConnector( server );
+            serverConnector.setHost( "localhost" );
             //connector.setPort( port );
-            server.addConnector( connector );
+            server.addConnector( serverConnector );
         }
 
         Constraint constraint = new Constraint();
@@ -204,7 +201,7 @@ public class ServerFixture
         {
             throw new IllegalStateException( "Server didn't start in: " + total + "ms." );
         }
-        this.httpPort = server.getConnectors()[0].getLocalPort();
+        this.httpPort = serverConnector.getLocalPort();
     }
 
     public int getHttpPort()


Mime
View raw message