public void testReportWithWrongUrl()
throws Exception
{
File pluginXmlFile = new File( getBasedir(), "src/test/resources/plugin-configs/"
+ "scm-wrong-url-plugin-config.xml" );
Mojo mojo = lookupMojo( "scm", pluginXmlFile );
assertNotNull( "Mojo found.", mojo );
setVariableValueToObject( mojo, "anonymousConnection", "scm:svn" );
try
{
mojo.execute();
assertTrue( "IllegalArgumentException NOT catched", false );
}
catch ( IllegalArgumentException e )
{
assertTrue( "IllegalArgumentException catched", true );
}
tearDown();
setUp();
mojo = lookupMojo( "scm", pluginXmlFile );
assertNotNull( "Mojo found.", mojo );
setVariableValueToObject( mojo, "anonymousConnection", "scm:svn:http" );
try
{
mojo.execute();
assertTrue( "IllegalArgumentException NOT catched", false );
}
catch ( Exception e )
{
assertTrue( "IllegalArgumentException catched", true );
}
tearDown();
setUp();
mojo = lookupMojo( "scm", pluginXmlFile );
assertNotNull( "Mojo found.", mojo );
setVariableValueToObject( mojo, "anonymousConnection", "scm" );
try
{
mojo.execute();
assertTrue( "IllegalArgumentException NOT catched", false );
}
catch ( Exception e )
{
assertTrue( "IllegalArgumentException catched", true );