archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joak...@apache.org
Subject svn commit: r571008 [2/4] - in /maven/archiva/trunk/archiva-base: archiva-proxy/ archiva-proxy/src/main/java/org/apache/maven/archiva/proxy/ archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ archiva-proxy/src/test/repositories/ archiva-proxy/...
Date Thu, 30 Aug 2007 01:22:24 GMT
Modified: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java?rev=571008&r1=571007&r2=571008&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/MetadataTransferTest.java Wed Aug 29 18:22:19 2007
@@ -19,344 +19,1011 @@
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.model.ArchivaRepositoryMetadata;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.SnapshotVersion;
+import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.policies.CachedFailuresPolicy;
 import org.apache.maven.archiva.policies.ChecksumPolicy;
 import org.apache.maven.archiva.policies.ReleasesPolicy;
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
+import org.apache.maven.archiva.repository.metadata.MetadataTools;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataReader;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataWriter;
+import org.custommonkey.xmlunit.DetailedDiff;
+import org.custommonkey.xmlunit.Diff;
 
 import java.io.File;
 import java.io.StringWriter;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
 import java.util.Arrays;
-import java.util.Date;
-import java.util.Locale;
-import java.util.TimeZone;
 
 /**
- * MetadataTransferTest 
+ * MetadataTransferTest - Tests the various fetching / merging concepts surrounding the maven-metadata.xml files
+ * present in the repository.
+ *
+ * Test Case Naming is as follows.
+ * 
+ * <code>
+ * public void testGet[Release|Snapshot|Project]Metadata[Not]Proxied[Not|On]Local[Not|On|Multiple]Remote
+ * </code>
+ * 
+ * <pre>
+ * Which should leave the following matrix of test cases.
+ *  
+ *   Metadata  | Proxied  | Local | Remote
+ *   ----------+----------+-------+---------
+ *   Release   | Not      | Not   | n/a (1)
+ *   Release   | Not      | On    | n/a (1)
+ *   Release   |          | Not   | Not
+ *   Release   |          | Not   | On
+ *   Release   |          | Not   | Multiple
+ *   Release   |          | On    | Not
+ *   Release   |          | On    | On
+ *   Release   |          | On    | Multiple
+ *   Snapshot  | Not      | Not   | n/a (1)
+ *   Snapshot  | Not      | On    | n/a (1)
+ *   Snapshot  |          | Not   | Not
+ *   Snapshot  |          | Not   | On
+ *   Snapshot  |          | Not   | Multiple
+ *   Snapshot  |          | On    | Not
+ *   Snapshot  |          | On    | On
+ *   Snapshot  |          | On    | Multiple
+ *   Project   | Not      | Not   | n/a (1)
+ *   Project   | Not      | On    | n/a (1)
+ *   Project   |          | Not   | Not
+ *   Project   |          | Not   | On
+ *   Project   |          | Not   | Multiple
+ *   Project   |          | On    | Not
+ *   Project   |          | On    | On
+ *   Project   |          | On    | Multiple
+ *   
+ * (1) If it isn't proxied, no point in having a remote.
+ * </pre>
  *
- * @author Brett Porter
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @version $Id$
  */
 public class MetadataTransferTest
     extends AbstractProxyTestCase
 {
-    public void testGetMetadataNotPresent()
+    /**
+     * @plexus.requirement
+     */
+    private MetadataTools metadataTools;
+
+    /**
+     * Attempt to get the project metadata for non-existant artifact.
+     * 
+     * Expected result: the maven-metadata.xml file is not created on the managed repository, nor returned
+     *                  to the requesting client.
+     */
+    public void testGetProjectMetadataNotProxiedNotLocal()
+        throws Exception
+    {
+        // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally).
+        String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        assertResourceNotFound( requestedResource );
+
+        // No proxy setup, nothing fetched, failure expected.
+        assertFetchProjectFailed( requestedResource );
+
+        // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated.
+        assertResourceNotFound( requestedResource );
+    }
+
+    public void testGetProjectMetadataNotProxiedOnLocal()
         throws Exception
     {
-        String path = "org/apache/maven/test/dummy-artifact/1.0/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        // Project metadata that exists and has multiple versions
+        String requestedResource = "org/apache/maven/test/get-project-metadata/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        assertResourceExists( requestedResource );
+
+        // No proxy setup, nothing fetched from remote, but local exists.
+        assertFetchProject( requestedResource );
+
+        // Nothing fetched.  Should only contain contents of what is in the repository.
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0", "1.1", "2.0" } );
+    }
+
+    public void testGetProjectMetadataProxiedNotLocalMultipleRemotes()
+        throws Exception
+    {
+        // Project metadata that does not exist locally, but has multiple versions in remote repos
+        String requestedResource = "org/apache/maven/test/get-default-layout/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
         saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
 
-        assertNotDownloaded( downloadedFile );
-        assertNoTempFiles( expectedFile );
+        // Two proxies setup, metadata fetched from both remotes.
+        assertFetchProject( requestedResource );
+
+        // Nothing fetched.  Should only contain contents of what is in the repository.
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0", "1.0.1" } );
+        assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0" } );
+        assertRepoProjectMetadata( ID_PROXIED2, requestedResource, new String[] { "1.0.1" } );
     }
 
-    private String getExpectedMetadata( String artifactId, String version )
-        throws RepositoryMetadataException
+    public void testGetProjectMetadataProxiedNotLocalNotRemote()
+        throws Exception
     {
-        return getExpectedMetadata( artifactId, version, (SnapshotVersion) null, null );
-    }
+        // Non-existant project metadata that does not exist locally and doesn't exist on remotes.
+        String requestedResource = "org/apache/maven/test/get-bogus-artifact/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-    private static final TimeZone UTC_TIMEZONE = TimeZone.getTimeZone( "UTC" );
+        setupTestableManagedRepository( requestedResource );
 
-    private static String getLastUpdatedTimestamp( File file )
-    {
-        DateFormat fmt = new SimpleDateFormat( "yyyyMMddHHmmss", Locale.US );
-        fmt.setTimeZone( UTC_TIMEZONE );
-        return fmt.format( new Date( file.lastModified() ) );
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
+
+        // Two proxies setup, nothing fetched from remotes, local does not exist.
+        assertFetchProjectFailed( requestedResource );
+
+        // Nothing fetched.  Nothing should exist.
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
     }
 
-    private String getExpectedMetadata( String artifactId, String[] availableVersions, File file )
-        throws RepositoryMetadataException
+    public void testGetProjectMetadataProxiedNotLocalOnRemote()
+        throws Exception
     {
-        return getExpectedMetadata( artifactId, null, availableVersions, file );
+        // 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.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+
+        // One proxy setup, metadata fetched from remote, local does not exist.
+        assertFetchProject( requestedResource );
+
+        // Remote fetched.  Local created/updated.
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0.5" } );
+        assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0.5" } );
     }
 
-    private SnapshotVersion getSnapshotVersion( String timestamp, int buildNumber )
+    public void testGetProjectMetadataProxiedOnLocalMultipleRemote()
+        throws Exception
     {
-        SnapshotVersion snapshot = new SnapshotVersion();
+        // Project metadata that exist locally, and has multiple versions in remote repos
+        String requestedResource = "org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        snapshot.setTimestamp( timestamp );
-        snapshot.setBuildNumber( buildNumber );
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0" } );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
 
-        return snapshot;
+        // Two proxies setup, metadata fetched from both remotes.
+        assertFetchProject( requestedResource );
+
+        // metadata fetched from both repos, and merged with local version.
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0", "1.0.1", "2.0" } );
+        assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0", "2.0" } );
+        assertRepoProjectMetadata( ID_PROXIED2, requestedResource, new String[] { "1.0", "1.0.1" } );
     }
 
-    private String getExpectedMetadata( String artifactId, String version, SnapshotVersion snapshot, File file )
-        throws RepositoryMetadataException
+    public void testGetProjectMetadataProxiedOnLocalNotRemote()
+        throws Exception
     {
-        StringWriter expectedContents = new StringWriter();
+        // Project metadata that exist locally, and does not exist in remote repos.
+        String requestedResource = "org/apache/maven/test/get-not-on-remotes/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
-        m.setGroupId( "org.apache.maven.test" );
-        m.setArtifactId( artifactId );
-        m.setVersion( version );
-        m.setSnapshotVersion( snapshot );
-        if ( file != null )
-        {
-            m.setLastUpdated( getLastUpdatedTimestamp( file ) );
-        }
-        m.setModelEncoding( null );
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0-beta-2" } );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
+
+        // Two proxies setup, metadata fetch from remotes fail (because they dont exist).
+        assertFetchProject( requestedResource );
 
-        RepositoryMetadataWriter.write( m, expectedContents );
-        return expectedContents.toString();
+        // metadata not fetched from both repos, and local version exists.
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0-beta-2" } );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
     }
 
-    private String getExpectedMetadata( String artifactId, String version, String[] availableVersions, File file )
-        throws RepositoryMetadataException
+    public void testGetProjectMetadataProxiedOnLocalOnRemote()
+        throws Exception
     {
-        StringWriter expectedContents = new StringWriter();
+        // Project metadata that exist locally and exists on remote.
+        String requestedResource = "org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
-        m.setGroupId( "org.apache.maven.test" );
-        m.setArtifactId( artifactId );
-        m.setVersion( version );
-        if ( file != null )
-        {
-            m.setLastUpdated( getLastUpdatedTimestamp( file ) );
-        }
-        if ( availableVersions != null )
-        {
-            m.getAvailableVersions().addAll( Arrays.asList( availableVersions ) );
-        }
-        m.setModelEncoding( null );
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0.8", "1.0.22" } );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
 
-        RepositoryMetadataWriter.write( m, expectedContents );
-        return expectedContents.toString();
+        // One proxy setup, metadata fetched from remote, local exists.
+        assertFetchProject( requestedResource );
+
+        // Remote fetched.  Local updated.
+        assertProjectMetadataContents( requestedResource, new String[] { "1.0.8", "1.0.22", "2.0" } );
+        assertRepoProjectMetadata( ID_PROXIED1, requestedResource, new String[] { "1.0.22", "2.0" } );
     }
 
-    private void assertMetadataEquals( File expectedFile, File downloadedFile, String expectedMetadata )
+    /**
+     * A request for a release maven-metadata.xml file that does not exist locally, and the managed
+     * repository has no proxied repositories set up.
+     * 
+     * Expected result: the maven-metadata.xml file is not created on the managed repository, nor returned
+     *                  to the requesting client.
+     */
+    public void testGetReleaseMetadataNotProxiedNotLocal()
         throws Exception
     {
-        assertNotNull( "Expected File should not be null.", expectedFile );
-        assertNotNull( "Downloaded File should not be null.", downloadedFile );
+        // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally).
+        String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/1.0/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        assertTrue( "Check downloaded file exists.", downloadedFile.exists() );
-        assertEquals( "Check file path matches.", expectedFile.getAbsolutePath(), downloadedFile.getAbsolutePath() );
+        assertNoMetadata( requestedResource );
 
-        StringWriter actualContents = new StringWriter();
-        RepositoryMetadataReader metadataReader = new RepositoryMetadataReader();
-        ArchivaRepositoryMetadata metadata = metadataReader.read( downloadedFile );
-        RepositoryMetadataWriter.write( metadata, actualContents );
-        assertEquals( "Check file contents.", expectedMetadata, actualContents );
+        // No proxy setup, nothing fetched, failure expected.
+        assertFetchVersionedFailed( requestedResource );
+
+        // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated.
+        assertNoMetadata( requestedResource );
     }
 
-    public void testGetMetadataProxied()
+    /**
+     * A request for a maven-metadata.xml file that does exist locally, and the managed
+     * repository has no proxied repositories set up.
+     * 
+     * Expected result: the maven-metadata.xml file is updated locally, based off of the managed repository
+     *                  information, and then returned to the client.
+     */
+    public void testGetReleaseMetadataNotProxiedOnLocal()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        String requestedResource = "org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        FileUtils.deleteDirectory( expectedFile.getParentFile() );
-        assertFalse( expectedFile.exists() );
+        assertResourceExists( requestedResource );
+
+        assertFetchVersioned( requestedResource );
+
+        assertReleaseMetadataContents( requestedResource );
+    }
+
+    /**
+     * A request for a release maven-metadata.xml file that does not exist on the managed repository, but
+     * exists on multiple remote repositories.
+     * 
+     * Expected result: the maven-metadata.xml file is downloaded from the remote into the repository specific
+     *                  file location on the managed repository, a merge of the contents to the requested
+     *                  maven-metadata.xml is performed, and then the merged maven-metadata.xml file is
+     *                  returned to the client.
+     */
+    public void testGetReleaseMetadataProxiedNotLocalMultipleRemotes()
+        throws Exception
+    {
+        String requestedResource = "org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
         saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
 
-        String expectedMetadata = getExpectedMetadata( "get-default-metadata", "1.0" );
-        assertMetadataEquals( expectedFile, downloadedFile, expectedMetadata );
-        assertNoTempFiles( expectedFile );
+        assertFetchVersioned( requestedResource );
+
+        assertReleaseMetadataContents( requestedResource );
+        assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource );
+        assertRepoReleaseMetadataContents( ID_PROXIED2, requestedResource );
     }
 
