]> source.dussan.org Git - archiva.git/commitdiff
[MRM-547] proxy connectors: cache failures options are confusing
authorJoakim Erdfelt <joakime@apache.org>
Thu, 1 Nov 2007 06:21:26 +0000 (06:21 +0000)
committerJoakim Erdfelt <joakime@apache.org>
Thu, 1 Nov 2007 06:21:26 +0000 (06:21 +0000)
[MRM-549] proxy connectors: no "always" option for releases and snapshots policies
Applying changes to policy naming per decisions made in dev@archiva mailing list.
Updating DefaultArchivaConfiguration.load() to automatically adjust old configuration settings to new values.

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@590908 13f79535-47bb-0310-9956-ffa450edef68

41 files changed:
archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/DefaultArchivaConfiguration.java
archiva-base/archiva-configuration/src/main/java/org/apache/maven/archiva/configuration/MavenProxyPropertyLoader.java
archiva-base/archiva-configuration/src/test/resources/org/apache/maven/archiva/configuration/ArchivaConfigurationTest.xml
archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.xml
archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveArtifactConsumerTest.xml
archiva-base/archiva-consumers/archiva-database-consumers/src/test/resources/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumerTest.xml
archiva-base/archiva-consumers/archiva-lucene-consumers/src/test/resources/org/apache/maven/archiva/consumers/lucene/LuceneCleanupRemoveIndexedConsumerTest.xml
archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/AbstractUpdatePolicy.java
archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/CachedFailuresPolicy.java
archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ChecksumPolicy.java
archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/DownloadPolicy.java
archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/ReleasesPolicy.java
archiva-base/archiva-policies/src/main/java/org/apache/maven/archiva/policies/SnapshotsPolicy.java
archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/CachedFailuresPolicyTest.java
archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ChecksumPolicyTest.java
archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/ReleasePolicyTest.java
archiva-base/archiva-policies/src/test/java/org/apache/maven/archiva/policies/SnapshotsPolicyTest.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java
archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/metadata/MetadataToolsTest.java
archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/content/RepositoryRequestTest.xml
archiva-base/archiva-repository-layer/src/test/resources/org/apache/maven/archiva/repository/scanner/RepositoryContentConsumersTest.xml
archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseConsumersTest.xml
archiva-database/src/test/resources/org/apache/maven/archiva/database/updater/DatabaseUpdaterTest.xml
archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaDatabaseUpdateTaskExecutorTest.xml
archiva-scheduled/src/test/resources/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutorTest.xml
archiva-web/archiva-webapp/pom.xml
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/AddProxyConnectorActionTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/EditProxyConnectorActionTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/AbstractRepositoryServletProxiedTestCase.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletProxiedPluginSnapshotPolicyTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletProxiedReleasePolicyTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletProxiedSnapshotPolicyTest.java
archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/repository/RepositoryServletProxiedTimestampedSnapshotPolicyTest.java
archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/repository/RepositoryServletSecurityTest.xml
archiva-web/archiva-webapp/src/test/resources/org/apache/maven/archiva/web/repository/RepositoryServletTest.xml

index 4ea3450169257d2063915a3fc5238a16cd4fedba..52701830cd37f39035e613f6716884a7cc0b6a63 100644 (file)
@@ -19,10 +19,18 @@ package org.apache.maven.archiva.configuration;
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.collections.MapUtils;
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.functors.ProxyConnectorConfigurationOrderComparator;
 import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryReader;
 import org.apache.maven.archiva.configuration.io.registry.ConfigurationRegistryWriter;
+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.PostDownloadPolicy;
+import org.apache.maven.archiva.policies.PreDownloadPolicy;
 import org.codehaus.plexus.evaluator.DefaultExpressionEvaluator;
 import org.codehaus.plexus.evaluator.EvaluatorException;
 import org.codehaus.plexus.evaluator.ExpressionEvaluator;
@@ -37,13 +45,16 @@ import org.codehaus.plexus.util.StringUtils;
 
 import java.io.File;
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Map.Entry;
 
 /**
  * <p>
@@ -87,8 +98,16 @@ public class DefaultArchivaConfiguration
      */
     private Configuration configuration;
 
-    private static final String KEY = "org.apache.maven.archiva";
+    /**
+     * @plexus.requirement role="org.apache.maven.archiva.policies.PreDownloadPolicy"
+     */
+    private Map<String, PreDownloadPolicy> prePolicies;
 
+    /**
+     * @plexus.requirement role="org.apache.maven.archiva.policies.PostDownloadPolicy"
+     */
+    private Map<String, PostDownloadPolicy> postPolicies;
+    
     /**
      * @plexus.configuration default-value="${user.home}/.m2/archiva.xml"
      */
@@ -115,6 +134,8 @@ public class DefaultArchivaConfiguration
      */
     private boolean isConfigurationDefaulted = false;
 
+    private static final String KEY = "org.apache.maven.archiva";
+
     public synchronized Configuration getConfiguration()
     {
         if ( configuration == null )
@@ -176,9 +197,89 @@ public class DefaultArchivaConfiguration
             registry.removeSubset( KEY + ".repositories" );
         }
 
