mirror of
https://github.com/apache/maven.git
synced 2025-02-09 11:35:24 +00:00
added UT to test for another broken condition - NPE
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@768354 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ae4bee951a
commit
ad1e062754
@ -154,5 +154,40 @@ public void testMavenVersion()
|
||||
|
||||
assertEquals( ArtifactScopeEnum.compile, md.getArtifactScope() );
|
||||
}
|
||||
@Test
|
||||
public void testForNPE()
|
||||
throws Exception
|
||||
{
|
||||
RepositoryReader rr = _remoteRepo.getReader();
|
||||
|
||||
// String gav = "org.apache.maven.plugins:maven-dependency-plugin:2.0";
|
||||
String gav = "org.codehaus.plexus:plexus-compiler-api:1.5.3::jar";
|
||||
|
||||
ArtifactMetadata bmd = new ArtifactMetadata( gav );
|
||||
ArrayList<ArtifactMetadata> query = new ArrayList<ArtifactMetadata>(1);
|
||||
query.add( bmd );
|
||||
|
||||
MetadataResults res = rr.readDependencies( query );
|
||||
|
||||
assertNotNull( res );
|
||||
|
||||
assertFalse( res.hasExceptions() );
|
||||
|
||||
assertTrue( res.hasResults() );
|
||||
|
||||
List<ArtifactMetadata> deps = res.getResult( bmd );
|
||||
|
||||
assertNotNull( deps );
|
||||
|
||||
assertFalse( deps.isEmpty() );
|
||||
|
||||
ArtifactMetadata md = deps.get(0);
|
||||
|
||||
System.out.println("found "+gav+" dependencies: "+deps);
|
||||
|
||||
// assertEquals( "3.0", md.getVersion() );
|
||||
|
||||
// assertEquals( ArtifactScopeEnum.compile, md.getArtifactScope() );
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user