@ Override public void onStart ( ITestContext context ) { logger . entering ( context ) ; if ( ListenerManager . isCurrentMethodSkipped ( this ) ) { logger . exiting ( ListenerManager . THREAD_EXCLUSION_MSG ) ; return ; } String testName = context . getCurrentXmlTest ( ) . getName ( ) ; // initializing the ConfigSummaryData before initializers so that config details can be added. ConfigSummaryData . initLocalConfigSummary ( testName ) ; // We have to ensure that our configuration is the first thing that gets loaded. // Our loading mechanism is going to be via listeners. But the problem with TestNG listeners is // that the order of loading is never guaranteed. Things become complicated if our downstream consumers // want to piggy back on our configuration and want to have their configurations loaded as well. // Because of all these issues, we cannot rely on building a config specific listener. // So we are relying on the ServiceLoaders in Java to do it for us. The moment we are here, we ensure that // not only the SeLion specific configurations are loaded, but all downstream consumer's configurations // are loaded as well along with us. So SeLion now becomes the single point of initialization and thus // does away with all the inherent setbacks that are associated with TestNG listeners orders. invokeInitializersBasedOnPriority ( context ) ; ConfigManager . printConfiguration ( testName ) ; ISuite suite = context . getSuite ( ) ; if ( ! suite . getParallel ( ) . equals ( "false" ) && logger . isLoggable ( Level . FINE ) ) { logger . log ( Level . FINE , "Parallel suite execution. Updating SeLion local config for Test, " + context . getCurrentXmlTest ( ) . getName ( ) ) ; } String base = suite . getOutputDirectory ( ) ; String suiteName = suite . getName ( ) ; String rootFolder = filterOutputDirectory ( base , suiteName ) ; SeLionReporter . setTestNGOutputFolder ( rootFolder ) ; SeLionReporter . init ( ) ; logger . exiting ( ) ; }
On start each suite initialize config object and report object