public synchronized void insertConfigMethod ( String suite , String test , String packages , String classname , ITestResult result ) { logger . entering ( new Object [ ] { suite , test , packages , classname , result } ) ; String type = null ; if ( result . getMethod ( ) . isBeforeSuiteConfiguration ( ) ) { type = BEFORE_SUITE ; } else if ( result . getMethod ( ) . isBeforeTestConfiguration ( ) ) { type = BEFORE_TEST ; } else if ( result . getMethod ( ) . isBeforeGroupsConfiguration ( ) ) { type = BEFORE_GROUP ; } else if ( result . getMethod ( ) . isBeforeClassConfiguration ( ) ) { type = BEFORE_CLASS ; } else if ( result . getMethod ( ) . isBeforeMethodConfiguration ( ) ) { type = BEFORE_METHOD ; } else if ( result . getMethod ( ) . isAfterSuiteConfiguration ( ) ) { type = AFTER_SUITE ; } else if ( result . getMethod ( ) . isAfterTestConfiguration ( ) ) { type = AFTER_TEST ; } else if ( result . getMethod ( ) . isAfterGroupsConfiguration ( ) ) { type = AFTER_GROUP ; } else if ( result . getMethod ( ) . isAfterClassConfiguration ( ) ) { type = AFTER_CLASS ; } else if ( result . getMethod ( ) . isAfterMethodConfiguration ( ) ) { type = AFTER_METHOD ; } ConfigMethodInfo config1 = new ConfigMethodInfo ( suite , test , packages , classname , type , result ) ; if ( result . getStatus ( ) == ITestResult . STARTED ) { runningConfig . add ( config1 ) ; return ; } for ( ConfigMethodInfo temp : runningConfig ) { if ( temp . getResult ( ) . getMethod ( ) . equals ( result . getMethod ( ) ) ) { runningConfig . remove ( temp ) ; break ; } } appendFile ( jsonCompletedConfig , config1 . toJson ( ) . concat ( ",\n" ) ) ; logger . exiting ( ) ; }
This method is used to insert configuration method details based on the suite test groups and class name .