-        // Normalize the order fields in the proxy connectors.
         if ( !config.getProxyConnectors().isEmpty() )
         {
+            // Fix Proxy Connector Settings.
+
+            List<ProxyConnectorConfiguration> proxyConnectorList = new ArrayList<ProxyConnectorConfiguration>();
+            // Create a copy of the list to read from (to prevent concurrent modification exceptions)
+            proxyConnectorList.addAll( config.getProxyConnectors() );
+            // Remove the old connector list.
+            config.getProxyConnectors().clear();
+
+            for ( ProxyConnectorConfiguration connector : proxyConnectorList )
+            {
+                // Fix policies
+                boolean connectorValid = true;
+
+                Map<String, String> policies = new HashMap<String, String>();
+                // Make copy of policies
+                policies.putAll( connector.getPolicies() );
+                // Clear out policies
+                connector.getPolicies().clear();
+
+                // Work thru policies. cleaning them up.
+                for ( Entry<String, String> entry : policies.entrySet() )
+                {
+                    String policyId = entry.getKey();
+                    String setting = entry.getValue();
+
+                    // Upgrade old policy settings.
+                    if ( "releases".equals( policyId ) || "snapshots".equals( policyId ) )
+                    {
+                        if ( "ignored".equals( setting ) )
+                        {
+                            setting = AbstractUpdatePolicy.ALWAYS;
+                        }
+                        else if ( "disabled".equals( setting ) )
+                        {
+                            setting = AbstractUpdatePolicy.NEVER;
+                        }
+                    }
+                    else if ( "cache-failures".equals( policyId ) )
+                    {
+                        if ( "ignored".equals( setting ) )
+                        {
+                            setting = CachedFailuresPolicy.NO;
+                        }
+                        else if ( "cached".equals( setting ) )
+                        {
+                            setting = CachedFailuresPolicy.YES;
+                        }
+                    }
+                    else if ( "checksum".equals( policyId ) )
+                    {
+                        if ( "ignored".equals( setting ) )
+                        {
+                            setting = ChecksumPolicy.IGNORE;
+                        }
+                    }
+
+                    // Validate existance of policy key.
+                    if ( policyExists( policyId ) )
+                    {
+                        DownloadPolicy policy = findPolicy( policyId );
+                        // Does option exist?
+                        if ( !policy.getOptions().contains( setting ) )
+                        {
+                            setting = policy.getDefaultOption();
+                        }
+                        connector.addPolicy( policyId, setting );
+                    }
+                    else
+                    {
+                        // Policy key doesn't exist. Don't add it to golden version.
+                        getLogger().warn( "Policy [" + policyId + "] does not exist." );
+                    }
+                }
+
+                if ( connectorValid )
+                {
+                    config.addProxyConnector( connector );
+                }
+            }
+
+            // Normalize the order fields in the proxy connectors.
             Map<String, java.util.List<ProxyConnectorConfiguration>> proxyConnectorMap = config
                 .getProxyConnectorAsMap();
 
@@ -200,6 +301,54 @@ public class DefaultArchivaConfiguration
         return config;
     }
 
+    private DownloadPolicy findPolicy( String policyId )
+    {
+        if ( MapUtils.isEmpty( prePolicies ) )
+        {
+            getLogger().error( "No PreDownloadPolicies found!" );
+            return null;
+        }
+
+        if ( MapUtils.isEmpty( postPolicies ) )
+        {
+            getLogger().error( "No PostDownloadPolicies found!" );
+            return null;
+        }
+
+        DownloadPolicy policy;
+
+        policy = prePolicies.get( policyId );
+        if ( policy != null )
+        {
+            return policy;
+        }
+
+        policy = postPolicies.get( policyId );
+        if ( policy != null )
+        {
+            return policy;
+        }
+
+        return null;
+    }
+
+    private boolean policyExists( String policyId )
+    {
+        if ( MapUtils.isEmpty( prePolicies ) )
+        {
+            getLogger().error( "No PreDownloadPolicies found!" );
+            return false;
+        }
+        
+        if ( MapUtils.isEmpty( postPolicies ) )
+        {
+            getLogger().error( "No PostDownloadPolicies found!" );
+            return false;
+        }
+        
+        return ( prePolicies.containsKey( policyId ) || postPolicies.containsKey( policyId ) );
+    }
+
     private Registry readDefaultConfiguration()
     {
         // if it contains some old configuration, remove it (Archiva 0.9)
@@ -288,7 +437,7 @@ public class DefaultArchivaConfiguration
     {
         // TODO: may not be needed under commons-configuration 1.4 - check
         // UPDATE: Upgrading to commons-configuration 1.4 breaks half the unit tests. 2007-10-11 (joakime)
-        
+
         String contents = "<configuration />";
         if ( !writeFile( "user configuration", userConfigFilename, contents ) )
         {
index 33fdb51b36e7cee40d4798d68427b9d1ca12c216..e48b2d39a6fd10f6b32f18406e0a5f5bcb3fb1f5 100644 (file)
@@ -107,7 +107,7 @@ public class MavenProxyPropertyLoader
             proxyConnector.setProxyId( proxyKey );
             // TODO: convert cachePeriod to closest "daily" or "hourly"
             proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.DAILY );
-            proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.IGNORED );
+            proxyConnector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS );
 
             configuration.addProxyConnector( proxyConnector );
         }
