private void generateSummaryData ( List < ISuite > suites ) { logger . entering ( suites ) ; SummarizedData tempSuite ; SummarizedData tempTest ; SummarizedData tempGroups ; this . generateTestCaseResultData ( suites ) ; // Generating Group Summary data for ( ISuite suite : suites ) { tempSuite = new SummarizedData ( ) ; tempSuite . setsName ( suite . getName ( ) ) ; Map < String , ISuiteResult > allResults = suite . getResults ( ) ; for ( Entry < String , Collection < ITestNGMethod > > sGroupName : suite . getMethodsByGroups ( ) . entrySet ( ) ) { tempGroups = new SummarizedData ( ) ; tempGroups . setsName ( sGroupName . getKey ( ) ) ; tempGroups . incrementiTotal ( sGroupName . getValue ( ) . size ( ) ) ; for ( TestCaseResult tr : allTestsResults ) { if ( tr . getGroup ( ) . contains ( sGroupName . getKey ( ) ) ) { tempGroups . incrementCount ( tr . getStatus ( ) ) ; tempGroups . incrementDuration ( tr . getDurationTaken ( ) ) ; } } tempGroups . setiTotal ( tempGroups . getiPassedCount ( ) + tempGroups . getiFailedCount ( ) + tempGroups . getiSkippedCount ( ) ) ; lGroups . add ( tempGroups ) ; } // Generating Test summary data for ( ISuiteResult testResult : allResults . values ( ) ) { ITestContext testContext = testResult . getTestContext ( ) ; tempTest = new SummarizedData ( ) ; tempTest . setsName ( testContext . getName ( ) ) ; tempTest . setiFailedCount ( testContext . getFailedTests ( ) . size ( ) ) ; tempTest . setiPassedCount ( testContext . getPassedTests ( ) . size ( ) ) ; tempTest . setiSkippedCount ( testContext . getSkippedTests ( ) . size ( ) ) ; tempTest . setiTotal ( tempTest . getiPassedCount ( ) + tempTest . getiFailedCount ( ) + tempTest . getiSkippedCount ( ) ) ; tempTest . setlRuntime ( testContext . getEndDate ( ) . getTime ( ) - testContext . getStartDate ( ) . getTime ( ) ) ; lTests . add ( tempTest ) ; } // Generating Suite Summary data for ( SummarizedData test : lTests ) { tempSuite . setiPassedCount ( test . getiPassedCount ( ) + tempSuite . getiPassedCount ( ) ) ; tempSuite . setiFailedCount ( test . getiFailedCount ( ) + tempSuite . getiFailedCount ( ) ) ; tempSuite . setiSkippedCount ( tempSuite . getiSkippedCount ( ) + test . getiSkippedCount ( ) ) ; tempSuite . setiTotal ( tempSuite . getiPassedCount ( ) + tempSuite . getiFailedCount ( ) + tempSuite . getiSkippedCount ( ) ) ; tempSuite . setlRuntime ( test . getlRuntime ( ) + tempSuite . getlRuntime ( ) ) ; } lSuites . add ( tempSuite ) ; } Collections . sort ( lGroups ) ; Collections . sort ( lTests ) ; logger . exiting ( ) ; }
Generates all summarized counts for various reports