PR: MNG-1007

confirm this is fixed

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@291627 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-26 14:07:09 +00:00
parent 5a5a5c50ec
commit fe929c8a62
1 changed files with 14 additions and 1 deletions

View File

@ -239,6 +239,19 @@ public class DefaultArtifactCollectorTest
assertEquals( "Check version", "2.0", getArtifact( "b", res.getArtifacts() ).getVersion() ); assertEquals( "Check version", "2.0", getArtifact( "b", res.getArtifacts() ).getVersion() );
} }
public void testResolveLocalWithNewerVersionButLesserScope()
throws ArtifactResolutionException, InvalidVersionSpecificationException
{
ArtifactSpec a = createArtifact( "commons-logging", "1.0" );
a.addDependency( "junit", "3.7" );
ArtifactSpec b = createArtifact( "junit", "3.8.1", Artifact.SCOPE_TEST );
ArtifactResolutionResult res = collect( createSet( new Object[]{a.artifact, b.artifact} ) );
assertEquals( "Check artifact list", createSet( new Object[]{a.artifact, b.artifact} ), res.getArtifacts() );
assertEquals( "Check version", "3.8.1", getArtifact( "junit", res.getArtifacts() ).getVersion() );
assertEquals( "Check scope", Artifact.SCOPE_COMPILE, getArtifact( "junit", res.getArtifacts() ).getScope() );
}
public void testResolveNearestWithRanges() public void testResolveNearestWithRanges()
throws ArtifactResolutionException, InvalidVersionSpecificationException throws ArtifactResolutionException, InvalidVersionSpecificationException
{ {
@ -590,7 +603,7 @@ public class DefaultArtifactCollectorTest
public ArtifactSpec addDependency( String id, String version ) public ArtifactSpec addDependency( String id, String version )
throws InvalidVersionSpecificationException throws InvalidVersionSpecificationException
{ {
return addDependency( id, version, null ); return addDependency( id, version, Artifact.SCOPE_COMPILE );
} }
public ArtifactSpec addDependency( String id, String version, String scope ) public ArtifactSpec addDependency( String id, String version, String scope )