aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorJames William Dumay <jdumay@apache.org>2008-08-19 09:12:41 +0000
committerJames William Dumay <jdumay@apache.org>2008-08-19 09:12:41 +0000
commit2903962dfabae82dcdc2c38539ad7569f06511c1 (patch)
treef62b171c364ce89a4f680a9a4649bcf2f88e0201 /archiva-modules
parente5be21e4bbafdc2842e52ed5b403d4bf4e8c1040 (diff)
downloadarchiva-2903962dfabae82dcdc2c38539ad7569f06511c1.tar.gz
archiva-2903962dfabae82dcdc2c38539ad7569f06511c1.zip
MRM-541 - convenient way to take Archiva proxies "offline"
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-541@687001 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java1
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java15
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java12
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java57
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java20
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java65
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java16
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java102
-rw-r--r--archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java20
9 files changed, 188 insertions, 120 deletions
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
index 9c81b53ed..68406c1de 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
@@ -1076,6 +1076,7 @@ public class DefaultRepositoryProxyConnectors
connector.setProxyId( proxyConfig.getProxyId() );
connector.setPolicies( proxyConfig.getPolicies() );
connector.setOrder( proxyConfig.getOrder() );
+ connector.setDisabled( proxyConfig.isDisabled() );
// Copy any blacklist patterns.
List<String> blacklist = new ArrayList<String>();
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
index 344e5fc10..eed4394e6 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
@@ -338,29 +338,29 @@ public abstract class AbstractProxyTestCase
}
}
- protected void saveConnector( String sourceRepoId, String targetRepoId )
+ protected void saveConnector( String sourceRepoId, String targetRepoId, boolean disabled )
{
saveConnector( sourceRepoId, targetRepoId, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, disabled );
}
protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
- String snapshotPolicy, String cacheFailuresPolicy )
+ String snapshotPolicy, String cacheFailuresPolicy, boolean disabled )
{
saveConnector( sourceRepoId, targetRepoId, checksumPolicy, releasePolicy, snapshotPolicy, cacheFailuresPolicy,
- PropagateErrorsDownloadPolicy.QUEUE );
+ PropagateErrorsDownloadPolicy.QUEUE, disabled );
}
protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
- String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy )
+ String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy, boolean disabled )
{
saveConnector( sourceRepoId, targetRepoId, checksumPolicy, releasePolicy, snapshotPolicy, cacheFailuresPolicy,
- errorPolicy, PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT );
+ errorPolicy, PropagateErrorsOnUpdateDownloadPolicy.NOT_PRESENT, disabled );
}
protected void saveConnector( String sourceRepoId, String targetRepoId, String checksumPolicy, String releasePolicy,
String snapshotPolicy, String cacheFailuresPolicy, String errorPolicy,
- String errorOnUpdatePolicy )
+ String errorOnUpdatePolicy, boolean disabled )
{
ProxyConnectorConfiguration connectorConfig = new ProxyConnectorConfiguration();
connectorConfig.setSourceRepoId( sourceRepoId );
@@ -371,6 +371,7 @@ public abstract class AbstractProxyTestCase
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_CACHE_FAILURES, cacheFailuresPolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS, errorPolicy );
connectorConfig.addPolicy( ProxyConnectorConfiguration.POLICY_PROPAGATE_ERRORS_ON_UPDATE, errorOnUpdatePolicy );
+ connectorConfig.setDisabled(disabled);
int count = config.getConfiguration().getProxyConnectors().size();
config.getConfiguration().addProxyConnector( connectorConfig );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java
index 119211d6c..6a509570a 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java
@@ -60,9 +60,9 @@ public class CacheFailuresTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES, false );
saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES, false );
wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );
@@ -103,9 +103,9 @@ public class CacheFailuresTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
saveConnector( ID_DEFAULT_MANAGED, "badproxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
wagonMock.get( path, new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" ) );
@@ -153,9 +153,9 @@ public class CacheFailuresTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES, false );
saveConnector( ID_DEFAULT_MANAGED, "proxied2", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java
index 784787987..13d23dab3 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java
@@ -39,6 +39,27 @@ import java.io.File;
public class ChecksumTransferTest
extends AbstractProxyTestCase
{
+ public void testGetChecksumWhenConnectorIsDisabled()
+ throws Exception
+ {
+ String path = "org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar";
+ setupTestableManagedRepository( path );
+
+ File expectedFile = new File( managedDefaultDir, path );
+ ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
+
+ FileUtils.deleteDirectory( expectedFile.getParentFile() );
+ assertFalse( expectedFile.exists() );
+
+ // Configure Connector (usually done within archiva.xml configuration)
+ saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, true );
+
+ File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
+
+ assertNull(downloadedFile);
+ }
+
public void testGetChecksumBothCorrect()
throws Exception
{
@@ -53,7 +74,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -78,7 +99,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -103,7 +124,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -127,7 +148,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -151,7 +172,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -175,7 +196,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -197,7 +218,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -222,7 +243,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -244,7 +265,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -269,7 +290,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -291,7 +312,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -316,7 +337,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -341,7 +362,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -366,7 +387,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -394,7 +415,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "badproxied", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
wagonMock.get( path, new File( expectedFile.getAbsolutePath() + ".tmp" ) );
wagonMockControl.setMatcher(customWagonGetMatcher);
@@ -440,7 +461,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO , false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -466,7 +487,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FAIL, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO , false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -493,7 +514,7 @@ public class ChecksumTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO , false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java
index 4b96766c7..9a9c03bd4 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java
@@ -63,7 +63,7 @@ public class ErrorHandlingTest
File expectedFile = setupRepositoriesWithLocalFileNotPresent( path );
createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
simulateGetError( path, expectedFile, createTransferException() );
@@ -92,7 +92,7 @@ public class ErrorHandlingTest
String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL;
File expectedFile = setupRepositoriesWithLocalFileNotPresent( path );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false );
createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.STOP );
@@ -107,7 +107,7 @@ public class ErrorHandlingTest
createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
simulateGetError( path, expectedFile, createResourceNotFoundException() );
@@ -122,7 +122,7 @@ public class ErrorHandlingTest
createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.STOP );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
simulateGetError( path, expectedFile, createTransferException() );
@@ -135,7 +135,7 @@ public class ErrorHandlingTest
String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL;
File expectedFile = setupRepositoriesWithLocalFileNotPresent( path );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false );
createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.QUEUE );
@@ -201,7 +201,7 @@ public class ErrorHandlingTest
createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.QUEUE );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
simulateGetError( path, expectedFile, createResourceNotFoundException() );
@@ -216,7 +216,7 @@ public class ErrorHandlingTest
createMockedProxyConnector( ID_MOCKED_PROXIED1, NAME_MOCKED_PROXIED1, PropagateErrorsDownloadPolicy.IGNORE );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
simulateGetError( path, expectedFile, createTransferException() );
@@ -229,7 +229,7 @@ public class ErrorHandlingTest
String path = PATH_IN_BOTH_REMOTES_NOT_LOCAL;
File expectedFile = setupRepositoriesWithLocalFileNotPresent( path );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false );
createMockedProxyConnector( ID_MOCKED_PROXIED2, NAME_MOCKED_PROXIED2, PropagateErrorsDownloadPolicy.IGNORE );
@@ -499,14 +499,14 @@ public class ErrorHandlingTest
{
saveRemoteRepositoryConfig( id, name, "test://bad.machine.com/repo/", "default" );
saveConnector( ID_DEFAULT_MANAGED, id, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS,
- CachedFailuresPolicy.NO, errorPolicy );
+ CachedFailuresPolicy.NO, errorPolicy, false );
}
private void createMockedProxyConnector( String id, String name, String errorPolicy, String errorOnUpdatePolicy )
{
saveRemoteRepositoryConfig( id, name, "test://bad.machine.com/repo/", "default" );
saveConnector( ID_DEFAULT_MANAGED, id, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS, SnapshotsPolicy.ALWAYS,
- CachedFailuresPolicy.NO, errorPolicy, errorOnUpdatePolicy );
+ CachedFailuresPolicy.NO, errorPolicy, errorOnUpdatePolicy, false );
}
private File setupRepositoriesWithLocalFileNotPresent( String path )
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java
index 878e96d50..bb3a1c793 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java
@@ -40,6 +40,27 @@ import java.io.File;
public class ManagedDefaultTransferTest
extends AbstractProxyTestCase
{
+ public void testGetDefaultLayoutNotPresentConnectorOffline()
+ throws Exception
+ {
+ String path = "org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar";
+ setupTestableManagedRepository( path );
+
+ File expectedFile = new File( managedDefaultDir, path );
+ ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
+
+ // Ensure file isn't present first.
+ assertNotExistsInManagedDefaultRepo( expectedFile );
+
+ // Configure Connector (usually done within archiva.xml configuration)
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ONCE, SnapshotsPolicy.ONCE,
+ CachedFailuresPolicy.NO, true );
+
+ // Attempt the proxy fetch.
+ File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
+ assertNull("File should not have been downloaded", downloadedFile);
+ }
+
public void testGetDefaultLayoutNotPresent()
throws Exception
{
@@ -54,7 +75,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.NO );
+ CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -77,7 +98,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.NO );
+ CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, path );
@@ -111,7 +132,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.NO );
+ CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -144,7 +165,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.NO );
+ CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, path );
@@ -189,7 +210,7 @@ public class ManagedDefaultTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -233,7 +254,7 @@ public class ManagedDefaultTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -264,7 +285,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.NO );
+ CachedFailuresPolicy.NO, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -286,8 +307,8 @@ public class ManagedDefaultTransferTest
assertNotExistsInManagedDefaultRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 , false );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 , false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -316,8 +337,8 @@ public class ManagedDefaultTransferTest
assertNotExistsInManagedDefaultRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -339,9 +360,9 @@ public class ManagedDefaultTransferTest
assertNotExistsInManagedDefaultRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
- saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
+ saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -371,8 +392,8 @@ public class ManagedDefaultTransferTest
wagonMockControl.replay();
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, "badproxied" );
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2 );
+ saveConnector( ID_DEFAULT_MANAGED, "badproxied", false );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, false );
// Attempt the proxy fetch.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -400,8 +421,8 @@ public class ManagedDefaultTransferTest
saveRemoteRepositoryConfig( "badproxied2", "Bad Proxied 2", "test://dead.machine.com/repo/", "default" );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, "badproxied1" );
- saveConnector( ID_DEFAULT_MANAGED, "badproxied2" );
+ saveConnector( ID_DEFAULT_MANAGED, "badproxied1", false );
+ saveConnector( ID_DEFAULT_MANAGED, "badproxied2", false );
File tmpFile = new File( expectedFile.getParentFile(), expectedFile.getName() + ".tmp" );
wagonMock.get( path, tmpFile );
@@ -446,7 +467,7 @@ public class ManagedDefaultTransferTest
assertTrue( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -473,7 +494,7 @@ public class ManagedDefaultTransferTest
assertTrue( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -495,7 +516,7 @@ public class ManagedDefaultTransferTest
assertNotExistsInManagedDefaultRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -517,7 +538,7 @@ public class ManagedDefaultTransferTest
assertNotExistsInManagedDefaultRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java
index 662897857..5940ef682 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java
@@ -51,7 +51,7 @@ public class ManagedLegacyTransferTest
assertNotExistsInManagedLegacyRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -80,7 +80,7 @@ public class ManagedLegacyTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -102,7 +102,7 @@ public class ManagedLegacyTransferTest
assertNotExistsInManagedLegacyRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -127,7 +127,7 @@ public class ManagedLegacyTransferTest
ArtifactReference artifact = managedLegacyRepository.toArtifactReference( path );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -149,7 +149,7 @@ public class ManagedLegacyTransferTest
assertTrue( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -171,7 +171,7 @@ public class ManagedLegacyTransferTest
assertTrue( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -193,7 +193,7 @@ public class ManagedLegacyTransferTest
assertNotExistsInManagedLegacyRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED );
+ saveConnector( ID_LEGACY_MANAGED, ID_LEGACY_PROXIED, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
@@ -215,7 +215,7 @@ public class ManagedLegacyTransferTest
assertNotExistsInManagedLegacyRepo( expectedFile );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_LEGACY_MANAGED, ID_PROXIED1, false );
File downloadedFile = proxyHandler.fetchFromProxies( managedLegacyRepository, artifact );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
index 8e7d20d68..fa6a4b968 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
@@ -95,6 +95,30 @@ public class MetadataTransferTest
* @plexus.requirement
*/
private MetadataTools metadataTools;
+
+ public void testGetProjectMetadataProxiedNotLocalOnRemoteConnectoDisabled()
+ throws Exception
+ {
+ // New project metadata that does not exist locally but exists on remote.
+ String requestedResource = "org/apache/maven/test/get-found-in-proxy/maven-metadata.xml";
+ setupTestableManagedRepository( requestedResource );
+
+ // Configure Connector (usually done within archiva.xml configuration)
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, true);
+
+ assertResourceNotFound( requestedResource );
+ assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+
+ File expectedFile = new File( managedDefaultDir, requestedResource );
+
+ ProjectReference metadata = createProjectReference( requestedResource );
+
+ File downloadedFile = proxyHandler.fetchMetatadaFromProxies( managedDefaultRepository, managedDefaultRepository.toMetadataPath(metadata) );
+
+ assertNull( "Should not have downloaded a file.", downloadedFile );
+ assertNoTempFiles( expectedFile );
+ }
// TODO: same test for other fetch* methods
public void testFetchFromTwoProxiesWhenFirstConnectionFails()
@@ -108,9 +132,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, "badproxied1", ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( "badproxied1", requestedResource );
@@ -185,9 +209,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -211,9 +235,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -237,7 +261,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -259,9 +283,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertProjectMetadataContents( requestedResource, new String[] { "1.0" }, null, null );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -285,9 +309,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertProjectMetadataContents( requestedResource, new String[] { "1.0-beta-2" }, null, null );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -313,7 +337,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertProjectMetadataContents( requestedResource, new String[] { "1.0.8", "1.0.22" }, null, null );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -386,9 +410,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -416,7 +440,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceNotFound( requestedResource );
@@ -443,7 +467,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -470,7 +494,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertReleaseMetadataContents( requestedResource );
@@ -496,9 +520,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertReleaseMetadataContents( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -527,7 +551,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertReleaseMetadataContents( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -578,9 +602,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -603,7 +627,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertNoMetadata( requestedResource );
@@ -624,7 +648,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceNotFound( requestedResource );
@@ -644,9 +668,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertSnapshotMetadataContents( requestedResource, "20070822", "021008", 3 );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -669,9 +693,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceExists( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -695,7 +719,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -751,9 +775,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -777,9 +801,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -803,7 +827,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertResourceNotFound( requestedResource );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -825,9 +849,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertGroupMetadataContents( requestedResource, new String[] { "plugin1" } );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -851,9 +875,9 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertGroupMetadataContents( requestedResource, new String[] { "plugin5" } );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
@@ -879,7 +903,7 @@ public class MetadataTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.NO, false );
assertGroupMetadataContents( requestedResource, new String[] { "plugin6", "plugin7" } );
assertNoRepoMetadata( ID_PROXIED1, requestedResource );
diff --git a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java
index 23a36e6c2..d610dbab9 100644
--- a/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java
+++ b/archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java
@@ -50,7 +50,7 @@ public class SnapshotTransferTest
assertFalse( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
assertNotDownloaded( downloadedFile );
@@ -70,7 +70,7 @@ public class SnapshotTransferTest
assertFalse( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -92,7 +92,7 @@ public class SnapshotTransferTest
expectedFile.setLastModified( getPastDate().getTime() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -115,7 +115,7 @@ public class SnapshotTransferTest
ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1 );
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false );
// Attempt to download.
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -207,7 +207,7 @@ public class SnapshotTransferTest
proxiedFile.setLastModified( getFutureDate().getTime() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -230,7 +230,7 @@ public class SnapshotTransferTest
ArtifactReference artifact = managedDefaultRepository.toArtifactReference( path );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -253,9 +253,9 @@ public class SnapshotTransferTest
// Configure Connector (usually done within archiva.xml configuration)
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES , false);
saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.IGNORE, ReleasesPolicy.ALWAYS,
- SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES );
+ SnapshotsPolicy.ALWAYS, CachedFailuresPolicy.YES , false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -277,7 +277,7 @@ public class SnapshotTransferTest
assertFalse( expectedFile.exists() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
@@ -303,7 +303,7 @@ public class SnapshotTransferTest
expectedFile.setLastModified( getPastDate().getTime() );
// Configure Connector (usually done within archiva.xml configuration)
- saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1);
+ saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, false);
File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact );
r-stable30 Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/tests/lib/LegacyHelperTest.php
blob: 736c5bf7fad78185be8aafd725c4af643c8703b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300