[wagon2] 16/18: remove jetty-compatibility.patch in favor of updated patch

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jun 19 13:54:54 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to branch master
in repository wagon2.

commit 12ff7d0afbbe1fc9aafb2c640af6e4933ddc01fa
Author: tony mancill <tmancill at debian.org>
Date:   Sun May 7 10:07:16 2017 -0700

    remove jetty-compatibility.patch in favor of updated patch
---
 debian/patches/jetty-compatibility.patch | 743 -------------------------------
 1 file changed, 743 deletions(-)

diff --git a/debian/patches/jetty-compatibility.patch b/debian/patches/jetty-compatibility.patch
deleted file mode 100644
index cdf408b..0000000
--- a/debian/patches/jetty-compatibility.patch
+++ /dev/null
@@ -1,743 +0,0 @@
-Description: Upgrade to Jetty 9
-Author: Emmanuel Bourg <ebourg at apache.org>
-Forwarded: no
---- 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
-@@ -34,20 +34,23 @@
- import org.codehaus.plexus.util.FileUtils;
- import org.codehaus.plexus.util.IOUtil;
- import org.codehaus.plexus.util.StringUtils;
--import org.mortbay.jetty.Handler;
--import org.mortbay.jetty.HttpConnection;
--import org.mortbay.jetty.Request;
--import org.mortbay.jetty.Response;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.handler.AbstractHandler;
--import org.mortbay.jetty.handler.HandlerCollection;
--import org.mortbay.jetty.security.Constraint;
--import org.mortbay.jetty.security.ConstraintMapping;
--import org.mortbay.jetty.security.HashUserRealm;
--import org.mortbay.jetty.security.SecurityHandler;
--import org.mortbay.jetty.servlet.Context;
--import org.mortbay.jetty.servlet.DefaultServlet;
--import org.mortbay.jetty.servlet.ServletHolder;
-+import org.eclipse.jetty.server.Handler;
-+import org.eclipse.jetty.server.NetworkConnector;
-+import org.eclipse.jetty.server.Request;
-+import org.eclipse.jetty.server.Response;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.UserIdentity;
-+import org.eclipse.jetty.server.handler.AbstractHandler;
-+import org.eclipse.jetty.server.handler.HandlerCollection;
-+import org.eclipse.jetty.util.security.Constraint;
-+import org.eclipse.jetty.util.security.Password;
-+import org.eclipse.jetty.security.ConstraintMapping;
-+import org.eclipse.jetty.security.HashLoginService;
-+import org.eclipse.jetty.security.SecurityHandler;
-+import org.eclipse.jetty.security.ConstraintSecurityHandler;
-+import org.eclipse.jetty.servlet.ServletContextHandler;
-+import org.eclipse.jetty.servlet.DefaultServlet;
-+import org.eclipse.jetty.servlet.ServletHolder;
- 
- import javax.servlet.ServletException;
- import javax.servlet.ServletInputStream;
-@@ -99,7 +102,7 @@
-         server = new Server( 0 );
- 
-         PutHandler putHandler = new PutHandler( repositoryDirectory );
--        server.addHandler( putHandler );
-+        server.setHandler( putHandler );
- 
-         createContext( server, repositoryDirectory );
- 
-@@ -117,13 +120,13 @@
-         {
-             return 0;
-         }
--        return server.getConnectors()[0].getLocalPort();
-+        return ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
-     }
- 
-     protected void createContext( Server server, File repositoryDirectory )
-         throws IOException
-     {
--        Context root = new Context( server, "/", Context.SESSIONS );
-+        ServletContextHandler root = new ServletContextHandler( server, "/", ServletContextHandler.SESSIONS );
-         root.setResourceBase( repositoryDirectory.getAbsolutePath() );
-         ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
-         root.addServlet( servletHolder, "/*" );
-@@ -164,7 +167,7 @@
-         server.start();
- 
-         wagon.connect(
--            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort() ) );
-+            new Repository( "id", getProtocol() + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
- 
-         wagon.getToStream( "resource", new ByteArrayOutputStream() );
- 
-@@ -196,7 +199,7 @@
-         server.start();
- 
-         wagon.connect(
--            new Repository( "id", getProtocol() + "://localhost:" + server.getConnectors()[0].getLocalPort() ) );
-+            new Repository( "id", getProtocol() + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
- 
-         wagon.getToStream( "resource", new ByteArrayOutputStream() );
- 
-@@ -217,7 +220,7 @@
-         addConnectors( server );
-         server.start();
-         wagon.connect( new Repository( "id", getProtocol() + "://localhost:" 
--          + server.getConnectors()[0].getLocalPort() ) );
-+          + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
-         wagon.getToStream( "resource", new ByteArrayOutputStream() );
-         wagon.disconnect();
-         server.stop();
-@@ -248,7 +251,7 @@
-         addConnectors( server );
-         server.start();
-         wagon.connect( new Repository( "id", getProtocol() + "://localhost:"
--          + server.getConnectors()[0].getLocalPort() ) );
-+          + ((NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
-         wagon.getToStream( "resource", new ByteArrayOutputStream() );
-         wagon.disconnect();
-         server.stop();
-@@ -265,7 +268,7 @@
- 
-     protected String getRepositoryUrl( Server server )
-     {
--        int localPort = server.getConnectors()[0].getLocalPort();
-+        int localPort = ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
-         return getProtocol() + "://localhost:" + localPort;
-     }
- 
-@@ -309,7 +312,7 @@
- 
-             AbstractHandler handler = new AbstractHandler()
-             {
--                public void handle( String s, HttpServletRequest request, HttpServletResponse response, int i )
-+                public void handle( String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-                     throws IOException, ServletException
-                 {
-                     if ( called.get() )
-@@ -456,7 +459,7 @@
- 
-             AbstractHandler handler = new AbstractHandler()
-             {
--                public void handle( String s, HttpServletRequest request, HttpServletResponse response, int i )
-+                public void handle( String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-                     throws IOException, ServletException
-                 {
-                     if ( called.get() )
-@@ -543,7 +546,7 @@
-         Server server = new Server( getTestRepositoryPort() );
- 
-         String localRepositoryPath = FileTestUtils.getTestOutputDir().toString();
--        Context root = new Context( server, "/", Context.SESSIONS );
-+        ServletContextHandler root = new ServletContextHandler( server, "/", ServletContextHandler.SESSIONS );
-         root.setResourceBase( localRepositoryPath );
-         ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
-         servletHolder.setInitParameter( "gzip", "true" );
-@@ -679,7 +682,7 @@
-             protocol = "https";
-         }
- 
--        String redirectUrl = protocol + "://localhost:" + server.getConnectors()[0].getLocalPort();
-+        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
- 
-         RedirectHandler redirectHandler =
-             new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, null );
-@@ -744,7 +747,7 @@
-             protocol = "https";
-         }
- 
--        String redirectUrl = protocol + "://localhost:" + server.getConnectors()[0].getLocalPort();
-+        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) server.getConnectors()[0]).getLocalPort();
- 
-         RedirectHandler redirectHandler =
-             new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, null );
-@@ -811,7 +814,7 @@
-             protocol = "https";
-         }
- 
--        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
-+        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
- 
-         RedirectHandler redirectHandler =
-             new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, repositoryDirectory );
-@@ -991,7 +994,7 @@
-             protocol = "https";
-         }
- 
--        String redirectUrl = protocol + "://localhost:" + realServer.getConnectors()[0].getLocalPort();
-+        String redirectUrl = protocol + "://localhost:" + ((NetworkConnector) realServer.getConnectors()[0]).getLocalPort();
- 
-         RedirectHandler redirectHandler =
-             new RedirectHandler( "Found", HttpServletResponse.SC_SEE_OTHER, redirectUrl, repositoryDirectory );
-@@ -1122,13 +1125,13 @@
-             this.repositoryDirectory = repositoryDirectory;
-         }
- 
--        public void handle( String s, HttpServletRequest req, HttpServletResponse resp, int i )
-+        public void handle( String s, Request baseRequest, HttpServletRequest req, HttpServletResponse resp )
-             throws IOException, ServletException
-         {
-             if ( req.getRequestURI().contains( "redirectRequest" ) )
-             {
-                 PutHandler putHandler = new PutHandler( this.repositoryDirectory );
--                putHandler.handle( s, req, resp, i );
-+                putHandler.handle( s, baseRequest, req, resp );
-                 handlerRequestResponses.add(
-                     new HandlerRequestResponse( req.getMethod(), ( (Response) resp ).getStatus(),
-                                                 req.getRequestURI() ) );
-@@ -1158,7 +1161,7 @@
- 
-         proxyServer.start();
- 
--        proxyInfo.setPort( proxyServer.getConnectors()[0].getLocalPort() );
-+        proxyInfo.setPort( ((NetworkConnector) proxyServer.getConnectors()[0]).getLocalPort() );
- 
-         System.out.println(
-             "start proxy on host/port " + proxyInfo.getHost() + "/" + proxyInfo.getPort() + " with non proxyHosts "
-@@ -1216,7 +1219,7 @@
- 
-         proxyServer.start();
- 
--        proxyInfoProvider.getProxyInfo( null ).setPort( proxyServer.getConnectors()[0].getLocalPort() );
-+        proxyInfoProvider.getProxyInfo( null ).setPort( ((NetworkConnector) proxyServer.getConnectors()[0]).getLocalPort() );
- 
-         System.out.println( "start proxy on host/port " + proxyInfoProvider.getProxyInfo( null ).getHost() + "/"
-                                 + proxyInfoProvider.getProxyInfo( null ).getPort() + " with non proxyHosts "
-@@ -1342,7 +1345,7 @@
- 
-             assertEquals( "top secret", IOUtil.toString( in ) );
- 
--            TestSecurityHandler securityHandler = (TestSecurityHandler) ( (Context) server.getHandler() ).getHandler();
-+            TestSecurityHandler securityHandler = (TestSecurityHandler) ( (ServletContextHandler) server.getHandler() ).getHandler();
-             testPreemptiveAuthenticationGet( securityHandler, supportPreemptiveAuthenticationGet() );
- 
-         }
-@@ -1393,7 +1396,7 @@
- 
-             assertEquals( "top secret", out.toString( "US-ASCII" ) );
- 
--            TestSecurityHandler securityHandler = (TestSecurityHandler) ( (Context) server.getHandler() ).getHandler();
-+            TestSecurityHandler securityHandler = (TestSecurityHandler) ( (ServletContextHandler) server.getHandler() ).getHandler();
-             testPreemptiveAuthenticationGet( securityHandler, supportPreemptiveAuthenticationGet() );
-         }
-         finally
-@@ -1483,9 +1486,9 @@
- 
-         SecurityHandler sh = createSecurityHandler();
- 
--        Context root = new Context( Context.SESSIONS );
-+        ServletContextHandler root = new ServletContextHandler( ServletContextHandler.SESSIONS );
-         root.setContextPath( "/" );
--        root.addHandler( sh );
-+        root.setHandler( sh );
-         root.setResourceBase( localRepositoryPath );
-         ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
-         root.addServlet( servletHolder, "/*" );
-@@ -1587,7 +1590,7 @@
- 
-             AbstractHandler handler = new AbstractHandler()
-             {
--                public void handle( String s, HttpServletRequest request, HttpServletResponse response, int i )
-+                public void handle( String s, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-                     throws IOException, ServletException
-                 {
-                     if ( called.get() )
-@@ -1908,7 +1911,7 @@
-             this.status = status;
-         }
- 
--        public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
-+        public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-             throws IOException, ServletException
-         {
-             if ( status != 0 )
-@@ -1968,12 +1971,9 @@
-             this.resourceBase = repositoryDirectory;
-         }
- 
--        public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
-+        public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-             throws IOException, ServletException
-         {
--            Request baseRequest =
--                request instanceof Request ? (Request) request : HttpConnection.getCurrentConnection().getRequest();
--
-             if ( baseRequest.isHandled() || !"PUT".equals( baseRequest.getMethod() ) )
-             {
-                 return;
-@@ -2017,7 +2017,7 @@
- 
-         List<HandlerRequestResponse> handlerRequestResponses = new ArrayList<HandlerRequestResponse>();
- 
--        public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
-+        public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-             throws IOException, ServletException
-         {
-             System.out.println( " handle proxy request" );
-@@ -2035,7 +2035,7 @@
-             }
-             handlerRequestResponses.add(
-                 new HandlerRequestResponse( request.getMethod(), HttpServletResponse.SC_OK, request.getRequestURI() ) );
--            super.handle( target, request, response, dispatch );
-+            super.handle( target, baseRequest, request, response );
-         }
-     }
- 
-@@ -2054,7 +2054,7 @@
-         {
-         }
- 
--        public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
-+        public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-             throws IOException, ServletException
-         {
-             headers = new HashMap<String, String>();
-@@ -2102,10 +2102,9 @@
-         cm.setPathSpec( "/*" );
- 
-         TestSecurityHandler sh = new TestSecurityHandler();
--        HashUserRealm hashUserRealm = new HashUserRealm( "MyRealm" );
--        hashUserRealm.put( "user", "secret" );
--        hashUserRealm.addUserToRole( "user", "admin" );
--        sh.setUserRealm( hashUserRealm );
-+        HashLoginService hashLoginService = new HashLoginService( "MyRealm" );
-+        hashLoginService.putUser( "user", new Password( "secret" ),  new String[]{ "admin" } );
-+        sh.setLoginService( hashLoginService );
-         sh.setConstraintMappings( new ConstraintMapping[]{ cm } );
-         return sh;
-     }
-@@ -2115,17 +2114,17 @@
-      */
-     @SuppressWarnings( "checkstyle:visibilitymodifier" )
-     public static class TestSecurityHandler
--        extends SecurityHandler
-+        extends ConstraintSecurityHandler
-     {
- 
-         public List<HandlerRequestResponse> handlerRequestResponses = new ArrayList<HandlerRequestResponse>();
- 
-         @Override
--        public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
-+        public void handle( String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response )
-             throws IOException, ServletException
-         {
-             String method = request.getMethod();
--            super.handle( target, request, response, dispatch );
-+            super.handle( target, baseRequest, request, response );
- 
-             handlerRequestResponses.add(
-                 new HandlerRequestResponse( method, ( (Response) response ).getStatus(), request.getRequestURI() ) );
---- 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
-@@ -20,23 +20,27 @@
-  */
- 
- import org.apache.log4j.Logger;
--import org.mortbay.jetty.Connector;
--import org.mortbay.jetty.Handler;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.handler.DefaultHandler;
--import org.mortbay.jetty.handler.HandlerCollection;
--import org.mortbay.jetty.nio.SelectChannelConnector;
--import org.mortbay.jetty.security.Constraint;
--import org.mortbay.jetty.security.ConstraintMapping;
--import org.mortbay.jetty.security.HashUserRealm;
--import org.mortbay.jetty.security.SecurityHandler;
--import org.mortbay.jetty.security.SslSocketConnector;
--import org.mortbay.jetty.servlet.AbstractSessionManager;
--import org.mortbay.jetty.servlet.FilterHolder;
--import org.mortbay.jetty.servlet.FilterMapping;
--import org.mortbay.jetty.servlet.ServletHolder;
--import org.mortbay.jetty.servlet.SessionHandler;
--import org.mortbay.jetty.webapp.WebAppContext;
-+import org.eclipse.jetty.server.Connector;
-+import org.eclipse.jetty.server.Handler;
-+import org.eclipse.jetty.server.HttpConfiguration;
-+import org.eclipse.jetty.server.HttpConnectionFactory;
-+import org.eclipse.jetty.server.SecureRequestCustomizer;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.handler.DefaultHandler;
-+import org.eclipse.jetty.server.handler.HandlerCollection;
-+import org.eclipse.jetty.server.ServerConnector;
-+import org.eclipse.jetty.server.SslConnectionFactory;
-+import org.eclipse.jetty.util.security.Constraint;
-+import org.eclipse.jetty.util.ssl.SslContextFactory;
-+import org.eclipse.jetty.security.ConstraintMapping;
-+import org.eclipse.jetty.security.HashLoginService;
-+import org.eclipse.jetty.security.ConstraintSecurityHandler;
-+import org.eclipse.jetty.server.session.AbstractSessionManager;
-+import org.eclipse.jetty.servlet.FilterHolder;
-+import org.eclipse.jetty.servlet.FilterMapping;
-+import org.eclipse.jetty.servlet.ServletHolder;
-+import org.eclipse.jetty.server.session.SessionHandler;
-+import org.eclipse.jetty.webapp.WebAppContext;
- 
- import javax.servlet.Filter;
- import javax.servlet.Servlet;
-@@ -67,9 +71,9 @@
- 
-     private final WebAppContext webappContext;
- 
--    private final HashUserRealm securityRealm;
-+    private final HashLoginService securityRealm;
- 
--    private final SecurityHandler securityHandler;
-+    private final ConstraintSecurityHandler securityHandler;
- 
-     private int filterCount = 0;
- 
-@@ -81,24 +85,34 @@
-         server = new Server();
-         if ( ssl )
-         {
--            SslSocketConnector connector = new SslSocketConnector();
-             String keystore = getResource( SERVER_SSL_KEYSTORE_RESOURCE_PATH ).getAbsolutePath();
- 
-             Logger.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 );
-+            SslContextFactory sslContextFactory = new SslContextFactory();
-+            sslContextFactory.setKeyStorePath( keystore );
-+            sslContextFactory.setKeyStorePassword( SERVER_SSL_KEYSTORE_PASSWORD );
-+            sslContextFactory.setKeyManagerPassword( SERVER_SSL_KEYSTORE_PASSWORD );
-+
-+            HttpConfiguration http_config = new HttpConfiguration();
-+            http_config.setSecureScheme( "https" );
-+            http_config.setSecurePort( 443 );
-+
-+            HttpConfiguration https_config = new HttpConfiguration( http_config );
-+            https_config.addCustomizer( new SecureRequestCustomizer() );
-+
-+            ServerConnector connector = new ServerConnector(server,
-+                new SslConnectionFactory( sslContextFactory, "http/1.1" ),
-+                new HttpConnectionFactory( https_config ));
-+            connector.setPort( 443 );
- 
-             server.addConnector( connector );
-         }
-         else
-         {
--            Connector connector = new SelectChannelConnector();
-+            ServerConnector connector = new ServerConnector( server );
-             connector.setHost( "localhost" );
-             //connector.setPort( port );
-             server.addConnector( connector );
-@@ -114,11 +128,11 @@
-         cm.setConstraint( constraint );
-         cm.setPathSpec( "/protected/*" );
- 
--        securityHandler = new SecurityHandler();
-+        securityHandler = new ConstraintSecurityHandler();
- 
--        securityRealm = new HashUserRealm( "Test Server" );
-+        securityRealm = new HashLoginService( "Test Server" );
- 
--        securityHandler.setUserRealm( securityRealm );
-+        securityHandler.setLoginService( securityRealm );
-         securityHandler.setConstraintMappings( new ConstraintMapping[]{ cm } );
- 
-         webappContext = new WebAppContext();
-@@ -127,7 +141,7 @@
-         File base = getResource( SERVER_ROOT_RESOURCE_PATH );
-         logger.info( "docroot: " + base );
-         webappContext.setWar( base.getAbsolutePath() );
--        webappContext.addHandler( securityHandler );
-+        webappContext.setHandler( securityHandler );
- 
-         SessionHandler sessionHandler = webappContext.getSessionHandler();
-         ( (AbstractSessionManager) sessionHandler.getSessionManager() ).setUsingCookies( false );
-@@ -159,8 +173,7 @@
- 
-     public void addUser( final String user, final String password )
-     {
--        securityRealm.put( user, password );
--        securityRealm.addUserToRole( user, "allowed" );
-+        securityRealm.putUser( user, new org.eclipse.jetty.util.security.Password( password ), new String[]{ "allowed" } );
-     }
- 
-     public Server getServer()
-@@ -202,7 +215,7 @@
-         {
-             throw new IllegalStateException( "Server didn't start in: " + total + "ms." );
-         }
--        this.httpPort = server.getConnectors()[0].getLocalPort();
-+        this.httpPort = ((org.eclipse.jetty.server.NetworkConnector) server.getConnectors()[0]).getLocalPort();
-     }
- 
-     public int getHttpPort()
---- 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
-@@ -24,10 +24,10 @@
- import org.apache.maven.wagon.observers.Debug;
- import org.apache.maven.wagon.repository.Repository;
- import org.codehaus.plexus.PlexusTestCase;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.servlet.Context;
--import org.mortbay.jetty.servlet.DefaultServlet;
--import org.mortbay.jetty.servlet.ServletHolder;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.servlet.ServletContextHandler;
-+import org.eclipse.jetty.servlet.DefaultServlet;
-+import org.eclipse.jetty.servlet.ServletHolder;
- 
- import javax.servlet.ServletException;
- import javax.servlet.http.HttpServlet;
-@@ -61,7 +61,7 @@
- 
-         server = new Server( 0 );
- 
--        Context root = new Context( server, "/", Context.SESSIONS );
-+        ServletContextHandler root = new ServletContextHandler( server, "/", ServletContextHandler.SESSIONS );
-         root.setResourceBase( new File( getBasedir(), "target" ).getAbsolutePath() );
-         ServletHolder servletHolder = new ServletHolder( new DefaultServlet() );
-         root.addServlet( servletHolder, "/*" );
-@@ -72,7 +72,7 @@
-         try
-         {
-             Wagon wagon = getWagon();
--            wagon.connect( new Repository( "id", "http://localhost:" + server.getConnectors()[0].getLocalPort() ) );
-+            wagon.connect( new Repository( "id", "http://localhost:" + ((org.eclipse.jetty.server.NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
- 
-             dest = File.createTempFile( "huge", "txt" );
- 
-@@ -103,7 +103,7 @@
- 
-         server = new Server( 0 );
- 
--        Context root = new Context( server, "/", Context.SESSIONS );
-+        ServletContextHandler root = new ServletContextHandler( server, "/", ServletContextHandler.SESSIONS );
-         root.setResourceBase( new File( getBasedir(), "target" ).getAbsolutePath() );
-         ServletHolder servletHolder = new ServletHolder( new HttpServlet()
-         {
-@@ -130,7 +130,7 @@
-         try
-         {
-             Wagon wagon = getWagon();
--            wagon.connect( new Repository( "id", "http://localhost:" + server.getConnectors()[0].getLocalPort() ) );
-+            wagon.connect( new Repository( "id", "http://localhost:" + ((org.eclipse.jetty.server.NetworkConnector) server.getConnectors()[0]).getLocalPort() ) );
- 
-             dest = File.createTempFile( "huge", "txt" );
- 
---- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonHttpServerTestCase.java
-+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonHttpServerTestCase.java
-@@ -21,9 +21,9 @@
- 
- import org.apache.maven.wagon.Wagon;
- import org.codehaus.plexus.PlexusTestCase;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.handler.ResourceHandler;
--import org.mortbay.jetty.servlet.Context;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.handler.ResourceHandler;
-+import org.eclipse.jetty.servlet.ServletContextHandler;
- 
- /**
-  * User: jdumay Date: 24/01/2008 Time: 18:15:53
-@@ -37,7 +37,7 @@
- 
-     protected ResourceHandler resourceHandler;
- 
--    protected Context context;
-+    protected ServletContextHandler context;
- 
-     protected void setUp()
-         throws Exception
-@@ -45,10 +45,10 @@
-         super.setUp();
-         server = new Server( httpServerPort );
- 
--        context = new Context( server, "/", Context.SESSIONS );
-+        context = new ServletContextHandler( server, "/", ServletContextHandler.SESSIONS );
- 
-         resourceHandler = new ResourceHandler();
--        server.addHandler( resourceHandler );
-+        server.setHandler( resourceHandler );
-     }
- 
-     protected Wagon getWagon()
---- 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
-@@ -20,9 +20,14 @@
-  */
- 
- import org.apache.maven.wagon.Wagon;
--import org.mortbay.jetty.Connector;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.security.SslSocketConnector;
-+import org.eclipse.jetty.server.Connector;
-+import org.eclipse.jetty.server.HttpConnectionFactory;
-+import org.eclipse.jetty.server.NetworkConnector;
-+import org.eclipse.jetty.server.SecureRequestCustomizer;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.ServerConnector;
-+import org.eclipse.jetty.server.SslConnectionFactory;
-+import org.eclipse.jetty.util.ssl.SslContextFactory;
- 
- public class HttpsWagonPreemptiveTest
-     extends HttpWagonTest
-@@ -37,13 +42,22 @@
-         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" );
-+        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" );
-+
-+        org.eclipse.jetty.server.HttpConfiguration https_config = new org.eclipse.jetty.server.HttpConfiguration();
-+        https_config.setSecureScheme( "https" );
-+        https_config.addCustomizer( new SecureRequestCustomizer() );
-+
-+        ServerConnector connector = new ServerConnector(server,
-+                new SslConnectionFactory( sslContextFactory, "http/1.1" ),
-+                new HttpConnectionFactory( https_config ) );
-+        connector.setPort( ((NetworkConnector) server.getConnectors()[0]).getPort() );
-+
-         server.setConnectors( new Connector[]{ connector } );
-     }
- 
---- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonTimeoutTest.java
-+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonTimeoutTest.java
-@@ -23,7 +23,7 @@
- import org.apache.maven.wagon.TransferFailedException;
- import org.apache.maven.wagon.Wagon;
- import org.apache.maven.wagon.repository.Repository;
--import org.mortbay.jetty.servlet.ServletHolder;
-+import org.eclipse.jetty.servlet.ServletHolder;
- 
- import java.io.File;
- import java.util.Random;
---- 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,15 @@
-  * under the License.
-  */
- 
--import org.mortbay.jetty.Connector;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.security.SslSocketConnector;
-+import org.eclipse.jetty.server.Connector;
-+import org.eclipse.jetty.server.HttpConfiguration;
-+import org.eclipse.jetty.server.HttpConnectionFactory;
-+import org.eclipse.jetty.server.NetworkConnector;
-+import org.eclipse.jetty.server.SecureRequestCustomizer;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.ServerConnector;
-+import org.eclipse.jetty.server.SslConnectionFactory;
-+import org.eclipse.jetty.util.ssl.SslContextFactory;
- 
- public class HttpsWagonTest
-     extends HttpWagonTest
-@@ -41,13 +47,22 @@
-         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" );
-+        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" );
-+
-+        HttpConfiguration https_config = new HttpConfiguration();
-+        https_config.setSecureScheme( "https" );
-+        https_config.addCustomizer( new SecureRequestCustomizer() );
-+
-+        ServerConnector connector = new ServerConnector(server,
-+                new SslConnectionFactory( sslContextFactory, "http/1.1" ),
-+                new HttpConnectionFactory( https_config ) );
-+        connector.setPort( ((NetworkConnector) server.getConnectors()[0]).getPort() );
-+
-         server.setConnectors( new Connector[]{ connector } );
-     }
- }
---- a/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonReasonPhraseTest.java
-+++ b/wagon-providers/wagon-http/src/test/java/org/apache/maven/wagon/providers/http/HttpWagonReasonPhraseTest.java
-@@ -24,7 +24,7 @@
- import org.apache.maven.wagon.Wagon;
- import org.apache.maven.wagon.authorization.AuthorizationException;
- import org.apache.maven.wagon.repository.Repository;
--import org.mortbay.jetty.servlet.ServletHolder;
-+import org.eclipse.jetty.servlet.ServletHolder;
- 
- import java.io.File;
- 
---- 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,10 +19,15 @@
-  * under the License.
-  */
- 
--import org.mortbay.jetty.Connector;
--import org.mortbay.jetty.Server;
--import org.mortbay.jetty.security.SslSocketConnector;
--
-+import org.eclipse.jetty.server.Connector;
-+import org.eclipse.jetty.server.HttpConfiguration;
-+import org.eclipse.jetty.server.HttpConnectionFactory;
-+import org.eclipse.jetty.server.NetworkConnector;
-+import org.eclipse.jetty.server.SecureRequestCustomizer;
-+import org.eclipse.jetty.server.Server;
-+import org.eclipse.jetty.server.ServerConnector;
-+import org.eclipse.jetty.server.SslConnectionFactory;
-+import org.eclipse.jetty.util.ssl.SslContextFactory;
- public class LightweightHttpsWagonTest
-     extends LightweightHttpWagonTest
- {
-@@ -36,13 +41,22 @@
-         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" );
-+        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" );
-+
-+        HttpConfiguration https_config = new HttpConfiguration();
-+        https_config.setSecureScheme( "https" );
-+        https_config.addCustomizer( new SecureRequestCustomizer() );
-+
-+        ServerConnector connector = new ServerConnector(server,
-+                new SslConnectionFactory( sslContextFactory, "http/1.1" ),
-+                new HttpConnectionFactory( https_config ) );
-+        connector.setPort( ((NetworkConnector) server.getConnectors()[0]).getPort() );
-+
-         server.setConnectors( new Connector[] { connector } );
-     }
- 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/wagon2.git



More information about the pkg-java-commits mailing list