aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-proxy
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-10-02 15:11:33 +0000
committerOlivier Lamy <olamy@apache.org>2012-10-02 15:11:33 +0000
commit163e2753eb3ec596f5b1a911f4240c9d277fadbc (patch)
tree5ddb95cd2f2bdb91b678902fb3ba6f9e83c0b5d5 /archiva-modules/archiva-base/archiva-proxy
parentf2893abda1baff9f722dbec9e7ce76f88b0830e3 (diff)
downloadarchiva-163e2753eb3ec596f5b1a911f4240c9d277fadbc.tar.gz
archiva-163e2753eb3ec596f5b1a911f4240c9d277fadbc.zip
use more recent jetty version
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1392950 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-proxy')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/pom.xml5
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/ProxyConnector.java13
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/proxy/HttpProxyTransferTest.java20
3 files changed, 26 insertions, 12 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/pom.xml b/archiva-modules/archiva-base/archiva-proxy/pom.xml
index 75f22e52a..5d2e1b920 100644
--- a/archiva-modules/archiva-base/archiva-proxy/pom.xml
+++ b/archiva-modules/archiva-base/archiva-proxy/pom.xml
@@ -123,9 +123,8 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.11</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<dependency>
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/ProxyConnector.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/ProxyConnector.java
index 2a11dd6ee..79ff9da45 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/ProxyConnector.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/archiva/proxy/ProxyConnector.java
@@ -29,8 +29,6 @@ import java.util.Map;
/**
* This represents a connector for a repository to repository proxy.
- *
- *
*/
public class ProxyConnector
implements RepositoryConnector
@@ -44,19 +42,24 @@ public class ProxyConnector
private List<String> whitelist;
private String proxyId;
-
+
private int order;
private Map<String, String> policies;
-
+
private boolean disabled;
+ public ProxyConnector()
+ {
+ // no op
+ }
+
public boolean isDisabled()
{
return disabled;
}
- public void setDisabled(boolean disabled)
+ public void setDisabled( boolean disabled )
{
this.disabled = disabled;
}
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 f3264febe..4273bf3d3 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
@@ -35,14 +35,14 @@ import org.apache.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
import org.apache.archiva.policies.ReleasesPolicy;
import org.apache.archiva.policies.SnapshotsPolicy;
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.handler.AbstractHandler;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mortbay.jetty.Handler;
-import org.mortbay.jetty.Request;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.AbstractHandler;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
@@ -137,6 +137,18 @@ public class HttpProxyTransferTest
Handler handler = new AbstractHandler()
{
+ public void handle( String s, Request request, HttpServletRequest httpServletRequest,
+ HttpServletResponse response )
+ throws IOException, ServletException
+ {
+ response.setContentType( "text/plain" );
+ response.setStatus( HttpServletResponse.SC_OK );
+ response.getWriter().print( "get-default-layout-1.0.jar\n\n" );
+ assertNotNull( request.getHeader( "Proxy-Connection" ) );
+
+ ( (Request) request ).setHandled( true );
+ }
+
public void handle( String target, HttpServletRequest request, HttpServletResponse response, int dispatch )
throws IOException, ServletException
{