private File captureScreenForStackLines ( TestMethod rootMethod , List < List < StackLine > > stackLinesList , List < Integer > executionTimes ) { if ( stackLinesList == null ) { throw new NullPointerException ( ) ; } if ( stackLinesList . size ( ) == 0 ) { throw new IllegalArgumentException ( "empty list" ) ; } if ( stackLinesList . size ( ) != executionTimes . size ( ) ) { throw new IllegalArgumentException ( "size mismatch" ) ; } File captureFile = captureScreen ( rootMethod ) ; if ( captureFile == null ) { return null ; } for ( int i = 0 ; i < stackLinesList . size ( ) ; i ++ ) { LineScreenCapture capture = new LineScreenCapture ( ) ; capture . setPath ( new File ( captureFile . getAbsolutePath ( ) ) ) ; capture . addAllStackLines ( stackLinesList . get ( i ) ) ; capture . setExecutionTime ( executionTimes . get ( i ) ) ; currentRunResult . addLineScreenCapture ( capture ) ; } return captureFile ; }
- returns null if fails to capture