mirror of https://github.com/apache/archiva.git
[MRM-547] proxy connectors: cache failures options are confusing
[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
This commit is contained in:
parent
255949579d
commit
baf4c89435
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
<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>
|
||||
|
@ -48,6 +56,14 @@
|
|||
<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>
|
||||
|
@ -71,6 +87,14 @@
|
|||
<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>
|
||||
|
@ -95,6 +119,14 @@
|
|||
<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>
|
||||
|
@ -120,6 +152,14 @@
|
|||
<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>
|
||||
|
@ -144,6 +184,14 @@
|
|||
<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>
|
||||
|
@ -167,6 +215,14 @@
|
|||
<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>
|
||||
|
@ -195,6 +251,14 @@
|
|||
<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>
|
||||
|
@ -220,6 +284,14 @@
|
|||
<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>
|
||||
|
@ -246,6 +318,14 @@
|
|||
<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>
|
||||
|
@ -272,6 +352,14 @@
|
|||
<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>
|
||||
|
@ -301,6 +389,14 @@
|
|||
<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>
|
||||
|
@ -320,6 +416,25 @@
|
|||
</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>
|
||||
|
|
|
@ -65,6 +65,14 @@
|
|||
<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>
|
||||
|
@ -160,6 +168,14 @@
|
|||
<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>
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
<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>
|
||||
</component-set>
|
||||
|
|
|
@ -29,6 +29,14 @@
|
|||
<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>
|
||||
</component-set>
|
||||
|
|
|
@ -55,6 +55,14 @@
|
|||
<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>
|
||||
|
|
|
@ -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() )
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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 )
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -28,6 +28,14 @@
|
|||
<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>
|
||||
|
|
|
@ -28,6 +28,14 @@
|
|||
<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>
|
||||
|
|
|
@ -10,6 +10,14 @@
|
|||
<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>
|
||||
|
|
|
@ -10,6 +10,14 @@
|
|||
<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>
|
||||
|
|
|
@ -42,6 +42,14 @@
|
|||
<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>
|
||||
|
||||
|
|
|
@ -51,6 +51,14 @@
|
|||
<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>
|
||||
|
||||
|
|
|
@ -420,6 +420,7 @@
|
|||
</roleDefaults>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<!--
|
||||
<plugin>
|
||||
<artifactId>maven-antrun-plugin</artifactId>
|
||||
<executions>
|
||||
|
@ -438,6 +439,7 @@
|
|||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
-->
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,14 @@
|
|||
<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>
|
||||
|
|
|
@ -40,6 +40,14 @@
|
|||
<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>
|
||||
|
|
Loading…
Reference in New Issue