index b0ca9d638440b8b6298c1a7891aa3cdff96bc74d..abd8baae567f0132993aaf2515d5cce8957cd55e 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>empty</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>upgrade-09</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>autodetect-v1</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>archiva-v1</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>save</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>save-user</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
       <configuration>
         <userConfigFilename>${basedir}/target/test/test-file-user.xml</userConfigFilename>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configuration-both</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>read-saved</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
       <configuration>
         <userConfigFilename>${basedir}/target/test/test-file.xml</userConfigFilename>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>cron-expressions</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
       <configuration>
         <userConfigFilename>${basedir}/target/test/test-file.xml</userConfigFilename>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>not-allowed-to-write-to-both</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
       <configuration>
         <user-config-filename>${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml</user-config-filename>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>not-allowed-to-write-to-user</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
       <configuration>
         <user-config-filename>${basedir}/target/*intentionally:invalid*/.m2/archiva-user.xml</user-config-filename>
         </properties>
       </configuration>
     </component>
-    
+
+    <component>
+      <role>org.codehaus.plexus.cache.Cache</role>
+      <role-hint>url-failures-cache</role-hint>
+      <implementation>org.codehaus.plexus.cache.ehcache.EhcacheCache</implementation>
+      <description>URL Failure Cache</description>
+      <configuration>
+        <disk-expiry-thread-interval-seconds>600</disk-expiry-thread-interval-seconds>
+        <disk-persistent>false</disk-persistent>
+        <eternal>false</eternal>
+        <max-elements-in-memory>1000</max-elements-in-memory>
+        <memory-eviction-policy>LRU</memory-eviction-policy>
+        <name>cache</name>
+        <overflow-to-disk>false</overflow-to-disk>
+        <!-- 45 minutes = 2700 seconds -->
+        <time-to-idle-seconds>2700</time-to-idle-seconds>
+        <!-- 30 minutes = 1800 seconds  -->
+        <time-to-live-seconds>1800</time-to-live-seconds>
+      </configuration>
+    </component>    
   </components>
 </component-set>
index e5675fb12cbbc2834656f95efcbfd5b946dafd1c..8ccdc3b44488c93dbff47e8ddf882b0ffa5bee05 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>retention-count</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>days-old</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index 712381c1c0570a3fea1e0728aca146e3ae82436d..2c0dd53e16a0041c71ffa9bc79c233023c6c631a 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>database-cleanup</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
@@ -54,4 +62,4 @@
       </requirements>
     </component>
   </components>
-</component-set>
\ No newline at end of file
+</component-set>
index 712381c1c0570a3fea1e0728aca146e3ae82436d..2c0dd53e16a0041c71ffa9bc79c233023c6c631a 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>database-cleanup</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
@@ -54,4 +62,4 @@
       </requirements>
     </component>
   </components>
-</component-set>
\ No newline at end of file
+</component-set>
index 99a7a2d9fc4c0ebbf82f0bd9ebddcc7a6d2d21d1..0c096a7c08316ca8eaa9f3c3e73bc06c5a0b748f 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>lucene-cleanup</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index 536bda9de808d44e3fb8ae42ee4077c6f4a8ef4b..3f099e657a289cff441e4a400f841904242f3558 100644 (file)
@@ -40,10 +40,14 @@ public abstract class AbstractUpdatePolicy
     implements PreDownloadPolicy
 {
     /**
-     * The DISABLED policy means that the artifact retrieval isn't even attempted,
-     * let alone updated locally.
+     * The ALWAYS policy setting means that the artifact is always uipdated from the remote repo.
      */
-    public static final String DISABLED = "disabled";
+    public static final String ALWAYS = "always";
+    
+    /**
+     * The NEVER policy setting means that the artifact is never updated from the remote repo.
+     */
+    public static final String NEVER = "never";
 
     /**
      * <p>
@@ -80,11 +84,11 @@ public abstract class AbstractUpdatePolicy
 
     public AbstractUpdatePolicy()
     {
-        options.add( IGNORED );
-        options.add( DISABLED );
-        options.add( DAILY );
+        options.add( ALWAYS );
         options.add( HOURLY );
+        options.add( DAILY );
         options.add( ONCE );
+        options.add( NEVER );
     }
 
     protected abstract boolean isSnapshotPolicy();
@@ -120,10 +124,10 @@ public abstract class AbstractUpdatePolicy
                 + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" );
         }
 
-        if ( IGNORED.equals( policySetting ) )
+        if ( ALWAYS.equals( policySetting ) )
         {
-            // Ignored means ok to update.
-            getLogger().debug( "OK to update, " + getUpdateMode() + " policy set to IGNORED." );
+            // Skip means ok to update.
+            getLogger().debug( "OK to update, " + getUpdateMode() + " policy set to ALWAYS." );
             return;
         }
 
@@ -140,10 +144,10 @@ public abstract class AbstractUpdatePolicy
             return;
         }
 
-        if ( DISABLED.equals( policySetting ) )
+        if ( NEVER.equals( policySetting ) )
         {
-            // Disabled means no.
-            throw new PolicyViolationException( "NO to update, " + getUpdateMode() + " policy set to DISABLED." );
+            // Reject means no.
+            throw new PolicyViolationException( "NO to update, " + getUpdateMode() + " policy set to NEVER." );
         }
 
         if ( !localFile.exists() )
index 46a0f3252433f7345b132743608f6103e6836108..c7d44258c09a616bcf6f7c23c2d50276512191d2 100644 (file)
@@ -41,11 +41,16 @@ public class CachedFailuresPolicy
     implements PreDownloadPolicy
 {
     /**
-     * The CACHED policy indicates that if the URL provided exists in the
-     * cached failures pool, then the policy fails, and the download isn't even
-     * attempted.
+     * The NO policy setting means that the the existence of old failures is <strong>not</strong> checked.
+     * All resource requests are allowed thru to the remote repo.
      */
-    public static final String CACHED = "cached";
+    public static final String NO = "no";
+    
+    /**
+     * The YES policy setting means that the existence of old failures is checked, and will
+     * prevent the request from being performed against the remote repo.
+     */
+    public static final String YES = "yes";
 
     /**
      * @plexus.requirement role-hint="default"
@@ -56,8 +61,8 @@ public class CachedFailuresPolicy
 
     public CachedFailuresPolicy()
     {
-        options.add( IGNORED );
-        options.add( CACHED );
+        options.add( NO );
+        options.add( YES );
     }
 
     public void applyPolicy( String policySetting, Properties request, File localFile )
@@ -70,10 +75,10 @@ public class CachedFailuresPolicy
                 + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" );
         }
 
-        if ( IGNORED.equals( policySetting ) )
+        if ( NO.equals( policySetting ) )
         {
-            // Ignore.
-            getLogger().debug( "OK to fetch, check-failures policy set to IGNORED." );
+            // Skip.
+            getLogger().debug( "OK to fetch, check-failures policy set to NO." );
             return;
         }
 
@@ -92,7 +97,7 @@ public class CachedFailuresPolicy
 
     public String getDefaultOption()
     {
-        return IGNORED;
+        return NO;
     }
 
     public String getId()
index 2f80d5aa51d6ca0e88ff98ced38c0f43deffadab..c86bbaaeca57ccaff7e8c720301684557d047722 100644 (file)
@@ -42,6 +42,13 @@ public class ChecksumPolicy
     extends AbstractLogEnabled
     implements PostDownloadPolicy
 {
+    /**
+     * The IGNORE policy indicates that if the checksum policy is ignored, and
+     * the state of, contents of, or validity of the checksum files are not
+     * checked.
+     */
+    public static final String IGNORE = "ignore";
+    
     /**
      * The FAIL policy indicates that if the checksum does not match the
      * downloaded file, then remove the downloaded artifact, and checksum
@@ -67,7 +74,7 @@ public class ChecksumPolicy
     {
         options.add( FAIL );
         options.add( FIX );
-        options.add( IGNORED );
+        options.add( IGNORE );
     }
 
     public void applyPolicy( String policySetting, Properties request, File localFile )
@@ -80,9 +87,10 @@ public class ChecksumPolicy
                 + "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" );
         }
 
-        if ( IGNORED.equals( policySetting ) )
+        if ( IGNORE.equals( policySetting ) )
         {
             // Ignore.
+            getLogger().debug( "Checksum policy set to IGNORE." );
             return;
         }
 
@@ -123,6 +131,7 @@ public class ChecksumPolicy
         {
             if( checksums.update( localFile ) )
             {
+                getLogger().debug( "Checksum policy set to FIX, checksum files have been updated." );
                 return;
             }
             else
index e9ff753196c4e3f1c67d0808718c9c6ba10c3d9b..6d506308da67f544438ea5f6139e2aabcae98f3e 100644 (file)
@@ -31,14 +31,6 @@ import java.util.Properties;
  */
 public interface DownloadPolicy
 {
-    /**
-     * The IGNORED policy means that the policy is ignored.
-     */
-    public static final String IGNORED = "ignored";
-    
-    public static final boolean PASS = true;
-    public static final boolean FAIL = false;
-    
     /**
      * Get the list of options for this policy.
      * 
index 724bf7992708cb55cb7cafab94553cfb5a0a433f..8b53461a87242377793ca3d33772ddfdf56345fa 100644 (file)
@@ -33,9 +33,12 @@ public class ReleasesPolicy
     extends AbstractUpdatePolicy
     implements PreDownloadPolicy
 {
+    /**
+     * Defaults to {@link AbstractUpdatePolicy#HOURLY}
+     */
     public String getDefaultOption()
     {
-        return AbstractUpdatePolicy.IGNORED;
+        return AbstractUpdatePolicy.HOURLY;
     }
 
     protected boolean isSnapshotPolicy()
index 62161a101bc414e9793079e6d81cc8cf590ec793..ffa903262f849b8487fcdc5f57660a7a4adacf23 100644 (file)
@@ -33,9 +33,12 @@ public class SnapshotsPolicy
     extends AbstractUpdatePolicy
     implements PreDownloadPolicy
 {
+    /**
+     * Defaults to {@link AbstractUpdatePolicy#HOURLY}
+     */
     public String getDefaultOption()
     {
-        return AbstractUpdatePolicy.IGNORED;
+        return AbstractUpdatePolicy.HOURLY;
     }
 
     protected boolean isSnapshotPolicy()
index 5d70a9db7023b0281836d55c202b4dc7a4f15fd1..61e89ab3ea4e872355a0794a30f50270a95eb4e6 100644 (file)
@@ -58,7 +58,7 @@ public class CachedFailuresPolicyTest
         return request;
     }
 
-    public void testIgnored()
+    public void testPolicyNo()
         throws Exception
     {
         DownloadPolicy policy = lookupPolicy();
@@ -67,10 +67,10 @@ public class CachedFailuresPolicyTest
 
         request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" );
 
-        policy.applyPolicy( CachedFailuresPolicy.IGNORED, request, localFile );
+        policy.applyPolicy( CachedFailuresPolicy.NO, request, localFile );
     }
 
-    public void testCachedNotInCache()
+    public void testPolicyYesNotInCache()
         throws Exception
     {
         DownloadPolicy policy = lookupPolicy();
@@ -79,10 +79,10 @@ public class CachedFailuresPolicyTest
 
         request.setProperty( "url", "http://a.bad.hostname.maven.org/path/to/resource.txt" );
 
-        policy.applyPolicy( CachedFailuresPolicy.CACHED, request, localFile );
+        policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile );
     }
 
-    public void testCachedInCache()
+    public void testPolicyYesInCache()
         throws Exception
     {
         UrlFailureCache urlFailureCache = lookupUrlFailureCache();
@@ -99,7 +99,7 @@ public class CachedFailuresPolicyTest
 
         try
         {
-            policy.applyPolicy( CachedFailuresPolicy.CACHED, request, localFile );
+            policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile );
             fail( "Expected a PolicyViolationException." );
         }
         catch ( PolicyViolationException e )
index 5c33317d5526d49e250b3fb1bed9c600e00efef9..a1d83d36f71350c04cadadee229b5f68d1c203df 100644 (file)
@@ -148,14 +148,14 @@ public class ChecksumPolicyTest
         assertFixSetting( true, null, GOOD );
     }
 
-    public void testIgnored()
+    public void testIgnore()
         throws Exception
     {
         PostDownloadPolicy policy = lookupPolicy();
         File localFile = createTestableFiles( null, null );
         Properties request = createRequest();
 
-        policy.applyPolicy( ChecksumPolicy.IGNORED, request, localFile );
+        policy.applyPolicy( ChecksumPolicy.IGNORE, request, localFile );
     }
 
     private void assertFailSetting( boolean expectedResult, String md5State, String sha1State )
index 548693f4e6759f6c9778440ddfe8fc96d3146ebb..3ede659be9c87492be2a908786849b862337ba89 100644 (file)
@@ -126,34 +126,34 @@ public class ReleasePolicyTest
         assertReleasesPolicy( ReleasesPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
-    public void testReleasePolicyDisabledProjectMetadata()
+    public void testReleasePolicyRejectProjectMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertReleasesPolicy( ReleasesPolicy.DISABLED, PATH_PROJECT_METADATA, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.DISABLED, PATH_PROJECT_METADATA, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_PROJECT_METADATA, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_PROJECT_METADATA, WITH_LOCAL );
     }
 
-    public void testReleasePolicyDisabledReleaseArtifact()
+    public void testReleasePolicyRejectReleaseArtifact()
         throws Exception
     {
-        assertReleasesPolicyViolation( ReleasesPolicy.DISABLED, PATH_RELEASE_ARTIFACT, NO_LOCAL );
-        assertReleasesPolicyViolation( ReleasesPolicy.DISABLED, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
+        assertReleasesPolicyViolation( ReleasesPolicy.NEVER, PATH_RELEASE_ARTIFACT, NO_LOCAL );
+        assertReleasesPolicyViolation( ReleasesPolicy.NEVER, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testReleasePolicyDisabledSnapshotArtifact()
+    public void testReleasePolicyRejectSnapshotArtifact()
         throws Exception
     {
-        assertReleasesPolicy( ReleasesPolicy.DISABLED, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.DISABLED, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testReleasePolicyDisabledVersionedMetadata()
+    public void testReleasePolicyRejectVersionedMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertReleasesPolicy( ReleasesPolicy.DISABLED, PATH_VERSION_METADATA, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.DISABLED, PATH_VERSION_METADATA, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_VERSION_METADATA, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.NEVER, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
     public void testReleasePolicyHourlyProjectMetadata()
@@ -218,34 +218,34 @@ public class ReleasePolicyTest
         assertReleasesPolicy( ReleasesPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
-    public void testReleasePolicyIgnoredProjectMetadata()
+    public void testReleasePolicyAlwaysProjectMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_PROJECT_METADATA, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_PROJECT_METADATA, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_PROJECT_METADATA, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_PROJECT_METADATA, WITH_LOCAL );
     }
 
-    public void testReleasePolicyIgnoredReleaseArtifact()
+    public void testReleasePolicyAlwaysReleaseArtifact()
         throws Exception
     {
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_RELEASE_ARTIFACT, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testReleasePolicyIgnoredSnapshotArtifact()
+    public void testReleasePolicyAlwaysSnapshotArtifact()
         throws Exception
     {
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testReleasePolicyIgnoredVersionedMetadata()
+    public void testReleasePolicyAlwaysVersionedMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_VERSION_METADATA, NO_LOCAL );
-        assertReleasesPolicy( ReleasesPolicy.IGNORED, PATH_VERSION_METADATA, WITH_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_VERSION_METADATA, NO_LOCAL );
+        assertReleasesPolicy( ReleasesPolicy.ALWAYS, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
     public void testReleasePolicyOnceProjectMetadata()
index 96f6bd899d68ffcee43da23fd734c2ed7f22cdae..0879a7ea8705c0ac3c7539472af0852644676131 100644 (file)
@@ -126,34 +126,34 @@ public class SnapshotsPolicyTest
         assertSnapshotPolicy( SnapshotsPolicy.DAILY, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyDisabledProjectMetadata()
+    public void testSnapshotPolicyRejectProjectMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertSnapshotPolicy( SnapshotsPolicy.DISABLED, PATH_PROJECT_METADATA, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.DISABLED, PATH_PROJECT_METADATA, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_PROJECT_METADATA, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_PROJECT_METADATA, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyDisabledReleaseArtifact()
+    public void testSnapshotPolicyRejectReleaseArtifact()
         throws Exception
     {
-        assertSnapshotPolicy( SnapshotsPolicy.DISABLED, PATH_RELEASE_ARTIFACT, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.DISABLED, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_RELEASE_ARTIFACT, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyDisabledSnapshotArtifact()
+    public void testSnapshotPolicyRejectSnapshotArtifact()
         throws Exception
     {
-        assertSnapshotPolicyViolation( SnapshotsPolicy.DISABLED, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
-        assertSnapshotPolicyViolation( SnapshotsPolicy.DISABLED, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
+        assertSnapshotPolicyViolation( SnapshotsPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
+        assertSnapshotPolicyViolation( SnapshotsPolicy.NEVER, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyDisabledVersionedMetadata()
+    public void testSnapshotPolicyRejectVersionedMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertSnapshotPolicy( SnapshotsPolicy.DISABLED, PATH_VERSION_METADATA, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.DISABLED, PATH_VERSION_METADATA, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_VERSION_METADATA, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.NEVER, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
     public void testSnapshotPolicyHourlyProjectMetadata()
@@ -218,34 +218,34 @@ public class SnapshotsPolicyTest
         assertSnapshotPolicy( SnapshotsPolicy.HOURLY, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyIgnoredProjectMetadata()
+    public void testSnapshotPolicyAlwaysProjectMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_PROJECT_METADATA, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_PROJECT_METADATA, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_PROJECT_METADATA, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_PROJECT_METADATA, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyIgnoredReleaseArtifact()
+    public void testSnapshotPolicyAlwaysReleaseArtifact()
         throws Exception
     {
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_RELEASE_ARTIFACT, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_RELEASE_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyIgnoredSnapshotArtifact()
+    public void testSnapshotPolicyAlwaysSnapshotArtifact()
         throws Exception
     {
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_SNAPSHOT_ARTIFACT, WITH_LOCAL );
     }
 
-    public void testSnapshotPolicyIgnoredVersionedMetadata()
+    public void testSnapshotPolicyAlwaysVersionedMetadata()
         throws Exception
     {
         // Pass the policy when working with metadata, no matter what.
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_VERSION_METADATA, NO_LOCAL );
-        assertSnapshotPolicy( SnapshotsPolicy.IGNORED, PATH_VERSION_METADATA, WITH_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_VERSION_METADATA, NO_LOCAL );
+        assertSnapshotPolicy( SnapshotsPolicy.ALWAYS, PATH_VERSION_METADATA, WITH_LOCAL );
     }
 
     public void testSnapshotPolicyOnceProjectMetadata()
index fa0d7c13d02a9144eb9560972e130b4699180121..8527ade4f110b1f5323596e6b1b9ef6dd9347b6b 100644 (file)
@@ -298,8 +298,8 @@ public abstract class AbstractProxyTestCase
 
     protected void saveConnector( String sourceRepoId, String targetRepoId )
     {
-        saveConnector( sourceRepoId, targetRepoId, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( sourceRepoId, targetRepoId, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
     }
 
     protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy,
index 270c59f93e61c119021dd139d1d2900d4ea141cb..bcb774640faceb084520abbcf19e4a1ec6d5b4e9 100644 (file)
@@ -56,10 +56,10 @@ public class CacheFailuresTransferTest
         saveRemoteRepositoryConfig( "badproxied2", "Bad Proxied 2", "test://bad.machine.com/repo/", "default" );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.CACHED );
-        saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.CACHED );
+        saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+        saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
 
         wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );
         wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 );
@@ -91,10 +91,10 @@ public class CacheFailuresTransferTest
         saveRemoteRepositoryConfig( "badproxied2", "Bad Proxied 2", "test://bad.machine.com/repo/", "default" );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );
         wagonMockControl.setThrowable( new ResourceDoesNotExistException( "resource does not exist." ), 2 );
@@ -126,10 +126,10 @@ public class CacheFailuresTransferTest
         failurlCache.cacheFailure( url );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.CACHED );
-        saveConnector( ID_DEFAULT_MANAGED, "proxied2", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.CACHED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
index cbf84282f961d2c56eab12bdc98173cef14cc369..e51447ec3ca8e1bcd79516d6dec874b25dfe8b17 100644 (file)
@@ -52,8 +52,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -77,8 +77,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -102,8 +102,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -126,8 +126,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -150,8 +150,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -174,8 +174,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -196,8 +196,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -221,8 +221,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -243,8 +243,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -268,8 +268,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -290,8 +290,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -315,8 +315,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -340,8 +340,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -365,8 +365,8 @@ public class ChecksumTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -393,8 +393,8 @@ public class ChecksumTransferTest
         saveRemoteRepositoryConfig( "badproxied", "Bad Proxied", "test://bad.machine.com/repo/", "default" );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "badproxied", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "badproxied", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         wagonMock.get( path, new File( expectedFile.getAbsolutePath() + ".tmp" ) );
         wagonMockControl.setVoidCallable();
@@ -436,8 +436,8 @@ public class ChecksumTransferTest
         ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -462,8 +462,8 @@ public class ChecksumTransferTest
         ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FAIL, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -488,8 +488,8 @@ public class ChecksumTransferTest
         ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
index e90c6c2ee8fd8d7aea2e52b358b6c1113c2a2aa3..1564cc55f5e683c119d6822f71af35dabaf4d306 100644 (file)
@@ -54,7 +54,7 @@ public class ManagedDefaultTransferTest
 
         // Configure Connector (usually done within archiva.xml configuration)
         saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE,
-                       CachedFailuresPolicy.IGNORED );
+                       CachedFailuresPolicy.NO );
 
         // Attempt the proxy fetch.
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -85,7 +85,7 @@ public class ManagedDefaultTransferTest
 
         // Configure Connector (usually done within archiva.xml configuration)
         saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE,
-                       CachedFailuresPolicy.IGNORED );
+                       CachedFailuresPolicy.NO );
 
         // Attempt the proxy fetch.
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -128,8 +128,8 @@ public class ManagedDefaultTransferTest
         assertTrue( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         // Attempt the proxy fetch.
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -172,8 +172,8 @@ public class ManagedDefaultTransferTest
         assertTrue( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         // Attempt the proxy fetch.
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -204,7 +204,7 @@ public class ManagedDefaultTransferTest
 
         // Configure Connector (usually done within archiva.xml configuration)
         saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.DAILY, SnapshotsPolicy.DAILY,
-                       CachedFailuresPolicy.IGNORED );
+                       CachedFailuresPolicy.NO );
 
         // Attempt the proxy fetch.
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
index b7a9301a9c98de7b371b26771743a1bf2ac856e0..66289785740b32d710d27cf68a8ea37acb7d8e60 100644 (file)
@@ -79,8 +79,8 @@ public class ManagedLegacyTransferTest
         ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
 
index e224b79c98075b2d05ef19ffb25b16e8d79e1570..a4459d6c1dd714e0319d0ff90965cd6efad07be4 100644 (file)
@@ -142,10 +142,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -168,10 +168,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -194,8 +194,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -216,10 +216,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertProjectMetadataContents( requestedResource, new String[] { "1.0" }, null, null );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -242,10 +242,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertProjectMetadataContents( requestedResource, new String[] { "1.0-beta-2" }, null, null );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -270,8 +270,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertProjectMetadataContents( requestedResource, new String[] { "1.0.8", "1.0.22" }, null, null );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -343,10 +343,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -373,8 +373,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
 
@@ -400,8 +400,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
 
@@ -427,8 +427,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertReleaseMetadataContents( requestedResource );
 
@@ -453,10 +453,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertReleaseMetadataContents( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -484,8 +484,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertReleaseMetadataContents( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -535,10 +535,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -560,8 +560,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertNoMetadata( requestedResource );
 
@@ -581,8 +581,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceNotFound( requestedResource );
 
@@ -601,10 +601,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertSnapshotMetadataContents( requestedResource, "20070822", "021008", 3 );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -626,10 +626,10 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertResourceExists( requestedResource );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -652,8 +652,8 @@ public class MetadataTransferTest
         setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
 
         assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 );
         assertNoRepoMetadata( ID_PROXIED1, requestedResource );
index d182e10892359283c754f85272215934659ba789..23a36e6c26ec0fd6ba634e94d8104944fb9cdf8b 100644 (file)
@@ -50,8 +50,7 @@ public class SnapshotTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
         assertNotDownloaded( downloadedFile );
@@ -71,8 +70,7 @@ public class SnapshotTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -94,8 +92,7 @@ public class SnapshotTransferTest
         expectedFile.setLastModified( getPastDate().getTime() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -210,8 +207,7 @@ public class SnapshotTransferTest
         proxiedFile.setLastModified( getFutureDate().getTime() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -234,8 +230,7 @@ public class SnapshotTransferTest
         ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -257,10 +252,10 @@ public class SnapshotTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.CACHED );
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.CACHED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+                       SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -282,8 +277,7 @@ public class SnapshotTransferTest
         assertFalse( expectedFile.exists() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
@@ -309,8 +303,7 @@ public class SnapshotTransferTest
         expectedFile.setLastModified( getPastDate().getTime() );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
 
index 0bec4a91990ad779d5cab077a7682b31219137fa..223238da2d9564b6feb91422e70785bfddd5ad80 100644 (file)
@@ -24,7 +24,10 @@ import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.configuration.ProxyConnectorConfiguration;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
-import org.apache.maven.archiva.policies.DownloadPolicy;
+import org.apache.maven.archiva.policies.CachedFailuresPolicy;
+import org.apache.maven.archiva.policies.ChecksumPolicy;
+import org.apache.maven.archiva.policies.ReleasesPolicy;
+import org.apache.maven.archiva.policies.SnapshotsPolicy;
 import org.apache.maven.archiva.repository.AbstractRepositoryLayerTestCase;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
 import org.apache.maven.archiva.repository.MockConfiguration;
@@ -484,10 +487,10 @@ public class MetadataToolsTest
         ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
         connectorConfig.setSourceRepoId( sourceRepoId );
         connectorConfig.setTargetRepoId( targetRepoId );
-        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, DownloadPolicy.IGNORED );
-        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, DownloadPolicy.IGNORED );
-        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, DownloadPolicy.IGNORED );
-        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, DownloadPolicy.IGNORED );
+        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE );
+        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, ReleasesPolicy.ALWAYS );
+        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, SnapshotsPolicy.ALWAYS );
+        connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO );
 
         int count = config.getConfiguration().getProxyConnectors().size();
         config.getConfiguration().addProxyConnector( connectorConfig );
index 1d099487e65f96d9a917ee42f766b9e6d4db7ed4..b77b7114288ada7b850715d355da7a56feee741d 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index f8c35f48936846b78b3bdeb0cf0f1abc46abb5bf..11f6ff4afcda3f0abb12e2ca9e54b9b10d05e92f 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index 07ff811a59251099ca6903b0d7e46e5e5174c7a7..c9e47bd41521f9e4125d2f8596616bd80029431f 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index 07ff811a59251099ca6903b0d7e46e5e5174c7a7..c9e47bd41521f9e4125d2f8596616bd80029431f 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index c5e313fdea280a56ed12c78789f98a870a7b9ba5..24e60e8fb291454c68f9137c9e6f550206c3b7ba 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
 
index cd6fbe9fb39b132be5d4ea069ce84dfade26c89d..f903ba33fe10bdb7bb54de5ec00c6980919f1f16 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
 
index db05ca8fa141bb6fabbef42b8f71fec7382fe961..342dd6260cb9c838fb6cdea6a6f60e5d7e29cd2a 100644 (file)
           </roleDefaults>
         </configuration>
       </plugin>
+      <!--
       <plugin>
         <artifactId>maven-antrun-plugin</artifactId>
         <executions>
           </execution>
         </executions>
       </plugin>
+       -->
     </plugins>
   </build>
   <profiles>
index e7c9118ca20b28b956dbba4983749bb3940342ba..a5cd1ba1167c7ed515a7916427dc6e9ce2089e9e 100644 (file)
@@ -387,10 +387,11 @@ public class AddProxyConnectorActionTest
         connector.setSourceRepoId( "corporate" );
         connector.setTargetRepoId( "central" );
 
-        connector.getPolicies().put( "releases", ReleasesPolicy.IGNORED );
-        connector.getPolicies().put( "snapshots", SnapshotsPolicy.DISABLED );
-        connector.getPolicies().put( "checksum", ChecksumPolicy.FIX );
-        connector.getPolicies().put( "cache-failures", CachedFailuresPolicy.IGNORED );
+        // 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() );
     }
 
     @Override
index c1dd465ad06c0244a5cb09f737cd78505892cee0..f24918d684200cb1603bebfa70f1e0d47cf600ff 100644 (file)
@@ -390,10 +390,12 @@ public class EditProxyConnectorActionTest
         ProxyConnectorConfiguration connector = new ProxyConnectorConfiguration();
         connector.setSourceRepoId( TEST_SOURCE_ID );
         connector.setTargetRepoId( TEST_TARGET_ID );
-        connector.getPolicies().put( "releases", ReleasesPolicy.IGNORED );
-        connector.getPolicies().put( "snapshots", SnapshotsPolicy.DISABLED );
-        connector.getPolicies().put( "checksum", ChecksumPolicy.FIX );
-        connector.getPolicies().put( "cache-failures", CachedFailuresPolicy.IGNORED );
+        
+        // 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() );
 
         config.addProxyConnector( connector );
 
index 5d9088aa473cde2ad3164ccaaaced489b6eb0448..28a68977dd71f8fe774442f947fb28f724e9b167 100644 (file)
@@ -167,8 +167,8 @@ public abstract class AbstractRepositoryServletProxiedTestCase
         connector.setTargetRepoId( remoteRepo.id );
         connector.addPolicy( ProxyConnectorConfiguration.POLICY_RELEASES, releasesPolicy );
         connector.addPolicy( ProxyConnectorConfiguration.POLICY_SNAPSHOTS, snapshotsPolicy );
-        connector.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORED );
-        connector.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.IGNORED );
+        connector.addPolicy( ProxyConnectorConfiguration.POLICY_CHECKSUM, ChecksumPolicy.IGNORE );
+        connector.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, CachedFailuresPolicy.NO );
 
         archivaConfiguration.getConfiguration().addProxyConnector( connector );
     }
@@ -218,17 +218,17 @@ public abstract class AbstractRepositoryServletProxiedTestCase
 
     protected void setupConnector( String repoId, RemoteRepoInfo remoteRepo )
     {
-        setupConnector( repoId, remoteRepo, ReleasesPolicy.IGNORED, SnapshotsPolicy.IGNORED );
+        setupConnector( repoId, remoteRepo, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS );
     }
 
     protected void setupReleaseConnector( String managedRepoId, RemoteRepoInfo remoteRepo, String releasePolicy )
     {
-        setupConnector( managedRepoId, remoteRepo, releasePolicy, SnapshotsPolicy.IGNORED );
+        setupConnector( managedRepoId, remoteRepo, releasePolicy, SnapshotsPolicy.ALWAYS );
     }
 
     protected void setupSnapshotConnector( String managedRepoId, RemoteRepoInfo remoteRepo, String snapshotsPolicy )
     {
-        setupConnector( managedRepoId, remoteRepo, ReleasesPolicy.IGNORED, snapshotsPolicy );
+        setupConnector( managedRepoId, remoteRepo, ReleasesPolicy.ALWAYS, snapshotsPolicy );
     }
 
     protected void setupSnapshotsRemoteRepo()
index 456f09945787b83e0a0c148553e584ad0821a757..7d252bb1db8f447b7e23ee2cc4ef3dac7e73b143 100644 (file)
@@ -40,21 +40,21 @@ public class RepositoryServletProxiedPluginSnapshotPolicyTest
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.IGNORED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS,
                                                      HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.IGNORED, HAS_MANAGED_COPY,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY,
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.IGNORED, NO_MANAGED_COPY );
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyDailyFail()
@@ -77,23 +77,23 @@ public class RepositoryServletProxiedPluginSnapshotPolicyTest
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledFail()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectFail()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DISABLED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
                                                      HAS_MANAGED_COPY );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledNoManagedContentFail()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.DISABLED, NO_MANAGED_COPY );
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledPass()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectPass()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DISABLED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
                                                      HAS_MANAGED_COPY );
     }
 
