archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r644276 - in /archiva/trunk: archiva-docs/src/site/apt/adminguide/ archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/ archiva-modules/archiva-base/archiva-configuration/src/main/mdo/ arc...
Date Thu, 03 Apr 2008 12:03:59 GMT
Author: brett
Date: Thu Apr  3 05:03:54 2008
New Revision: 644276

URL: http://svn.apache.org/viewvc?rev=644276&view=rev
Log:
[MRM-159] should not respond with a 404 if proxying a file results in a remote error
Merged from: r644205, 644275

Added:
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadErrorPolicy.java
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadErrorPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/Policy.java
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/Policy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsDownloadPolicy.java
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsDownloadPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PropagateErrorsOnUpdateDownloadPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ProxyDownloadException.java
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ProxyDownloadException.java
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ErrorHandlingTest.xml
      - copied unchanged from r644205, archiva/branches/archiva-1.0.x/archiva-base/archiva-proxy/src/test/resources/org/apache/maven/archiva/proxy/ErrorHandlingTest.xml
Modified:
    archiva/trunk/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt
    archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
    archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java
    archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java

Modified: archiva/trunk/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt (original)
+++ archiva/trunk/archiva-docs/src/site/apt/adminguide/proxy-connectors.apt Thu Apr  3 05:03:54 2008
@@ -29,14 +29,18 @@
 
   By default, Archiva comes with the following policies:
 
-    * <<<releases>>> - how to behave for released artifact metadata (those not carrying a <<<SNAPSHOT>>> version). This can be set to <<<always>>> (default), <<<hourly>>>, <<<daily>>>, <<<once>>> and <<<never>>>.
+    * <<<Releases>>> - how to behave for released artifact metadata (those not carrying a <<<SNAPSHOT>>> version). This can be set to <<<always>>> (default), <<<hourly>>>, <<<daily>>>, <<<once>>> and <<<never>>>.
 
-    * <<<snapshots>>> - how to behave for snapshot artifact metadata (those carrying a <<<SNAPSHOT>>> version). This can be set to <<<always>>> (default), <<<hourly>>>, <<<daily>>>, <<<once>>> and <<<never>>>.
+    * <<<Snapshots>>> - how to behave for snapshot artifact metadata (those carrying a <<<SNAPSHOT>>> version). This can be set to <<<always>>> (default), <<<hourly>>>, <<<daily>>>, <<<once>>> and <<<never>>>.
 
-    * <<<checksum>>> - how to handle incorrect checksums when downloading an artifact from the remote repository (ie, the checksum of the artifact does not match the corresponding detached checksum file).
+    * <<<Checksum>>> - how to handle incorrect checksums when downloading an artifact from the remote repository (ie, the checksum of the artifact does not match the corresponding detached checksum file).
       The options are to fail the request for the remote artifact, fix the checksum on the fly (default), or simply ignore the incorrect checksum
 
-    * <<<cache-failures>>> - whether failures retrieving the remote artifact should be cached (to save network bandwidth for missing or bad artifacts), or uncached (default).
+    * <<<Cache failures>>> - whether failures retrieving the remote artifact should be cached (to save network bandwidth for missing or bad artifacts), or uncached (default).
+
+    * <<<Return error when>>> - if a remote proxy causes an error, this option determines whether an existing artifact should be returned (error when <<<artifact not already present>>>), or the error passed on regardless (<<<always>>>).
+
+    * <<<On remote error>>> - if a remote error is encountered, <<<stop>>> causes the error to be returned immediately, <<<queue error>>> will return all errors after checking for other successful remote repositories first, and <<<ignore>>> will disregard ay errors.
 
     []
 

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java Thu Apr  3 05:03:54 2008
@@ -29,7 +29,7 @@
 import org.apache.maven.archiva.policies.AbstractUpdatePolicy;
 import org.apache.maven.archiva.policies.CachedFailuresPolicy;
 import org.apache.maven.archiva.policies.ChecksumPolicy;
