// if( !new File(projectFile).exists() )
// {
// throw new MojoExecutionException("soapui-project-file [" + projectFile + "] is not found" );
// }
SoapUILoadTestRunner runner = new SoapUILoadTestRunner(
"SoapUI " + SoapUI.SOAPUI_VERSION + " Maven2 LoadTest Runner");
runner.setProjectFile( projectFile );
if( endpoint != null )
runner.setEndpoint( endpoint );
if( testSuite != null )
runner.setTestSuite( testSuite );
if( testCase != null )
runner.setTestCase( testCase );
if( loadTest != null )
runner.setLoadTest( loadTest );
if( username != null )
runner.setUsername( username );
if( password != null )
runner.setPassword( password );
if( wssPasswordType != null )
runner.setWssPasswordType( wssPasswordType );
if( domain != null )
runner.setDomain( domain );
if( limit != null )
runner.setLimit( limit.intValue() );
if( threadCount != null )
runner.setThreadCount( threadCount.intValue() );
if( host != null )
runner.setHost( host );
if( outputFolder != null )
runner.setOutputFolder( outputFolder );
runner.setPrintReport( printReport );
runner.setSaveAfterRun( saveAfterRun );
if( settingsFile != null )
runner.setSettingsFile( settingsFile );
if ( projectPassword != null )
runner.setProjectPassword(projectPassword);
if ( settingsPassword != null )
runner.setSoapUISettingsPassword(settingsPassword);
if( globalProperties != null )
runner.setGlobalProperties(globalProperties);
if( projectProperties != null )
runner.setProjectProperties(projectProperties);
if( soapuiProperties != null && soapuiProperties.size() > 0 )
for( Object key : soapuiProperties.keySet() )
{
System.out.println( "Setting " + ( String )key + " value " + soapuiProperties.getProperty( ( String )key ) );
System.setProperty( ( String )key, soapuiProperties.getProperty( ( String )key ) );
}
try
{
runner.run();
}
catch (Throwable e)
{
getLog().error( e.toString() );
throw new MojoFailureException( this, "SoapUI LoadTest(s) failed", e.getMessage() );