コード例 #1
0
 private WrappedReportEntry testCase(Exception exception, ReportEntryType reportEntryType) {
   ReportEntry reportEntry =
       reportEntry(
           exception.getClass().getSimpleName(),
           testCasePrefix + exception.getMessage(),
           null,
           new InternalStackTraceWriter(exception),
           0,
           "");
   return wrap(reportEntry, reportEntryType);
 }
コード例 #2
0
  private void reportExceptions(List<Exception> exceptionList, List<Exception> ignoredExceptions) {
    Multimap<Class<? extends Exception>, Exception> exceptionMultimap = LinkedListMultimap.create();
    for (Exception exception : exceptionList) {
      exceptionMultimap.put(exception.getClass(), exception);
    }
    for (Exception exception : ignoredExceptions) {
      exceptionMultimap.put(exception.getClass(), exception);
    }

    for (Class<? extends Exception> exceptionType : exceptionMultimap.keySet()) {
      TestSetStats testSuiteData = new TestSetStats(false, false);
      for (Exception exception : exceptionMultimap.get(exceptionType)) {
        if (ignoredExceptions.contains(exception)) {
          testSuiteData.testSkipped(testCase(exception, ReportEntryType.skipped));
        } else {
          testSuiteData.testError(testCase(exception, ReportEntryType.error));
        }
      }
      reportTestSuite(exceptionType.getSimpleName(), testSuiteData);
    }
  }
コード例 #3
0
  private ListMultimap<Artifact, DependencyNode> collectDependencyNotFoundData(
      List<Exception> exceptionList, Class<? extends DependencyNotFoundException> exceptionType) {
    ListMultimap<Artifact, DependencyNode> artifactNotFoundMap = ArrayListMultimap.create();

    ListIterator<Exception> exceptionIterator = exceptionList.listIterator();
    while (exceptionIterator.hasNext()) {
      Exception e = exceptionIterator.next();
      if (e.getClass().equals(exceptionType)) {
        DependencyNode from = exceptionType.cast(e).getDependencyNode();
        artifactNotFoundMap.put(exceptionType.cast(e).getMissingArtifact(), from);
        exceptionIterator.remove();
      }
    }
    return artifactNotFoundMap;
  }