index 2e985e9cc2eae8556e76d561e6032913aec2c166..ebf944e1af0a100dd8c74ee19c044b78f604413f 100644 (file)
@@ -40,21 +40,21 @@ public class RepositoryServletProxiedReleasePolicyTest
     public void testGetProxiedReleaseArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
-        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.IGNORED, HAS_MANAGED_COPY,
+        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.ALWAYS, HAS_MANAGED_COPY,
                                                    ( NEWER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedReleaseArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
-        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.IGNORED, HAS_MANAGED_COPY,
+        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ALWAYS, HAS_MANAGED_COPY,
                                                    ( OLDER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedReleaseArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
-        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.IGNORED, NO_MANAGED_COPY );
+        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, ReleasesPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
     public void testGetProxiedReleaseArtifactPolicyDailyFail()
@@ -77,22 +77,22 @@ public class RepositoryServletProxiedReleasePolicyTest
                                                    ( OLDER * OVER_ONE_DAY ) );
     }
 
-    public void testGetProxiedReleaseArtifactPolicyDisabledFail()
+    public void testGetProxiedReleaseArtifactPolicyRejectFail()
         throws Exception
     {
-        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.DISABLED, HAS_MANAGED_COPY );
+        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.NEVER, HAS_MANAGED_COPY );
     }
 
