Example #1
0
  /** Data in the model has been updated. Refresh all derived data. */
  private void calculate() {
    // Clear all derived data.
    runStatus = Status.OK;

    suiteDataMap.clear();
    suiteMapByStatus.clear();
    for (Status s : Status.values()) {
      suiteMapByStatus.put(s, new ArrayList<SuiteData>());
    }

    allTests.clear();
    testMapByStatus.clear();
    for (Status s : Status.values()) {
      testMapByStatus.put(s, new ArrayList<TestData>());
    }

    /*
     * Populate the Suite map with all Suites.
     */
    Map<String, SuiteResults> resultsMap = new HashMap<String, SuiteResults>();
    for (SuiteResults result : suiteResults) {
      resultsMap.put(result.getName(), result);
    }
    Map<String, SuiteContents> contentsMap = new HashMap<String, SuiteContents>();
    for (SuiteContents contents : suiteContents) {
      contentsMap.put(contents.getName(), contents);
    }

    for (SuiteContents contents : suiteContents) {
      String name = contents.getName();
      SuiteResults result = resultsMap.get(name);
      boolean ignored = ignoredTestList.isIgnored(name);
      ProcessOutput failureMessages = dataListenerInfo.getFailureMessages().get(name);
      suiteDataMap.put(name, new SuiteData(name, ignored, contents, result, failureMessages));
    }

    /*
     * Map the Suites by status.
     */
    for (SuiteData s : suiteDataMap.values()) {
      getSuites(s.getStatus()).add(s);
    }

    /** Populate the Test map with all Tests, and map by status. */
    for (SuiteData s : suiteDataMap.values()) {
      for (TestData t : s.getTestMap().values()) {
        allTests.add(t);
        getTests(t.getStatus()).add(t);
      }
    }

    if (logStats.hasErrors() || !getSuites(Status.ERROR).isEmpty()) {
      runStatus = Status.ERROR;
    } else if (!getSuites(Status.PENDING).isEmpty()) {
      runStatus = Status.PENDING;
    } else {
      runStatus = Status.OK;
    }
  }
Example #2
0
 public String getReasonForIgnoring(String suiteName, String testName) {
   return ignoredTestList.getReasonForIgnoring(suiteName, testName);
 }
Example #3
0
 public Collection<IgnoredTestInfo> getIgnoredTestInfo() {
   return ignoredTestList.getList();
 }