public void testGetMavenJavadocPluginConfiguration()
throws Exception
{
File testPom = new File( getBasedir(), "src/test/resources/unit/ant-javadoc-test/pom.xml" );
MavenEmbedder maven = new MavenEmbedder();
maven.setClassLoader( Thread.currentThread().getContextClassLoader() );
maven.setLogger( new MavenEmbedderConsoleLogger() );
maven.setLocalRepositoryDirectory( getTestFile( "target/local-repo" ) );
maven.setOffline( true );
maven.start();
MavenProject project = maven.readProject( testPom );
assertEquals( AntBuildWriterUtil.getMavenJavadocPluginBasicOption( project, "doclet", null ), "gr.spinellis.umlgraph.doclet.UmlGraphDoc" );
assertNotNull( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "links", null ) );
assertEquals( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "links", null ).length, 2 );
assertNotNull( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "docletArtifacts", null ) );
assertEquals( AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "docletArtifacts", null ).length, 2 );
Map[] options = AntBuildWriterUtil.getMavenJavadocPluginOptions( project, "tags", null );
assertNotNull( options );
assertEquals( options.length, 1 );
assertEquals( 1, options[0].size() );
Map properties = (Map) options[0].get( "tag" );
assertNotNull( properties );
assertEquals( "requirement", properties.get( "name" ) );
assertEquals( "a", properties.get( "placement" ) );
assertEquals( "Software Requirement:", properties.get( "head" ) );
maven.stop();
}