]> source.dussan.org Git - archiva.git/commitdiff
Applying Tom Huybrechts patch rom MRM-226. Stops the indexer blo
authorHenri Yandell <bayard@apache.org>
Thu, 16 Nov 2006 22:54:32 +0000 (22:54 +0000)
committerHenri Yandell <bayard@apache.org>
Thu, 16 Nov 2006 22:54:32 +0000 (22:54 +0000)
wing up when it hits it and thinks its a -sources for a foo-test artifact

git-svn-id: https://svn.apache.org/repos/asf/maven/archiva/trunk@475959 13f79535-47bb-0310-9956-ffa450edef68

archiva-discoverer/src/main/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscoverer.java
archiva-discoverer/src/test/java/org/apache/maven/archiva/discoverer/DefaultArtifactDiscovererTest.java
archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar [new file with mode: 0644]

index f72f82eed9b35b9a8fb4f57ae313cc6a79b334c4..86dbc9f620b103cdca198ec5952b4def8b87d8e5 100644 (file)
@@ -87,6 +87,13 @@ public class DefaultArtifactDiscoverer
                     type = "distribution-zip";
                     remainingFilename = remainingFilename.substring( 0, remainingFilename.length() - ".zip".length() );
                 }
+                else if ( remainingFilename.endsWith( "-test-sources.jar" ) )
+                {
+                    type = "java-source";
+                    classifier = "test-sources";
+                    remainingFilename =
+                        remainingFilename.substring( 0, remainingFilename.length() - "-test-sources.jar".length() );
+                }
                 else if ( remainingFilename.endsWith( "-sources.jar" ) )
                 {
                     type = "java-source";
index 5c1529f3d7e0122031a94596da5fd22d2dd5750e..6a386ae7cd6bdb1488146911784523bd046bb116 100644 (file)
@@ -364,6 +364,16 @@ public class DefaultArtifactDiscovererTest
             createArtifact( "org.apache.maven", "testing", "1.0", "java-source", "sources" ) ) );
     }
 
+    public void testTestSourcesInclusion()
+    throws DiscovererException
+{
+    List artifacts = discoverArtifactsWithSnapshots();
+    assertNotNull( "Check artifacts not null", artifacts );
+
+    assertTrue( "Check normal included", artifacts.contains(
+        createArtifact( "org.apache.maven", "testing", "1.0", "java-source", "test-sources" ) ) );
+}
+
     public void testDistributionInclusion()
         throws DiscovererException
     {
diff --git a/archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar b/archiva-discoverer/src/test/repository/org/apache/maven/testing/1.0/testing-1.0-test-sources.jar
new file mode 100644 (file)
index 0000000..e69de29