From afd02f3a1343b7131d4a3985b9e08b922a2eba0d Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 14 Apr 2014 15:56:30 +1000 Subject: [PATCH] Revert "[MRM-1828] upgrade to jetty 9.x" This reverts commit a7a2c9130e30992d3d5dc4e6edac5d1d51034458. --- .../archiva/proxy/HttpProxyTransferTest.java | 3 +-- .../indexing/DownloadRemoteIndexTaskTest.java | 13 ++++++------- .../archiva-web/archiva-web-common/pom.xml | 6 ------ .../remotedownload/DownloadArtifactsTest.java | 14 +++++++------- .../RemoteRepositoryConnectivityCheckTest.java | 5 ++--- .../AbstractRepositoryServletProxiedTestCase.java | 3 +-- pom.xml | 2 +- 7 files changed, 18 insertions(+), 28 deletions(-) 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 92e34c8de..b96a261ed 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 @@ -39,7 +39,6 @@ import org.apache.archiva.repository.ManagedRepositoryContent; import org.eclipse.jetty.server.Handler; 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; @@ -168,7 +167,7 @@ public class HttpProxyTransferTest server.setHandler( handler ); server.start(); - int port = ServerConnector.class.cast( server.getConnectors()[0] ).getLocalPort(); + int port = server.getConnectors()[0].getLocalPort(); NetworkProxyConfiguration proxyConfig = new NetworkProxyConfiguration(); proxyConfig.setHost( "localhost" ); diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java index f0c6330f2..6a1210d1a 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java @@ -18,11 +18,11 @@ package org.apache.archiva.scheduler.indexing; * under the License. */ +import junit.framework.TestCase; import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.admin.model.remote.RemoteRepositoryAdmin; import org.apache.archiva.common.plexusbridge.PlexusSisuBridge; import org.apache.archiva.common.utils.FileUtil; -import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanQuery; import org.apache.maven.index.FlatSearchRequest; @@ -32,10 +32,10 @@ import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.expr.StringSearchExpression; import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; +import static org.assertj.core.api.Assertions.assertThat; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -50,14 +50,13 @@ import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.concurrent.TimeUnit; - -import static org.assertj.core.api.Assertions.assertThat; +import org.apache.archiva.test.utils.ArchivaSpringJUnit4ClassRunner; /** * @author Olivier Lamy */ -@RunWith(ArchivaSpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" }) +@RunWith( ArchivaSpringJUnit4ClassRunner.class ) +@ContextConfiguration( locations = { "classpath*:/META-INF/spring-context.xml", "classpath*:/spring-context.xml" } ) public class DownloadRemoteIndexTaskTest { @@ -87,7 +86,7 @@ public class DownloadRemoteIndexTaskTest this.server.start(); Connector connector = this.server.getConnectors()[0]; - this.port = ServerConnector.class.cast( connector ).getLocalPort(); + this.port = connector.getLocalPort(); log.info( "start server on port {}", this.port ); nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class ); } diff --git a/archiva-modules/archiva-web/archiva-web-common/pom.xml b/archiva-modules/archiva-web/archiva-web-common/pom.xml index 9163042e1..b1bc6d99b 100644 --- a/archiva-modules/archiva-web/archiva-web-common/pom.xml +++ b/archiva-modules/archiva-web/archiva-web-common/pom.xml @@ -403,12 +403,6 @@ test - - javax.mail - mail - provided - - diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java index a9ac754d2..3192fce54 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java @@ -21,13 +21,11 @@ package org.apache.archiva.remotedownload; import org.apache.archiva.admin.model.beans.RemoteRepository; import org.apache.archiva.redback.rest.api.services.RoleManagementService; import org.apache.archiva.security.common.ArchivaRoleConstants; -import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; import org.apache.commons.compress.utils.IOUtils; import org.apache.commons.io.FileUtils; import org.apache.maven.wagon.providers.http.HttpWagon; import org.apache.maven.wagon.repository.Repository; 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.junit.After; @@ -49,11 +47,12 @@ import java.io.IOException; import java.util.List; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner; /** * @author Olivier Lamy */ -@RunWith(ArchivaBlockJUnit4ClassRunner.class) +@RunWith( ArchivaBlockJUnit4ClassRunner.class ) public class DownloadArtifactsTest extends AbstractDownloadTest { @@ -86,9 +85,8 @@ public class DownloadArtifactsTest protected String getSpringConfigLocation() { return "classpath*:META-INF/spring-context.xml classpath*:spring-context-test-common.xml classpath*:spring-context-artifacts-download.xml"; - } + } @Override - @Override @Before public void startServer() @@ -108,7 +106,7 @@ public class DownloadArtifactsTest repoServer.setHandler( contextRepo ); repoServer.start(); - this.repoServerPort = ServerConnector.class.cast( repoServer.getConnectors()[0] ).getLocalPort(); + this.repoServerPort = repoServer.getConnectors()[0].getLocalPort(); //redirect handler @@ -122,7 +120,7 @@ public class DownloadArtifactsTest redirectServer.setHandler( contextRedirect ); redirectServer.start(); - this.redirectPort = ServerConnector.class.cast( redirectServer.getConnectors()[0] ).getLocalPort(); + this.redirectPort = redirectServer.getConnectors()[0].getLocalPort(); log.info( "redirect server port {}", redirectPort ); } @@ -184,6 +182,8 @@ public class DownloadArtifactsTest } + + public static class RedirectServlet extends HttpServlet { diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/RemoteRepositoryConnectivityCheckTest.java b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/RemoteRepositoryConnectivityCheckTest.java index 2734c0e90..1b15f06e0 100644 --- a/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/RemoteRepositoryConnectivityCheckTest.java +++ b/archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/RemoteRepositoryConnectivityCheckTest.java @@ -26,7 +26,6 @@ import org.apache.commons.io.FileUtils; import org.apache.cxf.jaxrs.client.WebClient; 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.HandlerList; import org.eclipse.jetty.server.handler.ResourceHandler; @@ -81,7 +80,7 @@ public class RemoteRepositoryConnectivityCheckTest try { - int repoServerPort = ServerConnector.class.cast( repoServer.getConnectors()[0] ).getLocalPort(); + int repoServerPort = repoServer.getConnectors()[0].getLocalPort(); RemoteRepository repo = getRemoteRepository(); @@ -114,7 +113,7 @@ public class RemoteRepositoryConnectivityCheckTest try { - int repoServerPort = ServerConnector.class.cast( repoServer.getConnectors()[0] ).getLocalPort(); + int repoServerPort = repoServer.getConnectors()[0].getLocalPort(); RemoteRepository repo = getRemoteRepository(); diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java index d8925c952..c38e33f54 100644 --- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java +++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java @@ -32,7 +32,6 @@ import org.apache.archiva.policies.ReleasesPolicy; import org.apache.archiva.policies.SnapshotsPolicy; import org.apache.commons.io.FileUtils; import org.eclipse.jetty.server.Server; -import org.eclipse.jetty.server.ServerConnector; import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.servlet.DefaultServlet; import org.eclipse.jetty.servlet.ServletContextHandler; @@ -153,7 +152,7 @@ public abstract class AbstractRepositoryServletProxiedTestCase repo.server.start(); - int port = ServerConnector.class.cast( repo.server.getConnectors()[0] ).getLocalPort(); + int port = repo.server.getConnectors()[0].getLocalPort(); repo.url = "http://localhost:" + port + repo.context; log.info( "Remote HTTP Server started on {}", repo.url ); diff --git a/pom.xml b/pom.xml index de884d957..680d60b5a 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ 4.3.1 4.3 1.4 - 9.1.4.v20140401 + 8.1.14.v20131031 jdbc:derby:memory:users-test;create=true