You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@archiva.apache.org by oc...@apache.org on 2007/11/20 12:12:54 UTC

svn commit: r596620 - in /maven/archiva/trunk/archiva-base/archiva-repository-layer/src: main/java/org/apache/maven/archiva/repository/content/ test/java/org/apache/maven/archiva/repository/content/ test/repositories/legacy-repository/org.apache.maven/...

Author: oching
Date: Tue Nov 20 03:12:47 2007
New Revision: 596620

URL: http://svn.apache.org/viewvc?rev=596620&view=rev
Log:
[MRM-596]
applied patch submitted by nicolas de loof

- remove the assertion that legacy path have no classifier. Simply have no way to support unstandard classifiers.
- automatically use "-javadoc" and "-sources" classifiers for path with types "javadoc.jars" and "java-sources". Check for the classifier to 
be detected in the version string and remove it.

Added:
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/java-sources/
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/java-sources/testing-1.0-sources.jar
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadoc.jars/
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar
Removed:
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/jars/testing-1.0-sources.jar
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadocs/
Modified:
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
    maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java?rev=596620&r1=596619&r2=596620&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContent.java Tue Nov 20 03:12:47 2007
@@ -35,10 +35,6 @@
  */
 public abstract class AbstractLegacyRepositoryContent
 {
-    private static final String DIR_JAVADOC = "javadoc.jars";
-
-    private static final String DIR_JAVA_SOURCE = "java-sources";
-
     private static final String PATH_SEPARATOR = "/";
 
     private static final Map<String, String> typeToDirectoryMap;
@@ -50,6 +46,7 @@
         typeToDirectoryMap.put( ArtifactExtensionMapping.MAVEN_PLUGIN, "plugin" );
         typeToDirectoryMap.put( "distribution-tgz", "distribution" );
         typeToDirectoryMap.put( "distribution-zip", "distribution" );
+        typeToDirectoryMap.put( "javadoc", "javadoc.jar" );
     }
 
     public ArtifactReference toArtifactReference( String path )
@@ -57,7 +54,7 @@
     {
         return LegacyPathParser.toArtifactReference( path );
     }
-    
+
     public String toPath( ArchivaArtifact reference )
     {
         if ( reference == null )
@@ -104,21 +101,6 @@
 
     private String getDirectory( String classifier, String type )
     {
-        // Special Cases involving type + classifier
-        if ( "jar".equals( type ) && StringUtils.isNotBlank( classifier ) )
-        {
-            if ( "sources".equals( classifier ) )
-            {
-                return DIR_JAVA_SOURCE;
-            }
-
-            if ( "javadoc".equals( classifier ) )
-            {
-                return DIR_JAVADOC;
-            }
-        }
-
-        // Special Cases involving only type.
         String dirname = (String) typeToDirectoryMap.get( type );
 
         if ( dirname != null )

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java?rev=596620&r1=596619&r2=596620&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/content/LegacyPathParser.java Tue Nov 20 03:12:47 2007
@@ -157,6 +157,19 @@
             }
         }
 
+        String classifier = ArtifactClassifierMapping.getClassifier( artifact.getType() );
+        if ( classifier != null )
+        {
+            String version = artifact.getVersion();
+            if ( ! version.endsWith( "-" + classifier ) )
+            {
+                throw new LayoutException( INVALID_ARTIFACT_PATH + expectedType + " artifacts must use the classifier " + classifier );
+            }
+            version = version.substring( 0, version.length() - classifier.length() - 1 );
+            artifact.setVersion( version );
+            artifact.setClassifier( classifier );
+        }
+
         return artifact;
     }
 }

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java?rev=596620&r1=596619&r2=596620&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/AbstractLegacyRepositoryContentTestCase.java Tue Nov 20 03:12:47 2007
@@ -72,13 +72,13 @@
         String type = "jar";
         String path = "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