-    public void testGetMetadataMergeRepos()
+    /**
+     * A request for a maven-metadata.xml file that does not exist locally, nor does it exist in a remote
+     * proxied repository.
+     * 
+     * Expected result: the maven-metadata.xml file is created locally, based off of managed repository
+     *                  information, and then return to the client.
+     */
+    public void testGetReleaseMetadataProxiedNotLocalNotRemote()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-merged-metadata/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
-
-        assertTrue( expectedFile.exists() );
+        String requestedResource = "org/apache/maven/test/get-bad-metadata/1.0/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
         saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertResourceNotFound( requestedResource );
 
-        String expectedMetadata = getExpectedMetadata( "get-merged-metadata", new String[] {
-            "0.9",
-            "1.0",
-            "2.0",
-            "3.0",
-            "5.0",
-            "4.0" }, downloadedFile );
-        assertMetadataEquals( expectedFile, downloadedFile, expectedMetadata );
-        assertNoTempFiles( expectedFile );
+        assertFetchProjectFailed( requestedResource );
+
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
     }
 
-    public void testGetMetadataRemovedFromProxies()
+    /**
+     * A request for a maven-metadata.xml file that does not exist on the managed repository, but
+     * exists on 1 remote repository.
+     * 
+     * Expected result: the maven-metadata.xml file is downloaded from the remote into the repository specific
+     *                  file location on the managed repository, a merge of the contents to the requested
+     *                  maven-metadata.xml is performed, and then the merged maven-metadata.xml file is
+     *                  returned to the client.
+     */
+    public void testGetReleaseMetadataProxiedNotLocalOnRemote()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-removed-metadata/1.0/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        String requestedResource = "org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        assertTrue( expectedFile.exists() );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+
+        assertFetchVersioned( requestedResource );
+
+        assertReleaseMetadataContents( requestedResource );
+        assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource );
+    }
+
+    /**
+     * A request for a maven-metadata.xml file that exists in the managed repository, but
+     * not on any remote repository.
+     * 
+     * Expected result: the maven-metadata.xml file does not exist on the remote proxied repository and
+     *                  is not downloaded.  There is no repository specific metadata file on the managed
+     *                  repository.  The managed repository maven-metadata.xml is returned to the
+     *                  client as-is.
+     */
+    public void testGetReleaseMetadataProxiedOnLocalNotRemote()
+        throws Exception
+    {
+        String requestedResource = "org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertReleaseMetadataContents( requestedResource );
 
-        File proxiedFile = new File( REPOPATH_PROXIED1, path );
-        assertFileEquals( expectedFile, downloadedFile, proxiedFile );
-        assertNoTempFiles( expectedFile );
+        assertFetchVersioned( requestedResource );
+
+        assertReleaseMetadataContents( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
     }
 
-    public void testGetReleaseMetadataNotExpired()
+    /**
+     * A request for a maven-metadata.xml file that exists in the managed repository, and on multiple
+     * remote repositories.
+     * 
+     * Expected result: the maven-metadata.xml file on the remote proxied repository is downloaded
+     *                  and merged into the contents of the existing managed repository copy of
+     *                  the maven-metadata.xml file.
+     */
+    public void testGetReleaseMetadataProxiedOnLocalMultipleRemote()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-updated-metadata/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        String requestedResource = "org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        assertTrue( expectedFile.exists() );
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        new File( expectedFile.getParentFile(), ".metadata-proxied1" ).setLastModified( getPastDate().getTime() );
+        assertReleaseMetadataContents( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
+
+        assertFetchVersioned( requestedResource );
+
+        assertReleaseMetadataContents( requestedResource );
+        assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource );
+        assertRepoReleaseMetadataContents( ID_PROXIED2, requestedResource );
+    }
+
+    /**
+     * A request for a maven-metadata.xml file that exists in the managed repository, and on one
+     * remote repository.
+     * 
+     * Expected result: the maven-metadata.xml file on the remote proxied repository is downloaded
+     *                  and merged into the contents of the existing managed repository copy of
+     *                  the maven-metadata.xml file.
+     */
+    public void testGetReleaseMetadataProxiedOnLocalOnRemote()
+        throws Exception
+    {
+        String requestedResource = "org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertReleaseMetadataContents( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
 
-        File proxiedFile = new File( REPOPATH_PROXIED1, path );
-        assertFileEquals( expectedFile, downloadedFile, proxiedFile );
-        assertNoTempFiles( expectedFile );
+        assertFetchVersioned( requestedResource );
+
+        assertReleaseMetadataContents( requestedResource );
+        assertRepoReleaseMetadataContents( ID_PROXIED1, requestedResource );
     }
 
