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); }
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; }
private String stackTrace() { if (description != null) { return description; } else { return exception.getMessage() != null ? "" : ExceptionUtils.getStackTrace(exception); } }
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); } }