diff options
author | Brett Porter <brett@apache.org> | 2007-09-16 03:30:54 +0000 |
---|---|---|
committer | Brett Porter <brett@apache.org> | 2007-09-16 03:30:54 +0000 |
commit | 20ed6eb36238fbe5af3efc8ccbf2d95da75c8952 (patch) | |
tree | cae5d1886a8e1ece1c9a7b8caa14b63a888e3ad0 /archiva-base | |
parent | 0ba9ea290cdcd9a4a2273e8707c08230ffe06632 (diff) | |
download | archiva-20ed6eb36238fbe5af3efc8ccbf2d95da75c8952.tar.gz archiva-20ed6eb36238fbe5af3efc8ccbf2d95da75c8952.zip |
[MRM-211] fix proxy tests for legacy, and correct handling of Maven 1.x plugins
git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@576029 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-base')
3 files changed, 31 insertions, 2 deletions
diff --git a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java index 1c436287c..08163e452 100644 --- a/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java +++ b/archiva-base/archiva-proxy/src/test/java/org/apache/maven/archiva/proxy/ManagedDefaultTransferTest.java @@ -376,7 +376,34 @@ public class ManagedDefaultTransferTest setupTestableManagedRepository( path ); File expectedFile = new File( managedDefaultDir, path ); - ArtifactReference artifact = createArtifactReference( "default", path ); + ArtifactReference artifact = createArtifactReference( "legacy", legacyPath ); + + expectedFile.delete(); + assertFalse( expectedFile.exists() ); + + // Configure Connector (usually done within archiva.xml configuration) + saveConnector( ID_DEFAULT_MANAGED, ID_LEGACY_PROXIED, ChecksumPolicy.IGNORED, ReleasesPolicy.IGNORED, + SnapshotsPolicy.IGNORED, CachedFailuresPolicy.IGNORED ); + + File downloadedFile = proxyHandler.fetchFromProxies( managedDefaultRepository, artifact ); + + File proxiedFile = new File( REPOPATH_PROXIED_LEGACY, legacyPath ); + assertFileEquals( expectedFile, downloadedFile, proxiedFile ); + assertNoTempFiles( expectedFile ); + } + + public void testLegacyRequestPluginConvertedToDefaultPathInManagedRepo() + throws Exception + { + // Check that a Maven1 legacy request is translated to a maven2 path in + // the managed repository. + + String legacyPath = "org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar"; + String path = "org/apache/maven/test/get-legacy-plugin/1.0/get-legacy-plugin-1.0.jar"; + setupTestableManagedRepository( path ); + + File expectedFile = new File( managedDefaultDir, path ); + ArtifactReference artifact = createArtifactReference( "legacy", legacyPath ); expectedFile.delete(); assertFalse( expectedFile.exists() ); diff --git a/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar b/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar new file mode 100644 index 000000000..77dbb7858 --- /dev/null +++ b/archiva-base/archiva-proxy/src/test/repositories/legacy-proxied/org.apache.maven.test/plugins/get-legacy-plugin-1.0.jar @@ -0,0 +1 @@ +get-default-layout-1.0.jar diff --git a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java index f95a62707..cedbb7b41 100644 --- a/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java +++ b/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractArtifactExtensionMapping.java @@ -23,7 +23,7 @@ import java.util.HashMap; import java.util.Map; /** - * AbstractArtifactExtensionMapping + * AbstractArtifactExtensionMapping * * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a> * @version $Id$ @@ -44,6 +44,7 @@ public abstract class AbstractArtifactExtensionMapping typeToExtensionMap.put( "javadoc", "jar" ); typeToExtensionMap.put( "aspect", "jar" ); typeToExtensionMap.put( "uberjar", "jar" ); + typeToExtensionMap.put( "plugin", "jar" ); typeToExtensionMap.put( "maven-plugin", "jar" ); typeToExtensionMap.put( "maven-archetype", "jar" ); } |