Пример #1
0
  private Response makeTestExecutionReportResponse(
      Request request, Date resultDate, TestResultRecord testResultRecord) throws Exception {
    if (formatIsXML(request)) return generateXMLResponse(testResultRecord.getFile());
    ExecutionReport report;

    String content = FileUtil.getFileContent(testResultRecord.getFile());
    report = ExecutionReport.makeReport(content);
    if (report instanceof TestExecutionReport) {
      report.setDate(resultDate);
      return generateHtmlTestExecutionResponse(request, (TestExecutionReport) report);
    } else if (report instanceof SuiteExecutionReport) {
      pageTitle.setPageType("Suite History");
      return generateHtmlSuiteExecutionResponse(request, (SuiteExecutionReport) report);
    } else return makeCorruptFileResponse(request);
  }
Пример #2
0
    public String getHistoryUrl() {
      String url = getFullName();

      if (result != null) {
        url += "?pageHistory&resultDate=";
        url += dateFormatter.format(result.getDate());
      }

      return url;
    }
Пример #3
0
    public void calculateResults() {
      testsPassed = 0;
      testsUnrun = 0;
      testsFailed = 0;

      if (isTest()) {
        if (result == null) {
          testsUnrun++;
        } else if ((result.getExceptions() == 0) && (result.getWrong() == 0)) {
          testsPassed++;
        } else {
          testsFailed++;
        }
      } else {
        for (TreeItem branch : branches) {
          testsUnrun += branch.testsUnrun;
          testsPassed += branch.testsPassed;
          testsFailed += branch.testsFailed;
        }
      }
    }