예제 #1
0
  private void createExecutionReport(FilePropertiesObject input, SPLOutcomes resultado)
      throws IOException {
    String resultFileName =
        Constants.PLUGIN_PATH
            + Constants.FILE_SEPARATOR
            + "executionReport"
            + Constants.FILE_SEPARATOR
            + input.getEvolutionDescription();

    File executionReport = new File(resultFileName + ".properties");

    if (!executionReport.exists()) {
      executionReport.createNewFile();
    }

    Properties properties = new Properties();
    FileInputStream fileInputStream = new FileInputStream(executionReport);
    properties.load(fileInputStream);
    fileInputStream.close();

    String approachTool = input.getApproach() + "-" + input.getGenerateTestsWith();
    properties.setProperty(approachTool, resultado.isRefinement() + "");
    properties.setProperty("branchName", input.getEvolutionDescription());
    properties.setProperty(
        "approachTime", String.valueOf(resultado.getMeasures().getTempoTotal().getTotal()));

    FileOutputStream fileOutputStream = new FileOutputStream(executionReport);
    properties.store(fileOutputStream, "Execution Report");
    fileOutputStream.close();
  }
예제 #2
0
 private void createOutcomesPropertyFile(
     FilePropertiesObject propertiesObject, SPLOutcomes resultado) {
   String resultFileName =
       Constants.PLUGIN_PATH
           + Constants.FILE_SEPARATOR
           + "resultFiles"
           + Constants.FILE_SEPARATOR
           + propertiesObject.getEvolutionDescription();
   System.out.println("\n\t SPL REPORT: \n");
   System.out.println(resultado.toString());
   File fileProperties = new File(resultFileName + ".properties");
   try {
     resultado
         .getMeasures()
         .printProperties(fileProperties, resultado, propertiesObject.getEvolutionDescription());
   } catch (IOException e) {
     e.printStackTrace();
   }
 }