-    public void testGetSnapshotMetadataNotExpired()
+    public void testGetSnapshotMetadataNotProxiedNotLocal()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally).
+        String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/1.0-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        assertTrue( expectedFile.exists() );
+        assertNoMetadata( requestedResource );
 
-        new File( expectedFile.getParentFile(), ".metadata-proxied1" ).setLastModified( getPastDate().getTime() );
+        // No proxy setup, nothing fetched, no local file, failure expected.
+        assertFetchVersionedFailed( requestedResource );
 
-        // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated.
+        assertNoMetadata( requestedResource );
+    }
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+    public void testGetSnapshotMetadataNotProxiedOnLocal()
+        throws Exception
+    {
+        // The artifactId exists locally (but not on a remote repo)
+        String requestedResource = "org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
-        // Content should NOT match that from proxied 1. 
-        assertFileEquals( expectedFile, downloadedFile, expectedFile );
-        assertNoTempFiles( expectedFile );
+        assertResourceExists( requestedResource );
+
+        // No proxy setup, nothing fetched from remote, local file exists, fetch should succeed.
+        assertFetchVersioned( requestedResource );
+
+        // Local metadata exists, should be updated to reflect the latest release.
+        assertSnapshotMetadataContents( requestedResource, "20070821", "220304", 2 );
     }
 
