String projectFile = getProjectFile();
// WsdlProject project = new WsdlProject( projectFile,
// getProjectPassword() );
WsdlProject project = ( WsdlProject )ProjectFactoryRegistry.getProjectFactory( "wsdl" ).createNew( projectFile,
getProjectPassword() );
if( project.isDisabled() )
throw new Exception( "Failed to load soapUI project file [" + projectFile + "]" );
initProjectProperties( project );
int suiteCount = 0;
if( testSuite != null && project.getTestSuiteByName( testSuite ) == null )
throw new Exception( "Missing TestSuite named [" + testSuite + "]" );
for( int c = 0; c < project.getTestSuiteCount(); c++ )
{
if( testSuite == null || project.getTestSuiteAt( c ).getName().equalsIgnoreCase( testSuite ) )
{
runSuite( project.getTestSuiteAt( c ) );
suiteCount++ ;
}
}
if( suiteCount == 0 )
{
log.warn( "No test-suites matched argument [" + testSuite + "]" );
}
else if( testCaseCount == 0 )
{
log.warn( "No test-cases matched argument [" + testCase + "]" );
}
else if( loadTestCount == 0 )
{
log.warn( "No load-tests matched argument [" + loadTest + "]" );
}
else
{
if( saveAfterRun && !project.isRemote() )
{
try
{
project.save();
}
catch( Throwable t )
{
log.error( "Failed to save project", t );
}