-    /** 
+    /**
      * [MRM-432] Oddball version spec.
      * Example of an oddball / unusual version spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodButOddVersionSpecJavaxComm()
         throws LayoutException
@@ -89,13 +89,13 @@
         String type = "jar";
         String path = "javax/jars/comm-3.0-u1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
-    /** 
+    /**
      * [MRM-432] Oddball version spec.
      * Example of an oddball / unusual version spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodButOddVersionSpecJavaxPersistence()
         throws LayoutException
@@ -106,12 +106,12 @@
         String type = "jar";
         String path = "javax.persistence/jars/ejb-3.0-public_review.jar";
 
-        /* 
+        /*
          * The version id of "public_review" can cause problems. is it part of
          * the version spec? or the classifier?
          */
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodCommonsLang()
@@ -123,7 +123,7 @@
         String type = "jar";
         String path = "commons-lang/jars/commons-lang-2.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodDerby()
@@ -135,16 +135,16 @@
         String type = "jar";
         String path = "org.apache.derby/jars/derby-10.2.2.0.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
      * Test the ejb-client type spec.
-     * Type specs are not a 1 to 1 map to the extension. 
+     * Type specs are not a 1 to 1 map to the extension.
      * This tests that effect.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
-    /* TODO: Re-enabled in the future. 
+    /* TODO: Re-enabled in the future.
     public void testGoodFooEjbClient()
         throws LayoutException
     {
@@ -160,34 +160,36 @@
 
     /**
      * Test the classifier.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodFooLibJavadoc()
         throws LayoutException
     {
         String groupId = "com.foo.lib";
         String artifactId = "foo-lib";
-        String version = "2.1-alpha-1-javadoc";
+        String version = "2.1-alpha-1";
         String type = "javadoc";
-        String path = "com.foo.lib/javadocs/foo-lib-2.1-alpha-1-javadoc.jar";
+        String classifier = "javadoc";
+        String path = "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-javadoc.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, classifier, type );
     }
 
     /**
      * Test the classifier, and java-source type spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodFooLibSources()
         throws LayoutException
     {
         String groupId = "com.foo.lib";
         String artifactId = "foo-lib";
-        String version = "2.1-alpha-1-sources";
+        String version = "2.1-alpha-1";
         String type = "java-source"; // oddball type-spec (should result in jar extension)
+        String classifier = "sources";
         String path = "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-sources.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, classifier, type );
     }
 
     public void testGoodFooTool()
@@ -199,7 +201,7 @@
         String type = "jar";
         String path = "com.foo/jars/foo-tool-1.0.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodGeronimoEjbSpec()
@@ -211,7 +213,7 @@
         String type = "jar";
         String path = "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodLdapClientsPom()
@@ -223,12 +225,12 @@
         String type = "pom";
         String path = "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
      * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodSnapshotMavenTest()
         throws LayoutException
@@ -239,7 +241,7 @@
         String type = "jar";
         String path = "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
@@ -256,9 +258,9 @@
 
         String path = "maven/poms/maven-test-plugin-1.8.2.pom";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      * Example uses "test" in artifact Id, which is also part of the versionKeyword list.
@@ -272,9 +274,9 @@
         String type = "maven-plugin";
         String path = "maven/plugins/maven-test-plugin-1.8.2.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      */
@@ -287,9 +289,9 @@
         String type = "maven-plugin";
         String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      */
@@ -302,9 +304,9 @@
         String type = "maven-plugin";
         String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      */
@@ -317,33 +319,34 @@
         String type = "maven-plugin";
         String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
      * Perform a roundtrip through the layout routines to determine success.
+     * @param classifier TODO
      */
-    private void assertLayout( String path, String groupId, String artifactId, String version, String type )
+    private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, String type )
         throws LayoutException
     {
-        ArtifactReference expectedArtifact = createArtifact( groupId, artifactId, version, type );
+        ArtifactReference expectedArtifact = createArtifact( groupId, artifactId, version, classifier, type );
 
         // --- Artifact Tests.
-        // Artifact to Path 
+        // Artifact to Path
         assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( expectedArtifact ) );
 
         // --- Artifact Reference Tests
 
         // Path to Artifact Reference.
         ArtifactReference testReference = toArtifactReference( path );