-    public void testGetReleaseMetadataExpired()
+    public void testGetSnapshotMetadataProxiedNotLocalMultipleRemotes()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-updated-metadata/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        String requestedResource = "org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+
+        assertResourceNotFound( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
+
+        // Proxying 2 repos, both have content, local file updated.
+        assertFetchVersioned( requestedResource );
 
-        assertTrue( expectedFile.exists() );
+        assertSnapshotMetadataContents( requestedResource, "20070101", "000103", 2 );
+        assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20061227", "112101", 2 );
+        assertRepoSnapshotMetadataContents( ID_PROXIED2, requestedResource, "20070101", "000103", 2 );
+    }
 
-        new File( expectedFile.getParentFile(), ".metadata-proxied1" ).setLastModified( getPastDate().getTime() );
+    public void testGetSnapshotMetadataProxiedNotLocalNotRemote()
+        throws Exception
+    {
+        // The artifactId "get-default-metadata-nonexistant" does not exist (intentionally).
+        String requestedResource = "org/apache/maven/test/get-default-metadata-nonexistant/1.0-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertNoMetadata( requestedResource );
 
-        String expectedMetadata = getExpectedMetadata( "get-updated-metadata", new String[] { "1.0", "2.0", },
-                                                       downloadedFile );
-        assertMetadataEquals( expectedFile, downloadedFile, expectedMetadata );
-        assertNoTempFiles( expectedFile );
+        // One proxy setup, nothing fetched, no local file, failure expected.
+        assertFetchVersionedFailed( requestedResource );
+
+        // No local artifactId, and no fetch, should equal no metadata file downloaded / created / updated.
+        assertNoMetadata( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
     }
 
-    public void testGetSnapshotMetadataExpired()
+    public void testGetSnapshotMetadataProxiedNotLocalOnRemote()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        // Artifact exists only in the proxied1 location.
+        String requestedResource = "org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        assertTrue( expectedFile.exists() );
+        assertResourceNotFound( requestedResource );
 
-        new File( expectedFile.getParentFile(), ".metadata-proxied1" ).setLastModified( getPastDate().getTime() );
+        // One proxy setup, one metadata fetched, local file created/updated.
+        assertFetchVersioned( requestedResource );
+
+        // Local artifact Id should contain latest (which in this case is from proxied download)
+        assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 );
+        assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20050831", "101112", 1 );
+    }
+
+    public void testGetSnapshotMetadataProxiedOnLocalMultipleRemote()
+        throws Exception
+    {
+        String requestedResource = "org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
-        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
+        assertSnapshotMetadataContents( requestedResource, "20070822", "021008", 3 );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
 
-        String expectedMetadata = getExpectedMetadata( "get-updated-metadata", "1.0-SNAPSHOT",
-                                                       getSnapshotVersion( "20050831.111213", 2 ), downloadedFile );
-        assertMetadataEquals( expectedFile, downloadedFile, expectedMetadata );
-        assertNoTempFiles( expectedFile );
+        // Proxying 2 repos, both have content, local file updated.
+        assertFetchVersioned( requestedResource );
+
+        assertSnapshotMetadataContents( requestedResource, "20070823", "212711", 6 );
+        assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20070822", "145534", 9 );
+        assertRepoSnapshotMetadataContents( ID_PROXIED2, requestedResource, "20070823", "212711", 6 );
     }
 
