PR: MNG-787

add tests to ensure version in current POM is always used

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@291511 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-09-26 01:56:37 +00:00
parent 99db09fcac
commit fba77cb146
1 changed files with 24 additions and 0 deletions

View File

@ -153,6 +153,30 @@ public class DefaultArtifactCollectorTest
assertEquals( "Check version", "2.0", getArtifact( "c", res.getArtifacts() ).getVersion() ); assertEquals( "Check version", "2.0", getArtifact( "c", res.getArtifacts() ).getVersion() );
} }
public void testResolveLocalNewestIsLocal()
throws ArtifactResolutionException, InvalidVersionSpecificationException
{
ArtifactSpec a = createArtifact( "a", "1.0" );
a.addDependency( "b", "2.0" );
ArtifactSpec b = createArtifact( "b", "3.0" );
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.0", getArtifact( "b", res.getArtifacts() ).getVersion() );
}
public void testResolveLocalOldestIsLocal()
throws ArtifactResolutionException, InvalidVersionSpecificationException
{
ArtifactSpec a = createArtifact( "a", "1.0" );
a.addDependency( "b", "3.0" );
ArtifactSpec b = createArtifact( "b", "2.0" );
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", "2.0", getArtifact( "b", res.getArtifacts() ).getVersion() );
}
public void testResolveNearestWithRanges() public void testResolveNearestWithRanges()
throws ArtifactResolutionException, InvalidVersionSpecificationException throws ArtifactResolutionException, InvalidVersionSpecificationException
{ {