-import org.apache.maven.archiva.policies.DownloadPolicy;
+import org.apache.maven.archiva.policies.Policy;
 import org.apache.maven.archiva.policies.PostDownloadPolicy;
 import org.apache.maven.archiva.policies.PreDownloadPolicy;
 import org.codehaus.plexus.evaluator.DefaultExpressionEvaluator;
@@ -280,7 +280,7 @@
                     // Validate existance of policy key.
                     if ( policyExists( policyId ) )
                     {
-                        DownloadPolicy policy = findPolicy( policyId );
+                        Policy policy = findPolicy( policyId );
                         // Does option exist?
                         if ( !policy.getOptions().contains( setting ) )
                         {
@@ -323,7 +323,7 @@
         return config;
     }
 
-    private DownloadPolicy findPolicy( String policyId )
+    private Policy findPolicy( String policyId )
     {
         if ( MapUtils.isEmpty( prePolicies ) )
         {
@@ -337,7 +337,7 @@
             return null;
         }
 
-        DownloadPolicy policy;
+        Policy policy;
 
         policy = prePolicies.get( policyId );
         if ( policy != null )

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo Thu Apr  3 05:03:54 2008
@@ -652,6 +652,20 @@
     public static final int UNORDERED = 0;
 
     /**
+     * The policy key {@link #getPolicies()} for error handling.
+     * See {@link org.apache.maven.archiva.policies.DownloadErrorPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_PROPAGATE_ERRORS = "propagate-errors";
+
+    /**
+     * The policy key {@link #getPolicies()} for error handling when an artifact is present.
+     * See {@link org.apache.maven.archiva.policies.DownloadErrorPolicy}
+     * for details on potential values to this policy key.
+     */
+    public static final String POLICY_PROPAGATE_ERRORS_ON_UPDATE = "propagate-errors-on-update";
+
+    /**
      * The policy key {@link #getPolicies()} for snapshot handling.
      * See {@link org.apache.maven.archiva.policies.SnapshotsPolicy}
      * for details on potential values to this policy key.

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java Thu Apr  3 05:03:54 2008
@@ -108,6 +108,11 @@
         return "cache-failures";
     }
 
+    public String getName()
+    {
+        return "Cache failures";
+    }
+
     public List<String> getOptions()
     {
         return options;

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java Thu Apr  3 05:03:54 2008
@@ -157,6 +157,11 @@
         return "checksum";
     }
 
+    public String getName()
+    {
+        return "Checksum";
+    }
+
     public List<String> getOptions()
     {
         return options;

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java Thu Apr  3 05:03:54 2008
@@ -20,7 +20,6 @@
  */
 
 import java.io.File;
-import java.util.List;
 import java.util.Properties;
 
 /**
@@ -30,27 +29,8 @@
  * @version $Id$
  */
 public interface DownloadPolicy
+    extends Policy
 {
-    /**
-     * Get the list of options for this policy.
-     * 
-     * @return the list of options for this policy.
-     */
-    public List<String> getOptions();
-
-    /**
-     * Get the default option for this policy.
-     * 
-     * @return the default policy for this policy.
-     */
-    public String getDefaultOption();
-
-    /**
-     * Get the id for this policy.
-     * 
-     * @return the id for this policy.
-     */
-    public String getId();
 
     /**
      * Apply the download policy.

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PostDownloadPolicy.java Thu Apr  3 05:03:54 2008
@@ -19,9 +19,6 @@
  * under the License.
  */
 
-import java.io.File;
-import java.util.Properties;
-
 /**
  * Policy to apply after the download has completed, but before the
  * resource is made available to the calling client. 
@@ -32,18 +29,4 @@
 public interface PostDownloadPolicy
     extends DownloadPolicy
 {
-    /**
-     * Apply the download policy.
-     * 
-     * A true result allows the download to succeed.  false indicates that the 
-     * download is a failure.
-     * 
-     * @param policySetting the policy setting.
-     * @param request the list of request properties that the policy might use.
-     * @param localFile the local file that this policy affects
-     * 
-     * @throws PolicyViolationException if the policy has been violated.
-     */
-    public void applyPolicy( String policySetting, Properties request, File localFile )
-        throws PolicyViolationException, PolicyConfigurationException;
 }

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/PreDownloadPolicy.java Thu Apr  3 05:03:54 2008
@@ -20,9 +20,6 @@
  */
 
 
-import java.io.File;
-import java.util.Properties;
-
 /**
  * Policy to apply before the download is attempted.
  *
@@ -31,18 +28,4 @@
  */
 public interface PreDownloadPolicy extends DownloadPolicy
 {
-    /**
-     * Apply the download policy.
-     * 
-     * A true result lets the download occur.  A false result prevents the download
-     * from occuring. 
-     * 
-     * @param policySetting the policy setting.
-     * @param request the list of request properties that the policy might use.
-     * @param localFile the local file that this policy affects
-     * 
-     * @throws PolicyViolationException if the policy has been violated.
-     */
-    public void applyPolicy( String policySetting, Properties request, File localFile )
-        throws PolicyViolationException, PolicyConfigurationException;
 }

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java Thu Apr  3 05:03:54 2008
@@ -55,4 +55,9 @@
     {
         return "releases";
     }
+
+    public String getName()
+    {
+        return "Releases";
+    }
 }

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java Thu Apr  3 05:03:54 2008
@@ -55,4 +55,9 @@
     {
         return "snapshots";
     }
+
+    public String getName()
+    {
+        return "Snapshots";
+    }
 }

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java Thu Apr  3 05:03:54 2008
@@ -19,16 +19,6 @@
  * under the License.
  */
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Map.Entry;
-
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang.StringUtils;
@@ -41,11 +31,13 @@
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.RepositoryURL;
 import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.policies.DownloadErrorPolicy;
 import org.apache.maven.archiva.policies.DownloadPolicy;
 import org.apache.maven.archiva.policies.PolicyConfigurationException;
 import org.apache.maven.archiva.policies.PolicyViolationException;
 import org.apache.maven.archiva.policies.PostDownloadPolicy;
 import org.apache.maven.archiva.policies.PreDownloadPolicy;
