]> source.dussan.org Git - archiva.git/commitdiff
MRM-541 - convenient way to take Archiva proxies "offline"
authorJames William Dumay <jdumay@apache.org>
Tue, 19 Aug 2008 09:12:41 +0000 (09:12 +0000)
committerJames William Dumay <jdumay@apache.org>
Tue, 19 Aug 2008 09:12:41 +0000 (09:12 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/MRM-541@687001 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-base/archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/DefaultRepositoryProxyConnectors.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/AbstractProxyTestCase.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/CacheFailuresTransferTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ChecksumTransferTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ErrorHandlingTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedLegacyTransferTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java

index 9c81b53ed0009a51b140f2e752243466d9ef51dd..68406c1ded2a711eecd9a81af40b961f1394dfca 100644 (file)
@@ -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>();
index 344e5fc102b9d90d7f50c7c693533e5111baca22..eed4394e6869c0fb3f571da6f34b43c1414187e3 100644 (file)
@@ -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 );
index 119211d6c675ec8795ffd3d98d668c8e2677122c..6a509570a55e7d04e1c5e922204d308bfa7db975 100644 (file)
@@ -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 );
 
index 784787987437b474b0e4396811d6be62de16f006..13d23dab3e930fec0e4cc4e88d04466072e52289 100644 (file)
@@ -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 );
 
index 4b96766c7f05e5934af057c0805b19ce17c0e056..9a9c03bd418094077b51c3ae51f579b9462d428e 100644 (file)
@@ -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 )
index 878e96d509b0de8b224fced1506e28e80106c805..bb3a1c793c907b4f146f46b9d7f32d317a03dd72 100644 (file)
@@ -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 );
 
index 66289785740b32d710d27cf68a8ea37acb7d8e60..5940ef6824c475a7acd2e1ad2e4c3dd16ffc4988 100644 (file)
@@ -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 );
 
index 8e7d20d68bf512b22534170a1d454e02633b9157..fa6a4b96898dd4cbbe76181a6641b6e67311d3b3 100644 (file)
@@ -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 );
index 23a36e6c26ec0fd6ba634e94d8104944fb9cdf8b..d610dbab9fa839f94b56c37894b569e2c59d64cc 100644 (file)
@@ -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 );