aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorolivier lamy <olamy@apache.org>2017-05-12 16:19:41 +1000
committerolivier lamy <olamy@apache.org>2017-05-12 16:19:41 +1000
commite9376eeb6d72fbd83ed893c9b1ddfa57cb7220f6 (patch)
treec79e71ec95661e73c9cc75ba3086d55e10a20ffd
parent3c036f325b442deea22f8e6e8d76f056fca1147c (diff)
downloadarchiva-e9376eeb6d72fbd83ed893c9b1ddfa57cb7220f6.tar.gz
archiva-e9376eeb6d72fbd83ed893c9b1ddfa57cb7220f6.zip
migrate all tests to jetty 9.4
Signed-off-by: olivier lamy <olamy@apache.org>
-rw-r--r--archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml41
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java8
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTaskTest.java11
-rw-r--r--archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/resources/log4j2-test.xml4
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml5
-rw-r--r--archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml2
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/pom.xml5
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/DownloadArtifactsTest.java16
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/remotedownload/RemoteRepositoryConnectivityCheckTest.java13
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml14
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/pom.xml5
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/AbstractRepositoryServletProxiedTestCase.java8
-rw-r--r--archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavSessionProviderTest.java63
-rw-r--r--archiva-modules/plugins/stage-repository-merge/src/test/resources/log4j2-test.xml3
-rw-r--r--pom.xml2
15 files changed, 140 insertions, 60 deletions
diff --git a/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml
new file mode 100644
index 000000000..282cfa5d9
--- /dev/null
+++ b/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/log4j2-test.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements. See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership. The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License. You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied. See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ -->
+
+
+<configuration>
+ <appenders>
+ <Console name="console" target="SYSTEM_OUT">
+ <PatternLayout pattern="%d [%t] %-5p %c %x - %m%n"/>
+ </Console>
+ </appenders>
+ <loggers>
+
+ <logger name="org.springframework" level="error"/>
+
+ <!--
+ <logger name="org.apache.http" level="debug"/>
+ -->
+ <root level="info">
+ <appender-ref ref="console"/>
+ </root>
+ </loggers>
+</configuration>
+
+
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java
index f0ca4f596..d85d5016e 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java
@@ -38,8 +38,10 @@ import org.apache.archiva.policies.SnapshotsPolicy;
import org.apache.archiva.repository.ManagedRepositoryContent;
import org.assertj.core.api.Assertions;
import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.HttpConnectionFactory;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.ServerConnector;
import org.eclipse.jetty.server.handler.AbstractHandler;
import org.junit.After;
import org.junit.Before;
@@ -164,11 +166,13 @@ public class HttpProxyTransferTest
}
};
- server = new Server( 0 );
+ server = new Server( );
+ ServerConnector serverConnector = new ServerConnector( server, new HttpConnectionFactory());
+ server.addConnector( serverConnector );
server.setHandler( handler );
server.start();
- int port = server.getConnectors()[0].getLocalPort();
+ int port = serverConnector.getLocalPort();
NetworkProxyConfiguration proxyConfig = new NetworkProxyConfiguration();
proxyConfig.setHost( "localhost" );
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 6a1210d1a..09fdf5a31 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
@@ -31,7 +31,9 @@ import org.apache.maven.index.MAVEN;
import org.apache.maven.index.NexusIndexer;
import org.apache.maven.index.expr.StringSearchExpression;
import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.HttpConnectionFactory;
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;
@@ -61,6 +63,7 @@ public class DownloadRemoteIndexTaskTest
{
private Server server;
+ private ServerConnector serverConnector;
private int port;
@@ -81,12 +84,12 @@ public class DownloadRemoteIndexTaskTest
public void initialize()
throws Exception
{
- server = new Server( 0 );
+ server = new Server( );
+ serverConnector = new ServerConnector( server, new HttpConnectionFactory());
+ server.addConnector( serverConnector );
createContext( server, new File( "src/test/" ) );
-
this.server.start();
- Connector connector = this.server.getConnectors()[0];
- this.port = connector.getLocalPort();
+ this.port = serverConnector.getLocalPort();
log.info( "start server on port {}", this.port );
nexusIndexer = plexusSisuBridge.lookup( NexusIndexer.class );
}
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/resources/log4j2-test.xml
index 6e3ef0ff3..c7f86dd6b 100644
--- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/resources/log4j2-test.xml
+++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/resources/log4j2-test.xml
@@ -19,7 +19,7 @@
-->
-<configuration status="debug">
+<configuration>
<appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d [%t] %-5p %c %x - %m%n"/>
@@ -29,7 +29,7 @@
<logger name="org.springframework" level="error"/>
- <logger name="org.apache.archiva.scheduler.indexing" level="debug"/>
+ <logger name="org.apache.archiva.scheduler.indexing" level="info"/>
<!--
<logger name="org.apache.http" level="debug"/>
-->
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
index f77fbc188..88420e281 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
@@ -37,7 +37,6 @@
-->
<redbackTestJdbcUrl>jdbc:hsqldb:mem:redback-test</redbackTestJdbcUrl>
<redbackTestJdbcDriver>org.hsqldb.jdbcDriver</redbackTestJdbcDriver>
- <jetty.version>9.4.5.v20170502</jetty.version>
</properties>
<dependencies>
@@ -387,12 +386,12 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
- <version>${jetty.version}</version>
+ <version>${jettyVersion}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
- <version>${jetty.version}</version>
+ <version>${jettyVersion}</version>
</dependency>
<dependency>
<groupId>xerces</groupId>
diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
index 4d7c9ab07..1c258ef1e 100644
--- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
+++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/resources/log4j2-test.xml
@@ -30,7 +30,7 @@
<logger name="org.apache.archiva.redback.rest.services" level="error"/>
<logger name="JPOX" level="error"/>
<logger name="org.apache.archiva.rest.services" level="info"/>
- <logger name="org.springframework" level="info"/>
+ <logger name="org.springframework" level="error"/>
<logger name="org.apache.commons.configuration" level="error"/>
<root level="info">
diff --git a/archiva-modules/archiva-web/archiva-web-common/pom.xml b/archiva-modules/archiva-web/archiva-web-common/pom.xml
index e3b113a37..a173f6aa8 100644
--- a/archiva-modules/archiva-web/archiva-web-common/pom.xml
+++ b/archiva-modules/archiva-web/archiva-web-common/pom.xml
@@ -236,6 +236,11 @@
<artifactId>spring-web</artifactId>
</dependency>
<dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
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 b009e8c71..eae41013f 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
@@ -25,7 +25,9 @@ import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
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.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.junit.After;
@@ -96,7 +98,9 @@ public class DownloadArtifactsTest
// repo handler
- this.repoServer = new Server( 0 );
+ this.repoServer = new Server( );
+ ServerConnector repoServerConnector = new ServerConnector( this.repoServer, new HttpConnectionFactory());
+ this.repoServer.addConnector( repoServerConnector );
ServletHolder shRepo = new ServletHolder( RepoServlet.class );
ServletContextHandler contextRepo = new ServletContextHandler();
@@ -105,12 +109,16 @@ public class DownloadArtifactsTest
contextRepo.addServlet( shRepo, "/*" );
repoServer.setHandler( contextRepo );
+
repoServer.start();
- this.repoServerPort = repoServer.getConnectors()[0].getLocalPort();
+ this.repoServerPort = repoServerConnector.getLocalPort();
//redirect handler
- this.redirectServer = new Server( 0 );
+ this.redirectServer = new Server( );
+ ServerConnector redirectServerConnector = new ServerConnector( this.redirectServer, new HttpConnectionFactory());
+ this.redirectServer.addConnector( redirectServerConnector );
+
ServletHolder shRedirect = new ServletHolder( RedirectServlet.class );
ServletContextHandler contextRedirect = new ServletContextHandler();
contextRedirect.setAttribute( "redirectToPort", Integer.toString( this.repoServerPort ) );
@@ -120,7 +128,7 @@ public class DownloadArtifactsTest
redirectServer.setHandler( contextRedirect );
redirectServer.start();
- this.redirectPort = redirectServer.getConnectors()[0].getLocalPort();
+ this.redirectPort = redirectServerConnector.getLocalPort();
log.info( "redirect server port {}", redirectPort );
}
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 fabe56808..369bb10f8 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
@@ -24,7 +24,9 @@ import org.apache.archiva.rest.api.services.RemoteRepositoriesService;
import org.apache.commons.io.FileUtils;
import org.apache.cxf.jaxrs.client.WebClient;
import org.eclipse.jetty.server.Handler;
+import org.eclipse.jetty.server.HttpConnectionFactory;
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;
@@ -71,6 +73,9 @@ public class RemoteRepositoryConnectivityCheckTest
Server repoServer =
buildStaticServer( new File( System.getProperty( "basedir" ) + "/src/test/repositories/test-repo" ) );
+
+ ServerConnector serverConnector = new ServerConnector( repoServer, new HttpConnectionFactory());
+ repoServer.addConnector( serverConnector );
repoServer.start();
RemoteRepositoriesService service = getRemoteRepositoriesService();
@@ -80,7 +85,7 @@ public class RemoteRepositoryConnectivityCheckTest
try
{
- int repoServerPort = repoServer.getConnectors()[0].getLocalPort();
+ int repoServerPort = serverConnector.getLocalPort();
RemoteRepository repo = getRemoteRepository();
@@ -104,6 +109,8 @@ public class RemoteRepositoryConnectivityCheckTest
File tmpDir = Files.createTempDirectory( "test" ).toFile();
Server repoServer = buildStaticServer( tmpDir );
+ ServerConnector serverConnector = new ServerConnector( repoServer, new HttpConnectionFactory());
+ repoServer.addConnector( serverConnector );
repoServer.start();
RemoteRepositoriesService service = getRemoteRepositoriesService();
@@ -113,7 +120,7 @@ public class RemoteRepositoryConnectivityCheckTest
try
{
- int repoServerPort = repoServer.getConnectors()[0].getLocalPort();
+ int repoServerPort = serverConnector.getLocalPort();
RemoteRepository repo = getRemoteRepository();
@@ -160,7 +167,7 @@ public class RemoteRepositoryConnectivityCheckTest
protected Server buildStaticServer( File path )
{
- Server repoServer = new Server( 0 );
+ Server repoServer = new Server( );
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setDirectoriesListed( true );
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml
index b80c0b0fa..11ff56844 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml
+++ b/archiva-modules/archiva-web/archiva-web-common/src/test/resources/log4j2-test.xml
@@ -28,15 +28,15 @@
<loggers>
<logger name="org.springframework" level="error"/>
-
+ <logger name="org.apache.archiva" level="error"/>
<logger name="org.apache.archiva.web" level="info"/>
-
<logger name="org.apache.commons.configuration" level="error"/>
-
- <logger name="org.apache.archiva.scheduler.indexing" level="debug"/>
-
- <logger name="org.apache.archiva.remotedownload" level="debug"/>
-
+ <logger name="org.apache.archiva.scheduler.indexing" level="info"/>
+ <logger name="org.apache.archiva.remotedownload" level="info"/>
+ <logger name="org.apache.jackrabbit" level="error"/>
+ <logger name="org.quartz" level="error"/>
+ <logger name="JPOX.RDBMS" level="error"/>
+ <logger name="JPOX" level="error"/>
<root level="info">
<appender-ref ref="console"/>
</root>
diff --git a/archiva-modules/archiva-web/archiva-webdav/pom.xml b/archiva-modules/archiva-web/archiva-webdav/pom.xml
index 6e7bf6f8d..6c4f3f9b0 100644
--- a/archiva-modules/archiva-web/archiva-webdav/pom.xml
+++ b/archiva-modules/archiva-web/archiva-webdav/pom.xml
@@ -160,6 +160,11 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
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 0c0a7183c..42146c031 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
@@ -28,7 +28,9 @@ import org.apache.archiva.policies.ChecksumPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.archiva.policies.SnapshotsPolicy;
import org.apache.commons.io.FileUtils;
+import org.eclipse.jetty.server.HttpConnectionFactory;
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;
@@ -137,7 +139,9 @@ public abstract class AbstractRepositoryServletProxiedTestCase
repo.root.mkdirs();
}
- repo.server = new Server( 0 );
+ repo.server = new Server( );
+ ServerConnector serverConnector = new ServerConnector( repo.server, new HttpConnectionFactory());
+ repo.server.addConnector( serverConnector );
ContextHandlerCollection contexts = new ContextHandlerCollection();
repo.server.setHandler( contexts );
@@ -154,7 +158,7 @@ public abstract class AbstractRepositoryServletProxiedTestCase
repo.server.start();
- int port = repo.server.getConnectors()[0].getLocalPort();
+ int port = serverConnector.getLocalPort();
repo.url = "http://localhost:" + port + repo.context;
log.info( "Remote HTTP Server started on {}", repo.url );
diff --git a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavSessionProviderTest.java b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavSessionProviderTest.java
index b657c082b..30a1049d6 100644
--- a/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavSessionProviderTest.java
+++ b/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/webdav/ArchivaDavSessionProviderTest.java
@@ -20,46 +20,30 @@ package org.apache.archiva.webdav;
*/
import junit.framework.TestCase;
+import org.apache.archiva.redback.authentication.AuthenticationDataSource;
import org.apache.archiva.redback.authentication.AuthenticationException;
+import org.apache.archiva.redback.authentication.AuthenticationResult;
+import org.apache.archiva.redback.authorization.AuthorizationException;
+import org.apache.archiva.redback.authorization.UnauthorizedException;
+import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
import org.apache.archiva.redback.policy.AccountLockedException;
import org.apache.archiva.redback.policy.MustChangePasswordException;
+import org.apache.archiva.redback.system.SecuritySession;
import org.apache.archiva.redback.users.User;
+import org.apache.archiva.security.ServletAuthenticator;
+import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
import org.apache.jackrabbit.webdav.DavSessionProvider;
import org.apache.jackrabbit.webdav.WebdavRequest;
import org.apache.jackrabbit.webdav.WebdavRequestImpl;
-import org.apache.archiva.security.ServletAuthenticator;
-import org.apache.archiva.redback.authentication.AuthenticationDataSource;
-import org.apache.archiva.redback.authentication.AuthenticationResult;
-import org.apache.archiva.redback.authorization.AuthorizationException;
-import org.apache.archiva.redback.authorization.UnauthorizedException;
-import org.apache.archiva.redback.system.SecuritySession;
-import org.apache.archiva.redback.integration.filter.authentication.HttpAuthenticator;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.mock.web.MockHttpServletRequest;
-import javax.servlet.AsyncContext;
-import javax.servlet.DispatcherType;
-import javax.servlet.RequestDispatcher;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletInputStream;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
-import javax.servlet.http.Part;
-import java.io.BufferedReader;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Locale;
-import java.util.Map;
-import org.apache.archiva.test.utils.ArchivaBlockJUnit4ClassRunner;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
@RunWith( ArchivaBlockJUnit4ClassRunner.class )
public class ArchivaDavSessionProviderTest
@@ -76,7 +60,7 @@ public class ArchivaDavSessionProviderTest
{
super.setUp();
sessionProvider = new ArchivaDavSessionProvider( new ServletAuthenticatorMock(), new HttpAuthenticatorMock() );
- request = new WebdavRequestImpl( new HttpServletRequestMock(), null );
+ request = new WebdavRequestImpl( new MockHttpServletRequest(), null );
}
@Test
@@ -101,11 +85,31 @@ public class ArchivaDavSessionProviderTest
}
@SuppressWarnings( "unchecked" )
+ /*
private class HttpServletRequestMock
implements HttpServletRequest
{
@Override
+ public long getContentLengthLong()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ @Override
+ public String changeSessionId()
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ @Override
+ public <T extends HttpUpgradeHandler> T upgrade( Class<T> handlerClass )
+ throws IOException, ServletException
+ {
+ throw new UnsupportedOperationException( "Not supported yet." );
+ }
+
+ @Override
public boolean authenticate( HttpServletResponse httpServletResponse )
throws IOException, ServletException
{
@@ -513,6 +517,7 @@ public class ArchivaDavSessionProviderTest
}
}
+ */
private class ServletAuthenticatorMock
implements ServletAuthenticator
{
diff --git a/archiva-modules/plugins/stage-repository-merge/src/test/resources/log4j2-test.xml b/archiva-modules/plugins/stage-repository-merge/src/test/resources/log4j2-test.xml
index 1ce090b03..84243affe 100644
--- a/archiva-modules/plugins/stage-repository-merge/src/test/resources/log4j2-test.xml
+++ b/archiva-modules/plugins/stage-repository-merge/src/test/resources/log4j2-test.xml
@@ -19,7 +19,7 @@
-->
-<configuration status="debug">
+<configuration>
<appenders>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
@@ -31,7 +31,6 @@
<logger name="org.springframework" level="error"/>
-
<root level="info">
<appender-ref ref="console"/>
</root>
diff --git a/pom.xml b/pom.xml
index 53b389a32..ee9719659 100644
--- a/pom.xml
+++ b/pom.xml
@@ -86,7 +86,7 @@
<httpclient.version>4.5.2</httpclient.version>
<httpclient.core.version>4.4.4</httpclient.core.version>
<javaxMailVersion>1.4</javaxMailVersion>
- <jettyVersion>8.1.14.v20131031</jettyVersion>
+ <jettyVersion>9.4.5.v20170502</jettyVersion>
<guava.version>16.0.1</guava.version>
<!-- restore when we will be able to use a derby in memory database -->