-        assertArtifactReference( testReference, groupId, artifactId, version, type );
+        assertArtifactReference( testReference, groupId, artifactId, version, classifier, type );
 
         // And back again, using test Reference from previous step.
         assertEquals( "Artifact <" + expectedArtifact + "> to path:", path, toPath( testReference ) );
     }
-    
+
     private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId,
-                                          String version, String type )
+                                          String version, String classifier, String type )
     {
         String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + type;
 
@@ -352,17 +355,17 @@
         assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() );
         assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() );
         assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() );
+        assertEquals( expectedId + " - classifier", classifier, actualReference.getClassifier() );
         assertEquals( expectedId + " - Type", type, actualReference.getType() );
-        // legacy has no classifier.
-        assertNull( expectedId + " - classifier", actualReference.getClassifier() );
     }
-    
-    protected ArtifactReference createArtifact( String groupId, String artifactId, String version, String type )
+
+    protected ArtifactReference createArtifact( String groupId, String artifactId, String version, String classifier, String type )
     {
         ArtifactReference artifact = new ArtifactReference();
         artifact.setGroupId( groupId );
         artifact.setArtifactId( artifactId );
         artifact.setVersion( version );
+        artifact.setClassifier( classifier );
         artifact.setType( type );
         assertNotNull( artifact );
         return artifact;

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java?rev=596620&r1=596619&r2=596620&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/LegacyPathParserTest.java Tue Nov 20 03:12:47 2007
@@ -25,7 +25,7 @@
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
 /**
- * LegacyPathParserTest 
+ * LegacyPathParserTest
  *
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @version $Id$
@@ -58,9 +58,9 @@
     {
         assertBadPath( "org.apache.maven.test/jars/artifactId-1.0.war", "wrong package extension" );
     }
-    
-    /** 
-     * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error 
+
+    /**
+     * [MRM-481] Artifact requests with a .xml.zip extension fail with a 404 Error
      */
     public void testGoodButDualExtensions()
         throws LayoutException
@@ -71,13 +71,13 @@
         String type = "distribution-zip";
         String path = "org.project/zips/example-presentation-3.2.xml.zip";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
-    /** 
+    /**
      * [MRM-432] Oddball version spec.
      * Example of an oddball / unusual version spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodButOddVersionSpecGanymedSsh2()
         throws LayoutException
@@ -88,13 +88,13 @@
         String type = "jar";
         String path = "ch.ethz.ganymed/jars/ganymed-ssh2-build210.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
-    /** 
+    /**
      * [MRM-432] Oddball version spec.
      * Example of an oddball / unusual version spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodButOddVersionSpecJavaxComm()
         throws LayoutException
@@ -105,13 +105,13 @@
         String type = "jar";
         String path = "javax/jars/comm-3.0-u1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
-    /** 
+    /**
      * [MRM-432] Oddball version spec.
      * Example of an oddball / unusual version spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodButOddVersionSpecJavaxPersistence()
         throws LayoutException
@@ -122,12 +122,12 @@
         String type = "jar";
         String path = "javax.persistence/jars/ejb-3.0-public_review.jar";
 
-        /* 
+        /*
          * The version id of "public_review" can cause problems. is it part of
          * the version spec? or the classifier?
          */
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodCommonsLang()
@@ -139,7 +139,7 @@
         String type = "jar";
         String path = "commons-lang/jars/commons-lang-2.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodDerby()
@@ -151,16 +151,16 @@
         String type = "jar";
         String path = "org.apache.derby/jars/derby-10.2.2.0.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
      * Test the ejb-client type spec.
-     * Type specs are not a 1 to 1 map to the extension. 
+     * Type specs are not a 1 to 1 map to the extension.
      * This tests that effect.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
-    /* TODO: Re-enabled in the future. 
+    /* TODO: Re-enabled in the future.
     public void testGoodFooEjbClient()
         throws LayoutException
     {
@@ -176,34 +176,36 @@
 
     /**
      * Test the classifier.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodFooLibJavadoc()
         throws LayoutException
     {
         String groupId = "com.foo.lib";
         String artifactId = "foo-lib";
-        String version = "2.1-alpha-1-javadoc";
+        String version = "2.1-alpha-1";
         String type = "javadoc";
-        String path = "com.foo.lib/javadocs/foo-lib-2.1-alpha-1-javadoc.jar";
+        String classifier = "javadoc";
+        String path = "com.foo.lib/javadoc.jars/foo-lib-2.1-alpha-1-javadoc.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, classifier, type );
     }
 
     /**
      * Test the classifier, and java-source type spec.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodFooLibSources()
         throws LayoutException
     {
         String groupId = "com.foo.lib";
         String artifactId = "foo-lib";
-        String version = "2.1-alpha-1-sources";
+        String version = "2.1-alpha-1";
         String type = "java-source"; // oddball type-spec (should result in jar extension)
+        String classifier= "sources";
         String path = "com.foo.lib/java-sources/foo-lib-2.1-alpha-1-sources.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, classifier, type );
     }
 
     public void testGoodFooTool()
@@ -215,7 +217,7 @@
         String type = "jar";
         String path = "com.foo/jars/foo-tool-1.0.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodGeronimoEjbSpec()
@@ -227,7 +229,7 @@
         String type = "jar";
         String path = "org.apache.geronimo.specs/jars/geronimo-ejb_2.1_spec-1.0.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     public void testGoodLdapClientsPom()
@@ -239,12 +241,12 @@
         String type = "pom";
         String path = "directory-clients/poms/ldap-clients-0.9.1-SNAPSHOT.pom";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
      * A timestamped versioned artifact, should reside in a SNAPSHOT baseversion directory.
-     * @throws LayoutException 
+     * @throws LayoutException
      */
     public void testGoodSnapshotMavenTest()
         throws LayoutException
@@ -255,7 +257,7 @@
         String type = "jar";
         String path = "org.apache.archiva.test/jars/redonkulous-3.1-beta-1-20050831.101112-42.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
@@ -272,9 +274,9 @@
 
         String path = "maven/poms/maven-test-plugin-1.8.2.pom";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      * Example uses "test" in artifact Id, which is also part of the versionKeyword list.
@@ -288,9 +290,9 @@
         String type = "maven-plugin";
         String path = "maven/plugins/maven-test-plugin-1.8.2.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      */
@@ -303,9 +305,9 @@
         String type = "maven-plugin";
         String path = "avalon-meta/plugins/avalon-meta-plugin-1.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      */
@@ -318,9 +320,9 @@
         String type = "maven-plugin";
         String path = "cactus/plugins/cactus-maven-1.7dev-20040815.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
-    
+
     /**
      * [MRM-562] Artifact type "maven-plugin" is not detected correctly in .toArtifactReference() methods.
      */
@@ -333,22 +335,23 @@
         String type = "maven-plugin";
         String path = "geronimo/plugins/geronimo-packaging-plugin-1.0.1.jar";
 
-        assertLayout( path, groupId, artifactId, version, type );
+        assertLayout( path, groupId, artifactId, version, null, type );
     }
 
     /**
-     * Perform a path to artifact reference lookup, and verify the results. 
+     * Perform a path to artifact reference lookup, and verify the results.
+     * @param classifier TODO
      */
