complete default discoverer tests

PR: MRM-9

git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@349610 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Porter 2005-11-29 04:01:17 +00:00
parent 8e757bd2a0
commit 9c694d371a
2 changed files with 20 additions and 0 deletions

View File

@ -107,6 +107,26 @@ public class DefaultArtifactDiscovererTest
assertFalse( "Check jdbc not included", artifacts.contains( createArtifact( "javax.sql", "jdbc", "2.0" ) ) );
}
public void testKickoutWithShortPath()
{
List artifacts = discoverer.discoverArtifacts( repositoryLocation, null, false );
assertNotNull( "Check artifacts not null", artifacts );
boolean found = false;
for ( Iterator i = discoverer.getKickedOutPathsIterator(); i.hasNext() && !found; )
{
String path = (String) i.next();
found = path.replace( '\\', '/' ).equals( "invalid/invalid-1.0.jar" );
}
assertTrue( "Check exclusion was found", found );
for ( Iterator i = artifacts.iterator(); i.hasNext(); )
{
Artifact a = (Artifact) i.next();
assertFalse( "Check not invalid-1.0.jar", a.getFile().getName().equals( "invalid-1.0.jar" ) );
}
}
public void testSnapshotInclusion()
{
List artifacts = discoverer.discoverArtifacts( repositoryLocation, null, true );