* 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;
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>
*/
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"
*/
*/
private boolean isConfigurationDefaulted = false;
+ private static final String KEY = "org.apache.maven.archiva";
+
public synchronized Configuration getConfiguration()
{
if ( configuration == null )
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();
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)
{
// 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 ) )
{
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 );
}
<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>
<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>
<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>
</requirements>
</component>
</components>
-</component-set>
\ No newline at end of file
+</component-set>
<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>
</requirements>
</component>
</components>
-</component-set>
\ No newline at end of file
+</component-set>
<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>
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>
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();
+ "], 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;
}
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() )
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"
public CachedFailuresPolicy()
{
- options.add( IGNORED );
- options.add( CACHED );
+ options.add( NO );
+ options.add( YES );
}
public void applyPolicy( String policySetting, Properties request, File localFile )
+ "], 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;
}
public String getDefaultOption()
{
- return IGNORED;
+ return NO;
}
public String getId()
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
{
options.add( FAIL );
options.add( FIX );
- options.add( IGNORED );
+ options.add( IGNORE );
}
public void applyPolicy( String policySetting, Properties request, File localFile )
+ "], valid settings are [" + StringUtils.join( options.iterator(), "," ) + "]" );
}
- if ( IGNORED.equals( policySetting ) )
+ if ( IGNORE.equals( policySetting ) )
{
// Ignore.
+ getLogger().debug( "Checksum policy set to IGNORE." );
return;
}
{
if( checksums.update( localFile ) )
{
+ getLogger().debug( "Checksum policy set to FIX, checksum files have been updated." );
return;
}
else
*/
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.
*
extends AbstractUpdatePolicy
implements PreDownloadPolicy
{
+ /**
+ * Defaults to {@link AbstractUpdatePolicy#HOURLY}
+ */
public String getDefaultOption()
{
- return AbstractUpdatePolicy.IGNORED;
+ return AbstractUpdatePolicy.HOURLY;
}
protected boolean isSnapshotPolicy()
extends AbstractUpdatePolicy
implements PreDownloadPolicy
{
+ /**
+ * Defaults to {@link AbstractUpdatePolicy#HOURLY}
+ */
public String getDefaultOption()
{
- return AbstractUpdatePolicy.IGNORED;
+ return AbstractUpdatePolicy.HOURLY;
}
protected boolean isSnapshotPolicy()
return request;
}
- public void testIgnored()
+ public void testPolicyNo()
throws Exception
{
DownloadPolicy policy = lookupPolicy();
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();
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();
try
{
- policy.applyPolicy( CachedFailuresPolicy.CACHED, request, localFile );
+ policy.applyPolicy( CachedFailuresPolicy.YES, request, localFile );
fail( "Expected a PolicyViolationException." );
}
catch ( PolicyViolationException e )
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 )
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()
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()
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()
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()
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,
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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();
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 );
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 );
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 );
// 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 );
// 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 );
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 );
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 );
// 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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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 );
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;
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 );
<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>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>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>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>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>
<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>
</roleDefaults>
</configuration>
</plugin>
+ <!--
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
</execution>
</executions>
</plugin>
+ -->
</plugins>
</build>
<profiles>
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
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 );
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 );
}
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()
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()
( 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 );
}
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()
( 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()
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()
( 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 );
}
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()
( 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 );
}
<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>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>