-    public void testGetMetadataNotUpdated()
+    public void testGetSnapshotMetadataProxiedOnLocalNotRemote()
         throws Exception
     {
-        String path = "org/apache/maven/test/get-updated-metadata/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        // The artifactId exists locally (but not on a remote repo)
+        String requestedResource = "org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
+
+        // Configure Connector (usually done within archiva.xml configuration)
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED2, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+
+        assertResourceExists( requestedResource );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
 
-        assertTrue( expectedFile.exists() );
+        // two proxies setup, nothing fetched from either remote, local file exists, fetch should succeed.
+        assertFetchVersioned( requestedResource );
 
-        File proxiedFile = new File( REPOPATH_PROXIED1, path );
-        new File( expectedFile.getParentFile(), ".metadata-proxied1" ).setLastModified( proxiedFile.lastModified() );
+        // Local metadata exists, repo metadatas should not exist, local file updated.
+        assertSnapshotMetadataContents( requestedResource, "20070821", "220304", 2 );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+        assertNoRepoMetadata( ID_PROXIED2, requestedResource );
+    }
+
+    public void testGetSnapshotMetadataProxiedOnLocalOnRemote()
+        throws Exception
+    {
+        // The artifactId exists locally (but not on a remote repo)
+        String requestedResource = "org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml";
+        setupTestableManagedRepository( requestedResource );
 
         // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
+        saveConnector( ID_DEFAULT_MANAGED, ID_PROXIED1, ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
                        SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
 
+        assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 );
+        assertNoRepoMetadata( ID_PROXIED1, requestedResource );
+
+        // two proxies setup, nothing fetched from either remote, local file exists, fetch should succeed.
+        assertFetchVersioned( requestedResource );
+
+        // Local metadata exists, repo metadata exists, local file updated.
+        assertSnapshotMetadataContents( requestedResource, "20050831", "101112", 1 );
+        assertRepoSnapshotMetadataContents( ID_PROXIED1, requestedResource, "20050831", "101112", 1 );
+    }
+
+    /**
+     * Transfer the metadata file.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertFetchProject( String requestedResource )
+        throws Exception
+    {
+        File expectedFile = new File( managedDefaultDir, requestedResource );
+
+        ProjectReference metadata = createProjectReference( "default", requestedResource );
+
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
 
-        assertFileEquals( expectedFile, downloadedFile, expectedFile );
+        assertNotNull( "Should have downloaded a file.", downloadedFile );
         assertNoTempFiles( expectedFile );
     }
 
-    public void testGetMetadataUpdated()
+    /**
+     * Transfer the metadata file, not expected to succeed.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertFetchProjectFailed( String requestedResource )
         throws Exception
     {
-        String path = "org/apache/maven/test/get-updated-metadata/maven-metadata.xml";
-        File expectedFile = new File( managedDefaultDir, path );
-        ProjectReference metadata = createMetadataReference( "default", path );
+        File expectedFile = new File( managedDefaultDir, requestedResource );
+        ProjectReference metadata = createProjectReference( "default", requestedResource );
 
-        assertTrue( expectedFile.exists() );
+        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
 
-        new File( expectedFile.getParentFile(), ".metadata-proxied1" ).setLastModified( getPastDate().getTime() );
+        assertNull( downloadedFile );
+        assertNoTempFiles( expectedFile );
+    }
 
-        // Configure Connector (usually done within archiva.xml configuration)
-        saveConnector( ID_DEFAULT_MANAGED, "proxied1", ChecksumPolicy.FIX, ReleasesPolicy.IGNORED,
-                       SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED );
+    /**
+     * Transfer the metadata file.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertFetchVersioned( String requestedResource )
+        throws Exception
+    {
+        File expectedFile = new File( managedDefaultDir, requestedResource );
+
+        VersionedReference metadata = createVersionedReference( "default", requestedResource );
 
         File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
 
-        String expectedMetadata = getExpectedMetadata( "get-updated-metadata", new String[] { "1.0", "2.0" },
-                                                       downloadedFile );
+        assertNotNull( "Should have downloaded a file.", downloadedFile );
+        assertNoTempFiles( expectedFile );
+    }
+
+    /**
+     * Transfer the metadata file, not expected to succeed.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertFetchVersionedFailed( String requestedResource )
+        throws Exception
+    {
+        File expectedFile = new File( managedDefaultDir, requestedResource );
+        VersionedReference metadata = createVersionedReference( "default", requestedResource );
+
+        File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, metadata );
 
-        assertMetadataEquals( expectedFile, downloadedFile, expectedMetadata );
+        assertNull( downloadedFile );
         assertNoTempFiles( expectedFile );
     }
+
+    /**
+     * Test for the existance of the requestedResource in the default managed repository.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertResourceExists( String requestedResource )
+        throws Exception
+    {
+        File actualFile = new File( managedDefaultDir, requestedResource );
+        assertTrue( "Resource should exist: " + requestedResource, actualFile.exists() );
+    }
+
+    private void assertMetadataEquals( String expectedMetadataXml, File actualFile )
+        throws Exception
+    {
+        assertNotNull( "Actual File should not be null.", actualFile );
+
+        assertTrue( "Actual file exists.", actualFile.exists() );
+
+        StringWriter actualContents = new StringWriter();
+        ArchivaRepositoryMetadata metadata = RepositoryMetadataReader.read( actualFile );
+        RepositoryMetadataWriter.write( metadata, actualContents );
+
+        DetailedDiff detailedDiff = new DetailedDiff( new Diff( expectedMetadataXml, actualContents.toString() ) );
+        if ( !detailedDiff.similar() )
+        {
+            assertEquals( expectedMetadataXml, actualContents );
+        }
+
+        // assertEquals( "Check file contents.", expectedMetadataXml, actualContents );
+    }
+
+    /**
+     * Ensures that the requested resource is not present in the managed repository.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertNoMetadata( String requestedResource )
+        throws Exception
+    {
+        File expectedFile = new File( managedDefaultDir, requestedResource );
+        assertFalse( "metadata should not exist: " + expectedFile, expectedFile.exists() );
+    }
+
+    /**
+     * Ensures that the proxied repository specific maven metadata file does NOT exist in the 
+     * managed repository.
+     * @param proxiedRepoId the proxied repository id to validate with.
+     * @param requestedResource the resource requested.
+     */
+    private void assertNoRepoMetadata( String proxiedRepoId, String requestedResource )
+    {
+        String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource );
+
+        File actualFile = new File( managedDefaultDir, proxiedFile );
+        assertFalse( "Repo specific metadata should not exist: " + actualFile, actualFile.exists() );
+    }
+
+    /**
+     * Test for the existance of the requestedResource in the default managed repository, and if it exists,
+     * does it contain the specified list of expected versions?
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertProjectMetadataContents( String requestedResource, String expectedVersions[] )
+        throws Exception
+    {
+        File actualFile = new File( managedDefaultDir, requestedResource );
+        assertTrue( actualFile.exists() );
+
+        ProjectReference metadata = createProjectReference( "default", requestedResource );
+
+        // Build expected metadata XML
+        StringWriter expectedMetadataXml = new StringWriter();
+        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
+        m.setGroupId( metadata.getGroupId() );
+        m.setArtifactId( metadata.getArtifactId() );
+
+        if ( expectedVersions != null )
+        {
+            m.getAvailableVersions().addAll( Arrays.asList( expectedVersions ) );
+        }
+
+        m.setModelEncoding( null );
+        RepositoryMetadataWriter.write( m, expectedMetadataXml );
+
+        // Compare the file to the actual contents.
+        assertMetadataEquals( expectedMetadataXml.toString(), actualFile );
+    }
+
+    /**
+     * Test for the existance of the requestedResource in the default managed repository, and if it exists,
+     * does it contain the expected release maven-metadata.xml contents?
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertReleaseMetadataContents( String requestedResource )
+        throws Exception
+    {
+        File actualFile = new File( managedDefaultDir, requestedResource );
+        assertTrue( "Release Metadata should exist: " + requestedResource, actualFile.exists() );
+
+        VersionedReference metadata = createVersionedReference( "default", requestedResource );
+
+        // Build expected metadata XML
+        StringWriter expectedMetadataXml = new StringWriter();
+        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
+        m.setGroupId( metadata.getGroupId() );
+        m.setArtifactId( metadata.getArtifactId() );
+        m.setVersion( metadata.getVersion() );
+        m.setModelEncoding( null );
+        RepositoryMetadataWriter.write( m, expectedMetadataXml );
+
+        // Compare the file to the actual contents.
+        assertMetadataEquals( expectedMetadataXml.toString(), actualFile );
+    }
+
+    /**
+     * Test for the existance of the snapshot metadata in the default managed repository, and if it exists,
+     * does it contain the expected release maven-metadata.xml contents?
+     * 
+     * @param requestedResource the requested resource
+     * @param expectedDate the date in "yyyyMMdd" format
+     * @param expectedTime the time in "hhmmss" format
+     * @param expectedBuildnumber the build number
+     * 
+     * @throws Exception 
+     */
+    private void assertSnapshotMetadataContents( String requestedResource, String expectedDate, String expectedTime,
+                                                 int expectedBuildnumber )
+        throws Exception
+    {
+        File actualFile = new File( managedDefaultDir, requestedResource );
+        assertTrue( "Snapshot Metadata should exist: " + requestedResource, actualFile.exists() );
+
+        VersionedReference actualMetadata = createVersionedReference( "default", requestedResource );
+
+        assertSnapshotMetadata( actualFile, actualMetadata, expectedDate, expectedTime, expectedBuildnumber );
+    }
+
+    /**
+     * Test for the existance of the proxied repository specific snapshot metadata in the default managed 
+     * repository, and if it exists, does it contain the expected release maven-metadata.xml contents?
+     * 
+     * @param proxiedRepoId the repository id of the proxied repository.
+     * @param requestedResource the requested resource
+     * @param expectedDate the date in "yyyyMMdd" format
+     * @param expectedTime the time in "hhmmss" format
+     * @param expectedBuildnumber the build number
+     * 
+     * @throws Exception 
+     */
+    private void assertRepoSnapshotMetadataContents( String proxiedRepoId, String requestedResource,
+                                                     String expectedDate, String expectedTime, int expectedBuildnumber )
+        throws Exception
+    {
+        String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource );
+
+        File actualFile = new File( managedDefaultDir, proxiedFile );
+        assertTrue( "Repo Specific Snapshot Metadata should exist: " + requestedResource, actualFile.exists() );
+
+        VersionedReference actualMetadata = createVersionedReference( "default", requestedResource );
+
+        assertSnapshotMetadata( actualFile, actualMetadata, expectedDate, expectedTime, expectedBuildnumber );
+    }
+
+    private void assertSnapshotMetadata( File actualFile, VersionedReference actualMetadata, String expectedDate,
+                                         String expectedTime, int expectedBuildnumber )
+        throws RepositoryMetadataException, Exception
+    {
+        // Build expected metadata XML
+        StringWriter expectedMetadataXml = new StringWriter();
+        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
+        m.setGroupId( actualMetadata.getGroupId() );
+        m.setArtifactId( actualMetadata.getArtifactId() );
+        m.setVersion( VersionUtil.getBaseVersion( actualMetadata.getVersion() ) );
+
+        m.setSnapshotVersion( new SnapshotVersion() );
+
+        if ( StringUtils.isNotBlank( expectedDate ) && StringUtils.isNotBlank( expectedTime ) )
+        {
+            m.getSnapshotVersion().setTimestamp( expectedDate + "." + expectedTime );
+        }
+
+        m.getSnapshotVersion().setBuildNumber( expectedBuildnumber );
+
+        m.setLastUpdated( expectedDate + expectedTime );
+
+        m.setModelEncoding( null );
+        RepositoryMetadataWriter.write( m, expectedMetadataXml );
+
+        // Compare the file to the actual contents.
+        assertMetadataEquals( expectedMetadataXml.toString(), actualFile );
+    }
+
+    /**
+     * Ensures that the repository specific maven metadata file exists, and contains the appropriate
+     * list of expected versions within.
+     * @param proxiedRepoId
+     * @param requestedResource
+     * @param expectedProxyVersions
+     */
+    private void assertRepoProjectMetadata( String proxiedRepoId, String requestedResource,
+                                            String[] expectedProxyVersions )
+        throws Exception
+    {
+        String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource );
+
+        File actualFile = new File( managedDefaultDir, proxiedFile );
+        assertTrue( actualFile.exists() );
+
+        ProjectReference metadata = createProjectReference( "default", requestedResource );
+
+        // Build expected metadata XML
+        StringWriter expectedMetadataXml = new StringWriter();
+        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
+        m.setGroupId( metadata.getGroupId() );
+        m.setArtifactId( metadata.getArtifactId() );
+
+        if ( expectedProxyVersions != null )
+        {
+            m.getAvailableVersions().addAll( Arrays.asList( expectedProxyVersions ) );
+        }
+
+        m.setModelEncoding( null );
+        RepositoryMetadataWriter.write( m, expectedMetadataXml );
+
+        // Compare the file to the actual contents.
+        assertMetadataEquals( expectedMetadataXml.toString(), actualFile );
+    }
+
+    /**
+     * Ensures that the repository specific maven metadata file exists, and contains the appropriate
+     * list of expected versions within.
+     * 
+     * @param proxiedRepoId
+     * @param requestedResource
+     */
+    private void assertRepoReleaseMetadataContents( String proxiedRepoId, String requestedResource )
+        throws Exception
+    {
+        String proxiedFile = metadataTools.getRepositorySpecificName( proxiedRepoId, requestedResource );
+
+        File actualFile = new File( managedDefaultDir, proxiedFile );
+        assertTrue( "Release metadata for repo should exist: " + actualFile, actualFile.exists() );
+
+        VersionedReference metadata = createVersionedReference( "default", requestedResource );
+
+        // Build expected metadata XML
+        StringWriter expectedMetadataXml = new StringWriter();
+        ArchivaRepositoryMetadata m = new ArchivaRepositoryMetadata();
+        m.setGroupId( metadata.getGroupId() );
+        m.setArtifactId( metadata.getArtifactId() );
+        m.setVersion( metadata.getVersion() );
+        m.setModelEncoding( null );
+        RepositoryMetadataWriter.write( m, expectedMetadataXml );
+
+        // Compare the file to the actual contents.
+        assertMetadataEquals( expectedMetadataXml.toString(), actualFile );
+    }
+
+    /**
+     * Test for the non-existance of the requestedResource in the default managed repository.
+     * 
+     * @param requestedResource the requested resource
+     * @throws Exception 
+     */
+    private void assertResourceNotFound( String requestedResource )
+        throws Exception
+    {
+        File actualFile = new File( managedDefaultDir, requestedResource );
+        assertFalse( "Resource should not exist: " + requestedResource, actualFile.exists() );
+    }
+
+    protected void setUp()
+        throws Exception
+    {
+        super.setUp();
+
+        metadataTools = (MetadataTools) lookup( MetadataTools.class );
+    }
+
 }

