public boolean execute ( Campaign campaign ) { boolean campaignResult = true ; currentCampaign = campaign ; campaignStartTimeStamp = new Date ( ) ; try { createReport ( ) ; for ( CampaignRun run : currentCampaign . getRuns ( ) ) { if ( TestEngine . isAbortedByUser ( ) ) { break ; } currentTestBed = run . getTestbed ( ) ; String testSuiteName = currentCampaign . getName ( ) + " - " + currentTestBed . substring ( 0 , currentTestBed . lastIndexOf ( ' ' ) ) ; TestBedConfiguration . setConfigFile ( StaticConfiguration . TESTBED_CONFIG_DIRECTORY + "/" + currentTestBed ) ; currentTestSuite = MetaTestSuite . createMetaTestSuite ( testSuiteName , run . getTestsuites ( ) ) ; if ( currentTestSuite == null ) { continue ; } currentTestSuite . addTestReportListener ( this ) ; campaignResult &= TestEngine . execute ( currentTestSuite ) ; // NOSONAR - Potentially dangerous use of non-short-circuit logic currentTestSuite . removeTestReportListener ( this ) ; currentTestSuite = null ; } CampaignReportManager . getInstance ( ) . stopReport ( ) ; } finally { TestEngine . tearDown ( ) ; campaignStartTimeStamp = null ; currentCampaign = null ; } return campaignResult ; }
Executes a campaign