-    public void testGetProxiedReleaseArtifactPolicyDisabledNoManagedContentFail()
+    public void testGetProxiedReleaseArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
-        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_NOT_FOUND, ReleasesPolicy.DISABLED, NO_MANAGED_COPY );
+        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_NOT_FOUND, ReleasesPolicy.NEVER, NO_MANAGED_COPY );
     }
 
-    public void testGetProxiedReleaseArtifactPolicyDisabledPass()
+    public void testGetProxiedReleaseArtifactPolicyRejectPass()
         throws Exception
     {
-        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.DISABLED, HAS_MANAGED_COPY );
+        assertGetProxiedReleaseArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, ReleasesPolicy.NEVER, HAS_MANAGED_COPY );
     }
 
     public void testGetProxiedReleaseArtifactPolicyHourlyFail()
index 2167955ffbba28030fd1a3850fb37421733c7c1c..7db24e4f9d8ca70d48e0036e5ab81a8b7ba6eb09 100644 (file)
@@ -40,21 +40,21 @@ public class RepositoryServletProxiedSnapshotPolicyTest
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.IGNORED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS,
                                                      HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.IGNORED, HAS_MANAGED_COPY,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY,
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.IGNORED, NO_MANAGED_COPY );
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyDailyFail()
@@ -77,23 +77,23 @@ public class RepositoryServletProxiedSnapshotPolicyTest
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledFail()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectFail()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DISABLED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
                                                      HAS_MANAGED_COPY );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledNoManagedContentFail()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.DISABLED, NO_MANAGED_COPY );
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledPass()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectPass()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DISABLED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
                                                      HAS_MANAGED_COPY );
     }
 
