private int executeScript(String scriptName) throws IOException, InterruptedException {
  final int exitCode;
  DefaultExecuteResultHandler resultHandler=shell.execute(scriptName,scriptTimeout,environment,testFolder.getRoot());
  processRunning=true;
  resultHandler.waitFor();
  logger.finest(String.format("Executing %s...",scriptName));
  exitCode=resultHandler.getExitValue();
  if (exitCode != 0) {
    ExecuteException executeException=resultHandler.getException();
    logger.log(Level.SEVERE,executeException.getMessage(),executeException);
  }
  return exitCode;
}

private int executeScript ( String scriptName ) throws IOException , InterruptedException { final int exitCode ; DefaultExecuteResultHandler resultHandler = shell . execute ( scriptName , scriptTimeout , environment , testFolder . getRoot ( ) ) ; processRunning = true ; resultHandler . waitFor ( ) ; logger . finest ( String . format ( "Executing %s..." , scriptName ) ) ; exitCode = resultHandler . getExitValue ( ) ; if ( exitCode != 0 ) { ExecuteException executeException = resultHandler . getException ( ) ; logger . log ( Level . SEVERE , executeException . getMessage ( ) , executeException ) ; } return exitCode ; }
given a script file name , runs the script and return the exit code . if exitcode ! = 0 extract and prints exception .