Modified: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java?rev=571008&r1=571007&r2=571008&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/SnapshotTransferTest.java Wed Aug 29 18:22:19 2007
@@ -19,17 +19,13 @@
  * under the License.
  */
 
-import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.policies.CachedFailuresPolicy;
 import org.apache.maven.archiva.policies.ChecksumPolicy;
 import org.apache.maven.archiva.policies.ReleasesPolicy;
 import org.apache.maven.archiva.policies.SnapshotsPolicy;
-import org.apache.maven.wagon.ResourceDoesNotExistException;
 
 import java.io.File;
-import java.io.IOException;
-import java.text.ParseException;
 
 /**
  * SnapshotTransferTest 
@@ -45,6 +41,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/does-not-exist/1.0-SNAPSHOT/does-not-exist-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -64,6 +62,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -85,6 +85,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -106,6 +108,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -131,6 +135,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -161,6 +167,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -190,6 +198,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -212,6 +222,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -234,6 +246,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -257,6 +271,8 @@
         throws Exception
     {
         String path = "org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 
@@ -277,10 +293,12 @@
     public void testGetMetadataDrivenSnapshotRemoteUpdate()
         throws Exception
     {
-         // Metadata driven snapshots (using a full timestamp) are treated like a release. It is the timing of the
+        // Metadata driven snapshots (using a full timestamp) are treated like a release. It is the timing of the
         // updates to the metadata files that triggers which will be downloaded
 
         String path = "org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar";
+        setupTestableManagedRepository( path );
+        
         File expectedFile = new File( managedDefaultDir, path );
         ArtifactReference artifact = createArtifactReference( "default", path );
 

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh?rev=571008&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh (added)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh Wed Aug 29 18:22:19 2007
@@ -0,0 +1,60 @@
+#!/bin/bash
+
+
+MYWD=`pwd`
+
+function makeListing()
+{
+    LISTID=$1
+
+    cd $MYWD/$LISTID
+    find . -type f -not -wholename "*/\.*" | sort > $MYWD/$LISTID.tmp
+}
+
+function isInRepo()
+{
+    LISTID=$1
+    FILEID=$2
+
+    grep -q "$FILEID" $MYWD/$LISTID.tmp
+    RETCODE=$?
+    if [ $RETCODE -eq 0 ] ; then
+        LISTID=${LISTID/proxied/}
+        echo "[${LISTID:0:1}]"
+    else
+        echo "   "
+    fi
+}
+
+makeListing "managed"
+makeListing "proxied1"
+makeListing "proxied2"
+
+cd $MYWD
+
+TS=`date`
+
+echo "$0 - executed on $TS"
+echo ""
+echo "Determining location of files."
+echo " Key: [m] == managed"
+echo "      [1] == proxy 1 (proxied1)"
+echo "      [2] == proxy 2 (proxied2)"
+echo ""
+echo " -m- -1- -2- | -------------------------------------------- "
+
+FILELIST=`cat managed.tmp proxied1.tmp proxied2.tmp | sort -u`
+
+for FF in $FILELIST
+do
+    INMANAGED=`isInRepo "managed" "$FF"`
+    INPROXY1=`isInRepo "proxied1" "$FF"`
+    INPROXY2=`isInRepo "proxied2" "$FF"`
+
+    echo " $INMANAGED $INPROXY1 $INPROXY2 | $FF"
+done
+
+echo " --- --- --- | -------------------------------------------- "
+
+rm -f managed.tmp proxied1.tmp proxied2.tmp
+

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/create-managed-to-proxy-map.sh
------------------------------------------------------------------------------
    svn:keywords = Id

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt?rev=571008&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt (added)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt Wed Aug 29 18:22:19 2007
@@ -0,0 +1,89 @@
+./create-managed-to-proxy-map.sh - executed on Wed Aug 29 18:17:23 MST 2007
+
+Determining location of files.
+ Key: [m] == managed
+      [1] == proxy 1 (proxied1)
+      [2] == proxy 2 (proxied2)
+
+ -m- -1- -2- | -------------------------------------------- 
+ [m] [1]     | ./org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar
+ [m]         | ./org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.md5
+ [m]         | ./org/apache/maven/test/get-bad-local-checksum/1.0/get-bad-local-checksum-1.0.jar.sha1
+     [1]     | ./org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar
+     [1]     | ./org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.md5
+     [1]     | ./org/apache/maven/test/get-checksum-both-bad/1.0/get-checksum-both-bad-1.0.jar.sha1
+     [1]     | ./org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar
+     [1]     | ./org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.md5
+     [1]     | ./org/apache/maven/test/get-checksum-both-right/1.0/get-checksum-both-right-1.0.jar.sha1
+ [m] [1]     | ./org/apache/maven/test/get-checksum-from-managed-repo/1.0/get-checksum-from-managed-repo-1.0.jar.sha1
+     [1]     | ./org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar
+     [1]     | ./org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.md5
+     [1]     | ./org/apache/maven/test/get-checksum-md5-bad-sha1/1.0/get-checksum-md5-bad-sha1-1.0.jar.sha1
+     [1]     | ./org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar
+     [1]     | ./org/apache/maven/test/get-checksum-md5-only/1.0/get-checksum-md5-only-1.0.jar.md5
+     [1]     | ./org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar
+     [1]     | ./org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.md5
+     [1]     | ./org/apache/maven/test/get-checksum-sha1-bad-md5/1.0/get-checksum-sha1-bad-md5-1.0.jar.sha1
+     [1]     | ./org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar
+     [1]     | ./org/apache/maven/test/get-checksum-sha1-only/1.0/get-checksum-sha1-only-1.0.jar.sha1
+         [2] | ./org/apache/maven/test/get-default-layout/1.0.1/get-default-layout-1.0.1.pom
+     [1] [2] | ./org/apache/maven/test/get-default-layout/1.0/get-default-layout-1.0.jar
+     [1] [2] | ./org/apache/maven/test/get-default-layout/1.0/maven-metadata.xml
+     [1] [2] | ./org/apache/maven/test/get-default-layout/maven-metadata.xml
+ [m] [1]     | ./org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar
+ [m]         | ./org/apache/maven/test/get-default-layout-present/1.0/get-default-layout-present-1.0.jar.md5
+ [m]         | ./org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.jar
+ [m]         | ./org/apache/maven/test/get-default-layout-present-with-pom/1.0/get-default-layout-present-with-pom-1.0.pom
+ [m]         | ./org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar
+ [m] [1]     | ./org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-doubly-relocated-artefact/1.0/get-doubly-relocated-artefact-1.0.pom
+     [1]     | ./org/apache/maven/test/get-found-in-proxy/1.0.5/get-found-in-proxy-1.0.5-javadoc.jar
+     [1]     | ./org/apache/maven/test/get-found-in-proxy/maven-metadata.xml
+     [1] [2] | ./org/apache/maven/test/get-in-both-proxies/1.0/get-in-both-proxies-1.0.jar
+         [2] | ./org/apache/maven/test/get-in-second-proxy/1.0/get-in-second-proxy-1.0.jar
+ [m] [1] [2] | ./org/apache/maven/test/get-merged-metadata/maven-metadata.xml
+     [1]     | ./org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/get-metadata-snapshot-1.0-20050831.101112-1.jar
+     [1]     | ./org/apache/maven/test/get-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar
+ [m]         | ./org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-not-on-remotes/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-on-local-on-remote/1.0.22/get-on-local-on-remote-1.0.22.pom
+ [m] [1]     | ./org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-on-local-on-remote/1.0.8/get-on-local-on-remote-1.0.8.pom
+ [m] [1]     | ./org/apache/maven/test/get-on-local-on-remote/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-on-multiple-repos/1.0/get-on-multiple-repos-1.0.pom
+ [m] [1] [2] | ./org/apache/maven/test/get-on-multiple-repos/1.0/maven-metadata.xml
+ [m] [1] [2] | ./org/apache/maven/test/get-on-multiple-repos/maven-metadata.xml
+ [m] [1]     | ./org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/get-present-metadata-snapshot-1.0-20050831.101112-1.jar
+ [m] [1]     | ./org/apache/maven/test/get-present-metadata-snapshot/1.0-SNAPSHOT/maven-metadata.xml
+ [m] [1]     | ./org/apache/maven/test/get-present-timestamped-snapshot/1.0-SNAPSHOT/get-present-timestamped-snapshot-1.0-SNAPSHOT.jar
+ [m]         | ./org/apache/maven/test/get-project-metadata/1.0/get-project-metadata-1.0.jar
+ [m]         | ./org/apache/maven/test/get-project-metadata/1.1/get-project-metadata-1.1.jar
+ [m]         | ./org/apache/maven/test/get-project-metadata/2.0/get-project-metadata-2.0.pom
+ [m]         | ./org/apache/maven/test/get-project-metadata/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-release-metadata/2.2/get-release-metadata-2.2.jar
+ [m]         | ./org/apache/maven/test/get-release-metadata/2.2/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-relocated-artefact/1.0/get-relocated-artefact-1.0.pom
+ [m]         | ./org/apache/maven/test/get-relocated-artefact-with-pom/1.0/get-relocated-artefact-with-pom-1.0.pom
+ [m]         | ./org/apache/maven/test/get-removed-from-proxies/1.0/get-removed-from-proxies-1.0.jar
+ [m]         | ./org/apache/maven/test/get-removed-metadata/1.0/maven-metadata.xml
+ [m]         | ./org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.123456-1.jar
+ [m]         | ./org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/get-snapshot-on-local-not-remote-2.0-alpha-2-20070821.220304-2.jar
+ [m]         | ./org/apache/maven/test/get-snapshot-on-local-not-remote/2.0-alpha-2-SNAPSHOT/maven-metadata.xml
+     [1]     | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070819.040004-1.jar
+ [m]     [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.102030-1.jar
+ [m]         | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070821.185701-2.jar
+ [m]         | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.021008-3.jar
+     [1]     | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070822.145534-9.jar
+         [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.111741-5.jar
+         [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/get-snapshot-popular-2.0-20070823.212711-6.jar
+ [m] [1] [2] | ./org/apache/maven/test/get-snapshot-popular/2.0-SNAPSHOT/maven-metadata.xml
+     [1]     | ./org/apache/maven/test/get-timestamped-snapshot/1.0-SNAPSHOT/get-timestamped-snapshot-1.0-SNAPSHOT.jar
+     [1] [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061222.034118-1.jar
+     [1]     | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20061227.112101-2.jar
+         [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-20070101.000103-2.jar
+     [1] [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/get-timestamped-snapshot-in-both-1.0-SNAPSHOT.jar
+     [1] [2] | ./org/apache/maven/test/get-timestamped-snapshot-in-both/1.0-SNAPSHOT/maven-metadata.xml
+ [m] [1]     | ./org/apache/maven/test/get-updated-metadata/1.0-SNAPSHOT/maven-metadata.xml
+ [m] [1]     | ./org/apache/maven/test/get-updated-metadata/maven-metadata.xml
+ --- --- --- | -------------------------------------------- 

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed-to-proxy-map.txt
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar?rev=571008&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/get-default-metadata-1.0.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml?rev=571008&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml Wed Aug 29 18:22:19 2007
@@ -0,0 +1,24 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<metadata>
+	<groupId>org.apache.maven.test</groupId>
+	<artifactId>get-default-metadata</artifactId>
+	<version>1.0</version>
+</metadata>
\ No newline at end of file

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-default-metadata/1.0/maven-metadata.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar?rev=571008&view=auto
==============================================================================
Binary file - no diff available.

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/get-not-on-remotes-1.0-beta-2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/java-archive

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml?rev=571008&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml Wed Aug 29 18:22:19 2007
@@ -0,0 +1,24 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<metadata>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-not-on-remotes</artifactId>
+  <version>1.0-beta-2</version>
+</metadata>

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/1.0-beta-2/maven-metadata.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml?rev=571008&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml Wed Aug 29 18:22:19 2007
@@ -0,0 +1,28 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<metadata>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-not-on-remotes</artifactId>
+  <versioning>
+    <versions>
+      <version>1.0-beta-2</version>
+    </versions>
+  </versioning>
+</metadata>

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml
------------------------------------------------------------------------------
    svn:keywords = "Author Date Id Revision"

Propchange: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-not-on-remotes/maven-metadata.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/get-on-local-on-remote-1.0.22.pom
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/get-on-local-on-remote-1.0.22.pom?rev=571008&view=auto
==============================================================================
    (empty)

Added: maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml?rev=571008&view=auto
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml (added)
+++ maven/archiva/trunk/archiva-base/archiva-proxy/src/test/repositories/managed/org/apache/maven/test/get-on-local-on-remote/1.0.22/maven-metadata.xml Wed Aug 29 18:22:19 2007
@@ -0,0 +1,24 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<metadata>
+  <groupId>org.apache.maven.test</groupId>
+  <artifactId>get-on-local-on-remote</artifactId>
+  <version>1.0.22</version>
+</metadata>



Mime
View raw message