index fb4f8edc16f0d3a6d3b541a72c31cb99149cfc1c..dbff0a7252fa233271cdada3a7856e2595243d47 100644 (file)
@@ -40,21 +40,21 @@ public class RepositoryServletProxiedTimestampedSnapshotPolicyTest
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedNewer()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.IGNORED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.ALWAYS,
                                                      HAS_MANAGED_COPY, ( NEWER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysManagedOlder()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.IGNORED, HAS_MANAGED_COPY,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, HAS_MANAGED_COPY,
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyAlwaysNoManagedContent()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.IGNORED, NO_MANAGED_COPY );
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_REMOTE_CONTENTS, SnapshotsPolicy.ALWAYS, NO_MANAGED_COPY );
     }
 
     public void testGetProxiedSnapshotsArtifactPolicyDailyFail()
@@ -77,23 +77,23 @@ public class RepositoryServletProxiedTimestampedSnapshotPolicyTest
                                                      ( OLDER * OVER_ONE_DAY ) );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledFail()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectFail()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DISABLED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
                                                      HAS_MANAGED_COPY );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledNoManagedContentFail()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectNoManagedContentFail()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.DISABLED, NO_MANAGED_COPY );
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_NOT_FOUND, SnapshotsPolicy.NEVER, NO_MANAGED_COPY );
     }
 
-    public void testGetProxiedSnapshotsArtifactPolicyDisabledPass()
+    public void testGetProxiedSnapshotsArtifactPolicyRejectPass()
         throws Exception
     {
-        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.DISABLED,
+        assertGetProxiedSnapshotsArtifactWithPolicy( EXPECT_MANAGED_CONTENTS, SnapshotsPolicy.NEVER,
                                                      HAS_MANAGED_COPY );
     }
 
index beccf43c939d8fd98fe846206393be24826887e6..15ea6ed1ac2ad9e5dbd0dbe8c049cdeaa8982bd7 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>
index 974e148d29c5c1050484d4996205ebf50a2a2a7d..4f0ff5531a8ce5e7442b3e345add9a286dda7ba2 100644 (file)
           <role>org.codehaus.plexus.registry.Registry</role>
           <role-hint>configured</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PreDownloadPolicy</role>
+          <field-name>prePolicies</field-name>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.archiva.policies.PostDownloadPolicy</role>
+          <field-name>postPolicies</field-name>
+        </requirement>
       </requirements>
     </component>
     <component>