mirror of https://github.com/apache/archiva.git
[MRM-1539] Upgrade to Jetty: fix webdav test
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1189905 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e624d21c43
commit
58991fda0d
|
@ -68,8 +68,8 @@
|
||||||
<Set name="Acceptors">2</Set>
|
<Set name="Acceptors">2</Set>
|
||||||
<Set name="statsOn">false</Set>
|
<Set name="statsOn">false</Set>
|
||||||
<Set name="confidentialPort">8443</Set>
|
<Set name="confidentialPort">8443</Set>
|
||||||
<Set name="lowResourcesConnections">5000</Set>
|
<Set name="lowResourcesConnections">5000</Set>
|
||||||
<Set name="lowResourcesMaxIdleTime">5000</Set>
|
<Set name="lowResourcesMaxIdleTime">5000</Set>
|
||||||
</New>
|
</New>
|
||||||
</Arg>
|
</Arg>
|
||||||
</Call>
|
</Call>
|
||||||
|
|
|
@ -21,20 +21,22 @@ package org.apache.archiva.webdav;
|
||||||
|
|
||||||
import com.meterware.httpunit.WebConversation;
|
import com.meterware.httpunit.WebConversation;
|
||||||
import com.meterware.httpunit.WebResponse;
|
import com.meterware.httpunit.WebResponse;
|
||||||
import org.apache.commons.io.FileUtils;
|
|
||||||
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
|
import org.apache.archiva.configuration.ProxyConnectorConfiguration;
|
||||||
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
import org.apache.archiva.configuration.RemoteRepositoryConfiguration;
|
||||||
import org.apache.archiva.policies.CachedFailuresPolicy;
|
import org.apache.archiva.policies.CachedFailuresPolicy;
|
||||||
import org.apache.archiva.policies.ChecksumPolicy;
|
import org.apache.archiva.policies.ChecksumPolicy;
|
||||||
import org.apache.archiva.policies.ReleasesPolicy;
|
import org.apache.archiva.policies.ReleasesPolicy;
|
||||||
import org.apache.archiva.policies.SnapshotsPolicy;
|
import org.apache.archiva.policies.SnapshotsPolicy;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.eclipse.jetty.server.Server;
|
||||||
|
import org.eclipse.jetty.server.handler.ContextHandler;
|
||||||
|
import org.eclipse.jetty.server.handler.ContextHandlerCollection;
|
||||||
|
import org.eclipse.jetty.servlet.DefaultServlet;
|
||||||
|
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||||
|
import org.eclipse.jetty.servlet.ServletHandler;
|
||||||
|
import org.eclipse.jetty.servlet.ServletHolder;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
import org.mortbay.jetty.Server;
|
|
||||||
import org.mortbay.jetty.handler.ContextHandler;
|
|
||||||
import org.mortbay.jetty.handler.ContextHandlerCollection;
|
|
||||||
import org.mortbay.jetty.servlet.DefaultServlet;
|
|
||||||
import org.mortbay.jetty.servlet.ServletHandler;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
|
@ -122,14 +124,15 @@ public abstract class AbstractRepositoryServletProxiedTestCase
|
||||||
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
ContextHandlerCollection contexts = new ContextHandlerCollection();
|
||||||
repo.server.setHandler( contexts );
|
repo.server.setHandler( contexts );
|
||||||
|
|
||||||
ContextHandler context = new ContextHandler();
|
ServletContextHandler context = new ServletContextHandler();
|
||||||
context.setContextPath( repo.context );
|
context.setContextPath( repo.context );
|
||||||
context.setResourceBase( repo.root.getAbsolutePath() );
|
context.setResourceBase( repo.root.getAbsolutePath() );
|
||||||
context.setAttribute( "dirAllowed", true );
|
context.setAttribute( "dirAllowed", true );
|
||||||
context.setAttribute( "maxCacheSize", 0 );
|
context.setAttribute( "maxCacheSize", 0 );
|
||||||
ServletHandler servlet = new ServletHandler();
|
|
||||||
servlet.addServletWithMapping( DefaultServlet.class.getName(), "/" );
|
ServletHolder sh = new ServletHolder( DefaultServlet.class );
|
||||||
context.setHandler( servlet );
|
context.addServlet( sh, "/" );
|
||||||
|
|
||||||
contexts.addHandler( context );
|
contexts.addHandler( context );
|
||||||
|
|
||||||
repo.server.start();
|
repo.server.start();
|
||||||
|
|
Loading…
Reference in New Issue