-    private void assertLayout( String path, String groupId, String artifactId, String version, String type )
+    private void assertLayout( String path, String groupId, String artifactId, String version, String classifier, String type )
         throws LayoutException
     {
         // Path to Artifact Reference.
         ArtifactReference testReference = LegacyPathParser.toArtifactReference( path );
-        assertArtifactReference( testReference, groupId, artifactId, version, type );
+        assertArtifactReference( testReference, groupId, artifactId, version, classifier, type );
     }
 
     private void assertArtifactReference( ArtifactReference actualReference, String groupId, String artifactId,
-                                          String version, String type )
+                                          String version, String classifier, String type )
     {
         String expectedId = "ArtifactReference - " + groupId + ":" + artifactId + ":" + version + ":" + type;
 
@@ -357,9 +360,8 @@
         assertEquals( expectedId + " - Group ID", groupId, actualReference.getGroupId() );
         assertEquals( expectedId + " - Artifact ID", artifactId, actualReference.getArtifactId() );
         assertEquals( expectedId + " - Version ID", version, actualReference.getVersion() );
+        assertEquals( expectedId + " - classifier", classifier, actualReference.getClassifier() );
         assertEquals( expectedId + " - Type", type, actualReference.getType() );
-        // legacy has no classifier.
-        assertNull( expectedId + " - classifier", actualReference.getClassifier() );
     }
 
     protected void assertBadPath( String path, String reason )

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java?rev=596620&r1=596619&r2=596620&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/ManagedLegacyRepositoryContentTest.java Tue Nov 20 03:12:47 2007
@@ -34,7 +34,7 @@
 import java.util.Set;
 
 /**
- * ManagedLegacyRepositoryContentTest 
+ * ManagedLegacyRepositoryContentTest
  *
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @version $Id$
@@ -49,8 +49,8 @@
     {
         assertVersions( "org.apache.maven", "testing", new String[] {
             "UNKNOWN",
-            "1.0-javadoc",
-            "1.0-sources",
+//            "1.0-javadoc",
+//            "1.0-sources",
             "1.0",
             "1.0-20050611.112233-1" } );
     }
@@ -59,8 +59,8 @@
         throws Exception
     {
         assertVersions( "org.apache.maven", "testing", "1.0", new String[] {
-            "1.0-javadoc",
-            "1.0-sources",
+//            "1.0-javadoc",
+//            "1.0-sources",
             "1.0",
             "1.0-20050611.112233-1" } );
     }
@@ -119,7 +119,7 @@
     public void testGetRelatedArtifacts()
         throws Exception
     {
-        ArtifactReference reference = createArtifact( "org.apache.maven", "testing", "1.0", "jar" );
+        ArtifactReference reference = createArtifact( "org.apache.maven", "testing", "1.0", null, "jar" );
 
         Set<ArtifactReference> related = repoContent.getRelatedArtifacts( reference );
         assertNotNull( related );
@@ -129,7 +129,7 @@
             "org.apache.maven/java-sources/testing-1.0-sources.jar",
             "org.apache.maven/jars/testing-1.0-20050611.112233-1.jar",
             "org.apache.maven/poms/testing-1.0.pom",
-            "org.apache.maven/javadocs/testing-1.0-javadoc.jar" };
+            "org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar" };
 
         StringBuffer relatedDebugString = new StringBuffer();
         relatedDebugString.append( "[" );

Modified: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java?rev=596620&r1=596619&r2=596620&view=diff
==============================================================================
--- maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java (original)
+++ maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/java/org/apache/maven/archiva/repository/content/RepositoryRequestTest.java Tue Nov 20 03:12:47 2007
@@ -28,7 +28,7 @@
 import java.io.File;
 
 /**
- * RepositoryRequestTest 
+ * RepositoryRequestTest
  *
  * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
  * @version $Id$
@@ -112,8 +112,8 @@
     public void testValidLegacyCommonsLangJavadoc()
         throws Exception
     {
-        assertValid( "commons-lang/jars/commons-lang-2.1-javadoc.jar", "commons-lang", "commons-lang", "2.1-javadoc",
-                     null, "javadoc" );
+        assertValid( "commons-lang/javadoc.jars/commons-lang-2.1-javadoc.jar", "commons-lang", "commons-lang", "2.1",
+                     "javadoc", "javadoc" );
     }
 
     public void testValidDefaultCommonsLangJavadoc()

Added: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/java-sources/testing-1.0-sources.jar
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/java-sources/testing-1.0-sources.jar?rev=596620&view=auto
==============================================================================
    (empty)

Added: maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar
URL: http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-repository-layer/src/test/repositories/legacy-repository/org.apache.maven/javadoc.jars/testing-1.0-javadoc.jar?rev=596620&view=auto
==============================================================================
    (empty)