[MPLUGIN-242] NullPointerException in MojoClassVisitor.visit() unit test

Submitted by: Mikolaj Izdebski

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1590803 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2014-04-28 21:18:04 +00:00
parent 58f5506c59
commit 62561197e8
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,5 @@
package java.lang;
public class Object
{
}

View File

@ -87,4 +87,16 @@ public class TestAnnotationsReader
new ParameterAnnotationContent( "beer", null, "thebeer", "coolbeer", false, false,
String.class.getName() ) );
}
public void testReadingJavaLangObject()
throws Exception
{
MojoAnnotationsScannerRequest request = new MojoAnnotationsScannerRequest();
request.setClassesDirectories( Collections.singletonList( new File( "target/test-classes" ) ) );
request.setIncludePatterns( Collections.singletonList( "java/lang/Object.class" ) );
request.setProject( new MavenProject() );
MojoAnnotationsScanner scanner = (MojoAnnotationsScanner) lookup( MojoAnnotationsScanner.ROLE );
scanner.scan( request );
}
}