o Printed the error for better test failure analysis

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@790239 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-07-01 15:58:08 +00:00
parent efd3309e99
commit aa549e89b0
1 changed files with 29 additions and 1 deletions

View File

@ -114,6 +114,8 @@ public class ArtifactResolverTest
ArtifactResolutionResult result = artifactResolver.resolveTransitively( Collections.singleton( g ), projectArtifact, remoteRepositories(), localRepository(), null );
printErrors( result );
assertEquals( 2, result.getArtifacts().size() );
assertTrue( result.getArtifacts().contains( g ) );
@ -136,6 +138,8 @@ public class ArtifactResolverTest
ArtifactResolutionResult result = artifactResolver.resolveTransitively( Collections.singleton( i ), projectArtifact, remoteRepositories(), localRepository(), null );
printErrors( result );
assertEquals( 2, result.getArtifacts().size() );
assertTrue( result.getArtifacts().contains( i ) );
@ -231,6 +235,8 @@ public class ArtifactResolverTest
result =
artifactResolver.resolveTransitively( set, projectArtifact, remoteRepositories(), localRepository(), mds );
printErrors( result );
Iterator i = result.getArtifacts().iterator();
assertEquals( "n should be first", n, i.next() );
assertEquals( "m should be second", m, i.next() );
@ -243,8 +249,30 @@ public class ArtifactResolverTest
result =
artifactResolver.resolveTransitively( set, projectArtifact, remoteRepositories(), localRepository(), mds );
printErrors( result );
i = result.getArtifacts().iterator();
assertEquals( "m should be first", m, i.next() );
assertEquals( "n should be second", n, i.next() );
}
}
private void printErrors( ArtifactResolutionResult result )
{
if ( result.hasMissingArtifacts() )
{
for ( Artifact artifact : result.getMissingArtifacts() )
{
System.err.println( "Missing: " + artifact );
}
}
if ( result.hasExceptions() )
{
for ( Exception e : result.getExceptions() )
{
e.printStackTrace();
}
}
}
}