Author: vsiveton
Date: Sun Jan 9 19:47:41 2011
New Revision: 1057008
URL: http://svn.apache.org/viewvc?rev=1057008&view=rev
Log:
o added more tests for about
Modified:
maven/plugins/trunk/maven-doap-plugin/src/test/java/org/apache/maven/plugin/doap/DoapMojoTest.java
Modified:
maven/plugins/trunk/maven-doap-plugin/src/test/java/org/apache/maven/plugin/doap/DoapMojoTest.java
URL:
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-doap-plugin/src/test/java/org/apache/maven/plugin/doap/DoapMojoTest.java?rev=1057008&r1=1057007&r2=1057008&view=diff
==============================================================================
---
maven/plugins/trunk/maven-doap-plugin/src/test/java/org/apache/maven/plugin/doap/DoapMojoTest.java
(original)
+++
maven/plugins/trunk/maven-doap-plugin/src/test/java/org/apache/maven/plugin/doap/DoapMojoTest.java
Sun Jan 9 19:47:41 2011
@@ -107,6 +107,62 @@ public class DoapMojoTest
}
/**
+ * @throws Exception if any
+ */
+ public void testLangParameters()
+ throws Exception
+ {
+
+ File pluginXmlFile =
+ new File( getBasedir(),
"src/test/resources/unit/doap-configuration/doap-configuration-plugin-config.xml"
);
+ DoapMojo mojo = (DoapMojo) lookupMojo( "generate", pluginXmlFile );
+ assertNotNull( "Mojo found.", mojo );
+
+ MavenProject mavenProject = (MavenProject) getVariableValueFromObject(
mojo, "project" );
+ assertNotNull( mavenProject );
+
+ // check invalid lang
+ setVariableValueToObject( mojo, "remoteRepositories",
mavenProject.getRemoteArtifactRepositories() );
+ setVariableValueToObject( mojo, "lang", "foo" );
+ try
+ {
+ mojo.execute();
+ assertTrue( "No lang checked", false );
+ }
+ catch ( Exception e )
+ {
+ assertTrue( true );
+ }
+ }
+
+ /**
+ * @throws Exception if any
+ */
+ public void testAboutParameter()
+ throws Exception
+ {
+ File pluginXmlFile =
+ new File( getBasedir(),
"src/test/resources/unit/doap-configuration/doap-configuration-plugin-config.xml"
);
+ DoapMojo mojo = (DoapMojo) lookupMojo( "generate", pluginXmlFile );
+ assertNotNull( "Mojo found.", mojo );
+
+ MavenProject mavenProject = (MavenProject) getVariableValueFromObject(
mojo, "project" );
+ assertNotNull( mavenProject );
+
+ // check invalid lang
+ setVariableValueToObject( mojo, "remoteRepositories",
mavenProject.getRemoteArtifactRepositories() );
+ setVariableValueToObject( mojo, "about", "foo" );
+ try
+ {
+ mojo.execute();
+ }
+ catch ( Exception e )
+ {
+ assertTrue( true );
+ }
+ }
+
+ /**
* Verify the generation of a DOAP file from an artifact.
*
* @throws Exception if any
@@ -196,7 +252,6 @@ public class DoapMojoTest
assertTrue( readed.contains( "<asfext:name>Apache " +
mavenProject.getName() + "</asfext:name>" ) );
}
-
/**
* Verify the generation of a DOAP file with extra extension.
*