+import org.apache.maven.archiva.policies.ProxyDownloadException;
 import org.apache.maven.archiva.policies.urlcache.UrlFailureCache;
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
@@ -73,11 +65,23 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Properties;
+
 /**
  * DefaultRepositoryProxyConnectors
  *
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @version $Id$
+ * @todo exception handling needs work - "not modified" is not really an exceptional case, and it has more layers than your average brown onion
  * @plexus.component role-hint="default"
  */
 public class DefaultRepositoryProxyConnectors
@@ -116,7 +120,12 @@
     private Map<String, PostDownloadPolicy> postDownloadPolicies;
 
     /**
-     * @plexus.requirement
+     * @plexus.requirement role="org.apache.maven.archiva.policies.DownloadErrorPolicy"
+     */
+    private Map<String, DownloadErrorPolicy> downloadErrorPolicies;
+
+    /**
+     * @plexus.requirement role-hint="default"
      */
     private UrlFailureCache urlFailureCache;
 
@@ -136,26 +145,31 @@
      * @param artifact   the artifact reference to fetch.
      * @return the local file in the managed repository that was fetched, or null if the artifact was not (or
      *         could not be) fetched.
-     * @throws ProxyException if there was a problem fetching the artifact.
+     * @throws PolicyViolationException if there was a problem fetching the artifact.
      */
     public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
+        throws ProxyDownloadException
     {
         File localFile = toLocalFile( repository, artifact );
 
         Properties requestProperties = new Properties();
         requestProperties.setProperty( "filetype", "artifact" );
         requestProperties.setProperty( "version", artifact.getVersion() );
+        requestProperties.setProperty( "managedRepositoryId", repository.getId() );
 
         List<ProxyConnector> connectors = getProxyConnectors( repository );
+        Map<String, Exception> previousExceptions = new LinkedHashMap<String, Exception>();
         for ( ProxyConnector connector : connectors )
         {
             RemoteRepositoryContent targetRepository = connector.getTargetRepository();
+            requestProperties.setProperty( "remoteRepositoryId", targetRepository.getId() );
+
             String targetPath = targetRepository.toPath( artifact );
 
             try
             {
-                File downloadedFile = transferFile( connector, targetRepository, targetPath, localFile,
-                                                    requestProperties );
+                File downloadedFile =
+                    transferFile( connector, targetRepository, targetPath, localFile, requestProperties );
 
                 if ( fileExists( downloadedFile ) )
                 {
@@ -175,12 +189,17 @@
             }
             catch ( ProxyException e )
             {
-                log.warn( "Transfer error from repository \"" + targetRepository.getRepository().getId() +
-                    "\" for artifact " + Keys.toKey( artifact ) + ", continuing to next repository. Error message: " +
-                    e.getMessage() );
-                log.debug( "Full stack trace", e );
+                validatePolicies( this.downloadErrorPolicies, connector.getPolicies(), requestProperties, artifact,
+                                  targetRepository, localFile, e, previousExceptions );
             }
         }
+
+        if ( !previousExceptions.isEmpty() )
+        {
+            throw new ProxyDownloadException( "Failures occurred downloading from some remote repositories",
+                                              previousExceptions );
+        }
+
         log.debug( "Exhausted all target repositories, artifact " + Keys.toKey( artifact ) + " not found." );
 
         return null;
@@ -471,10 +490,10 @@
      * @param localFile         the local file to place the downloaded resource into
      * @param requestProperties the request properties to utilize for policy handling.
      * @return the local file that was downloaded, or null if not downloaded.
-     * @throws NotFoundException if the file was not found on the remote repository.
+     * @throws NotFoundException    if the file was not found on the remote repository.
      * @throws NotModifiedException if the localFile was present, and the resource was present on remote repository,
      *                              but the remote resource is not newer than the local File.
-     * @throws ProxyException if transfer was unsuccessful.
+     * @throws ProxyException       if transfer was unsuccessful.
      */
     private File transferFile( ProxyConnector connector, RemoteRepositoryContent remoteRepository, String remotePath,
                                File localFile, Properties requestProperties )
@@ -696,8 +715,8 @@
                 success = wagon.getIfNewer( remotePath, temp, localFile.lastModified() );
                 if ( !success )
                 {
-                    throw new NotModifiedException( "Not downloaded, as local file is newer than remote side: "
-                                                    + localFile.getAbsolutePath() );
+                    throw new NotModifiedException(
+                        "Not downloaded, as local file is newer than remote side: " + localFile.getAbsolutePath() );
                 }
 
                 if ( temp.exists() )
@@ -711,13 +730,15 @@
         }
         catch ( ResourceDoesNotExistException e )
         {
-            throw new NotFoundException( "Resource [" + remoteRepository.getURL() + "/" + remotePath
-                + "] does not exist: " + e.getMessage(), e );
+            throw new NotFoundException(
+                "Resource [" + remoteRepository.getURL() + "/" + remotePath + "] does not exist: " + e.getMessage(),
+                e );
         }
         catch ( WagonException e )
         {
-            throw new ProxyException( "Download failure on resource [" + remoteRepository.getURL() + "/" + remotePath + "]:"
-                                  + e.getMessage(), e );
+            throw new ProxyException(
+                "Download failure on resource [" + remoteRepository.getURL() + "/" + remotePath + "]:" + e.getMessage(),
+                e );
         }
         finally
         {
@@ -742,10 +763,10 @@
     {
         for ( Entry<String, ? extends DownloadPolicy> entry : policies.entrySet() )
         {
-            String key = (String) entry.getKey();
+            String key = entry.getKey();
             DownloadPolicy policy = entry.getValue();
             String defaultSetting = policy.getDefaultOption();
-            String setting = StringUtils.defaultString( (String) settings.get( key ), defaultSetting );
+            String setting = StringUtils.defaultString( settings.get( key ), defaultSetting );
 
             log.debug( "Applying [" + key + "] policy with [" + setting + "]" );
             try
@@ -759,6 +780,56 @@
         }
     }
 
+    private void validatePolicies( Map<String, DownloadErrorPolicy> policies, Map<String, String> settings,
+                                   Properties request, ArtifactReference artifact, RemoteRepositoryContent content,
+                                   File localFile, ProxyException exception, Map<String, Exception> previousExceptions )
+        throws ProxyDownloadException
+    {
+        boolean process = true;
+        for ( Entry<String, ? extends DownloadErrorPolicy> entry : policies.entrySet() )
+        {
+            String key = entry.getKey();
+            DownloadErrorPolicy policy = entry.getValue();
+            String defaultSetting = policy.getDefaultOption();
+            String setting = StringUtils.defaultString( settings.get( key ), defaultSetting );
+
+            log.debug( "Applying [" + key + "] policy with [" + setting + "]" );
+            try
+            {
+                // all policies must approve the exception, any can cancel
+                process = policy.applyPolicy( setting, request, localFile, exception, previousExceptions );
+                if ( !process )
+                {
+                    break;
+                }
+            }
+            catch ( PolicyConfigurationException e )
+            {
+                log.error( e.getMessage(), e );
+            }
+        }
+
+        if ( process )
+        {
+            // if the exception was queued, don't throw it
+            if ( !previousExceptions.containsKey( content.getId() ) )
+            {
+                throw new ProxyDownloadException(
+                    "An error occurred in downloading from the remote repository, and the policy is to fail immediately",
+                    content.getId(), exception );
+            }
+        }
+        else
+        {
+            // if the exception was queued, but cancelled, remove it
+            previousExceptions.remove( content.getId() );
+        }
+
+        log.warn( "Transfer error from repository \"" + content.getRepository().getId() + "\" for artifact " +
+            Keys.toKey( artifact ) + ", continuing to next repository. Error message: " + exception.getMessage() );
+        log.debug( "Full stack trace", exception );
+    }
+
     /**
      * Used to move the temporary file to its real destination.  This is patterned from the way WagonManager handles
      * its downloaded files.
@@ -802,7 +873,8 @@
      * @param remoteRepository the remote repository to connect to.
      * @return true if the connection was successful. false if not connected.
      */
-    private boolean connectToRepository( ProxyConnector connector, Wagon wagon, RemoteRepositoryContent remoteRepository )
+    private boolean connectToRepository( ProxyConnector connector, Wagon wagon,
+                                         RemoteRepositoryContent remoteRepository )
     {
         boolean connected = false;
 
@@ -851,15 +923,13 @@
         catch ( ConnectionException e )
         {
             log.warn(
-                              "Could not connect to " + remoteRepository.getRepository().getName() + ": "
-                                  + e.getMessage() );
+                "Could not connect to " + remoteRepository.getRepository().getName() + ": " + e.getMessage() );
             connected = false;
         }
         catch ( AuthenticationException e )
         {
             log.warn(
-                              "Could not connect to " + remoteRepository.getRepository().getName() + ": "
-                                  + e.getMessage() );
+                "Could not connect to " + remoteRepository.getRepository().getName() + ": " + e.getMessage() );
             connected = false;
         }
 
@@ -911,10 +981,10 @@
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
     {
-        if ( ConfigurationNames.isNetworkProxy( propertyName )
-            || ConfigurationNames.isManagedRepositories( propertyName )
-            || ConfigurationNames.isRemoteRepositories( propertyName )
-            || ConfigurationNames.isProxyConnector( propertyName ) )
+        if ( ConfigurationNames.isNetworkProxy( propertyName ) ||
+            ConfigurationNames.isManagedRepositories( propertyName ) ||
+            ConfigurationNames.isRemoteRepositories( propertyName ) ||
+            ConfigurationNames.isProxyConnector( propertyName ) )
         {
             initConnectorsAndNetworkProxies();
         }

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/RepositoryProxyConnectors.java Thu Apr  3 05:03:54 2008
@@ -22,6 +22,7 @@
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.policies.ProxyDownloadException;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
 
 import java.io.File;
@@ -45,11 +46,11 @@
      * @param repository the source repository to use. (must be a managed repository)
      * @param artifact the artifact to fetch.
      * @return true if the fetch operation succeeded in obtaining content, false if no content was obtained.
-     * @throws ProxyException if there was a problem fetching the content from the target repositories.
+     * @throws ProxyDownloadException if there was a problem fetching the content from the target repositories.
      */
     public File fetchFromProxies( ManagedRepositoryContent repository, ArtifactReference artifact )
-        throws ProxyException;
-    
+        throws ProxyDownloadException;
+
     /**
      * Performs the metadata fetch operation against the target repositories
      * of the provided source repository.
@@ -60,11 +61,9 @@
      * @param repository the source repository to use. (must be a managed repository)
      * @param metadata the metadata to fetch.
      * @return true if the fetch operation succeeded in obtaining content, false if no content was obtained.
-     * @throws ProxyException if there was a problem fetching the content from the target repositories.
      */
-    public File fetchFromProxies( ManagedRepositoryContent repository, VersionedReference metadata )
-        throws ProxyException;
-    
+    public File fetchFromProxies( ManagedRepositoryContent repository, VersionedReference metadata );
+
     /**
      * Performs the metadata fetch operation against the target repositories
      * of the provided source repository.
@@ -75,10 +74,8 @@
      * @param repository the source repository to use. (must be a managed repository)
      * @param metadata the metadata to fetch.
      * @return true if the fetch operation succeeded in obtaining content, false if no content was obtained.
-     * @throws ProxyException if there was a problem fetching the content from the target repositories.
      */
-    public File fetchFromProxies( ManagedRepositoryContent repository, ProjectReference metadata )
-        throws ProxyException;
+    public File fetchFromProxies( ManagedRepositoryContent repository, ProjectReference metadata );
 
     /**
      * Get the List of {@link ProxyConnector} objects of the source repository.

Modified: archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java (original)
+++ archiva/trunk/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java Thu Apr  3 05:03:54 2008
@@ -37,6 +37,8 @@
 import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
 import org.apache.maven.archiva.policies.CachedFailuresPolicy;
 import org.apache.maven.archiva.policies.ChecksumPolicy;
+import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy;
+import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
 import org.apache.maven.archiva.policies.ReleasesPolicy;
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
@@ -295,8 +297,23 @@
                        SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
     }
 
-    protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy,
-                                  String releasePolicy, String snapshotPolicy, String cacheFailuresPolicy )
+    protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
+                                  String snapshotPolicy, String cacheFailuresPolicy )
+    {
+        saveConnector( sourceRepoId, targetRepoId, checksumPolicy, releasePolicy, snapshotPolicy, cacheFailuresPolicy,
+                       PropagateErrorsDownloadPolicy.QUEUE );
+    }
+
+    protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
+                                  String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy )
+    {
+        saveConnector( sourceRepoId, targetRepoId, checksumPolicy, releasePolicy, snapshotPolicy, cacheFailuresPolicy,
+                       errorPolicy, PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT );
+    }
+
+    protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
+                                  String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy,
+                                  String errorOnUpdatePolicy )
     {
         ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
         connectorConfig.setSourceRepoId( sourceRepoId );
@@ -305,6 +322,8 @@
         connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, releasePolicy );
         connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, snapshotPolicy );
         connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, cacheFailuresPolicy );
+        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS, errorPolicy );
+        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS_ON_UPDATE, errorOnUpdatePolicy );
 
         int count = config.getConfiguration().getProxyConnectors().size();
         config.getConfiguration().addProxyConnector( connectorConfig );
@@ -318,6 +337,10 @@
         config.triggerChange( prefix + ".policies.checksum", connectorConfig.getPolicy( "checksum", "" ) );
         config.triggerChange( prefix + ".policies.snapshots", connectorConfig.getPolicy( "snapshots", "" ) );
         config.triggerChange( prefix + ".policies.cache-failures", connectorConfig.getPolicy( "cache-failures", "" ) );
+        config.triggerChange( prefix + ".policies.propagate-errors",
+                              connectorConfig.getPolicy( "propagate-errors", "" ) );
+        config.triggerChange( prefix + ".policies.propagate-errors-on-update",
+                              connectorConfig.getPolicy( "propagate-errors-on-update", "" ) );
     }
 
     protected void saveManagedRepositoryConfig( String id, String name, String path, String layout )

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AbstractProxyConnectorFormAction.java Thu Apr  3 05:03:54 2008
@@ -22,7 +22,8 @@
 import com.opensymphony.xwork.Preparable;
 import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
-import org.apache.maven.archiva.policies.DownloadPolicy;
+import org.apache.maven.archiva.policies.DownloadErrorPolicy;
+import org.apache.maven.archiva.policies.Policy;
 import org.apache.maven.archiva.policies.PostDownloadPolicy;
 import org.apache.maven.archiva.policies.PreDownloadPolicy;
 
@@ -55,6 +56,11 @@
     private Map<String, PostDownloadPolicy> postDownloadPolicyMap;
 
     /**
+     * @plexus.requirement role="org.apache.maven.archiva.policies.DownloadErrorPolicy"
+     */
+    private Map<String, DownloadErrorPolicy> downloadErrorPolicyMap;
+
+    /**
      * The list of network proxy ids that are available.
      */
     private List<String> proxyIdOptions;
@@ -72,7 +78,7 @@
     /**
      * The map of policies that are available to be set.
      */
-    private Map<String, DownloadPolicy> policyMap;
+    private Map<String, Policy> policyMap;
 
     /**
      * The property key to add or remove.
@@ -185,7 +191,7 @@
         return pattern;
     }
 
-    public Map<String, DownloadPolicy> getPolicyMap()
+    public Map<String, Policy> getPolicyMap()
     {
         return policyMap;
     }
@@ -318,7 +324,7 @@
         this.pattern = pattern;
     }
 
-    public void setPolicyMap( Map<String, DownloadPolicy> policyMap )
+    public void setPolicyMap( Map<String, Policy> policyMap )
     {
         this.policyMap = policyMap;
     }
@@ -363,12 +369,13 @@
         return options;
     }
 
-    protected Map<String, DownloadPolicy> createPolicyMap()
+    protected Map<String, Policy> createPolicyMap()
     {
-        Map<String, DownloadPolicy> policyMap = new HashMap<String, DownloadPolicy>();
+        Map<String, Policy> policyMap = new HashMap<String, Policy>();
 
         policyMap.putAll( preDownloadPolicyMap );
         policyMap.putAll( postDownloadPolicyMap );
+        policyMap.putAll( downloadErrorPolicyMap );
 
         return policyMap;
     }
@@ -387,10 +394,10 @@
         else
         {
             // Validate / Fix policy settings arriving from browser.
-            for ( Map.Entry<String, DownloadPolicy> entry : getPolicyMap().entrySet() )
+            for ( Map.Entry<String, Policy> entry : getPolicyMap().entrySet() )
             {
-                String policyId = (String) entry.getKey();
-                DownloadPolicy policy = (DownloadPolicy) entry.getValue();
+                String policyId = entry.getKey();
+                Policy policy = entry.getValue();
                 List<String> options = policy.getOptions();
 
                 if ( !connector.getPolicies().containsKey( policyId ) )

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/repository/ProxiedDavServer.java Thu Apr  3 05:03:54 2008
@@ -23,7 +23,7 @@
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
-import org.apache.maven.archiva.proxy.ProxyException;
+import org.apache.maven.archiva.policies.ProxyDownloadException;
 import org.apache.maven.archiva.proxy.RepositoryProxyConnectors;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
 import org.apache.maven.archiva.repository.RepositoryContentFactory;
@@ -364,7 +364,7 @@
         {
             /* eat it */
         }
-        catch ( ProxyException e )
+        catch ( ProxyDownloadException e )
         {
             throw new ServletException( "Unable to fetch artifact resource.", e );
         }
@@ -391,10 +391,6 @@
         {
             /* eat it */
         }
-        catch ( ProxyException e )
-        {
-            throw new ServletException( "Unable to fetch versioned metadata resource.", e );
-        }
 
         try
         {
@@ -409,10 +405,6 @@
         {
             /* eat it */
         }
-        catch ( ProxyException e )
-        {
-            throw new ServletException( "Unable to fetch project metadata resource.", e );
-        }
 
         return false;
     }
@@ -428,7 +420,7 @@
      * artifact.
      */
     protected void applyServerSideRelocation( ArtifactReference artifact )
-        throws ProxyException
+        throws ProxyDownloadException
     {
         if ( "pom".equals( artifact.getType() ) )
         {

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/proxyConnectorForm.jspf Thu Apr  3 05:03:54 2008
@@ -42,7 +42,7 @@
         <tr>
           <td>
             <ww:label for="policy_${policy.key}" required="true"
-                      theme="simple">${policy.key}:
+                      theme="simple">${policy.value.name}:
             </ww:label>
           </td>
           <td>

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java Thu Apr  3 05:03:54 2008
@@ -28,6 +28,8 @@
 import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
 import org.apache.maven.archiva.policies.CachedFailuresPolicy;
 import org.apache.maven.archiva.policies.ChecksumPolicy;
+import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy;
+import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
 import org.apache.maven.archiva.policies.ReleasesPolicy;
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
 import org.apache.maven.archiva.web.action.AbstractWebworkTestCase;
@@ -36,6 +38,7 @@
 import org.easymock.MockControl;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * AddProxyConnectorActionTest 
@@ -390,10 +393,13 @@
         connector.setTargetRepoId( "central" );
 
         // TODO: Set these options programatically via list of available policies.
-        connector.getPolicies().put( "releases", new ReleasesPolicy().getDefaultOption() );
-        connector.getPolicies().put( "snapshots", new SnapshotsPolicy().getDefaultOption() );
-        connector.getPolicies().put( "checksum", new ChecksumPolicy().getDefaultOption() );
-        connector.getPolicies().put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() );
+        Map<String, String> policies = connector.getPolicies();
+        policies.put( "releases", new ReleasesPolicy().getDefaultOption() );
+        policies.put( "snapshots", new SnapshotsPolicy().getDefaultOption() );
+        policies.put( "checksum", new ChecksumPolicy().getDefaultOption() );
+        policies.put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() );
+        policies.put( "propagate-errors", new PropagateErrorsDownloadPolicy().getDefaultOption() );
+        policies.put( "propagate-errors-on-update", new PropagateErrorsOnUpdateDownloadPolicy().getDefaultOption() );
     }
 
     @Override

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java?rev=644276&r1=644275&r2=644276&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java (original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java Thu Apr  3 05:03:54 2008
@@ -28,6 +28,8 @@
 import org.apache.maven.archiva.configuration.RemoteRepositoryConfiguration;
 import org.apache.maven.archiva.policies.CachedFailuresPolicy;
 import org.apache.maven.archiva.policies.ChecksumPolicy;
+import org.apache.maven.archiva.policies.PropagateErrorsDownloadPolicy;
+import org.apache.maven.archiva.policies.PropagateErrorsOnUpdateDownloadPolicy;
 import org.apache.maven.archiva.policies.ReleasesPolicy;
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
 import org.apache.maven.archiva.web.action.AbstractWebworkTestCase;
@@ -36,6 +38,7 @@
 import org.easymock.MockControl;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * EditProxyConnectorActionTest 
@@ -395,10 +398,13 @@
         connector.setTargetRepoId( TEST_TARGET_ID );
         
         // TODO: Set these options programatically via list of available policies.
-        connector.getPolicies().put( "releases", new ReleasesPolicy().getDefaultOption() );
-        connector.getPolicies().put( "snapshots", new SnapshotsPolicy().getDefaultOption() );
-        connector.getPolicies().put( "checksum", new ChecksumPolicy().getDefaultOption() );
-        connector.getPolicies().put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() );
+        Map<String, String> policies = connector.getPolicies();
+        policies.put( "releases", new ReleasesPolicy().getDefaultOption() );
+        policies.put( "snapshots", new SnapshotsPolicy().getDefaultOption() );
+        policies.put( "checksum", new ChecksumPolicy().getDefaultOption() );
+        policies.put( "cache-failures", new CachedFailuresPolicy().getDefaultOption() );
+        policies.put( "propagate-errors", new PropagateErrorsDownloadPolicy().getDefaultOption() );
+        policies.put( "propagate-errors-on-update", new PropagateErrorsOnUpdateDownloadPolicy().getDefaultOption() );
 
         config.addProxyConnector( connector );
 



Mime
View raw message