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); } }
private void reportTestCase( String type, ReportEntryType reportEntryType, String message, String description, TestSetStats testSuite) { if (reportEntryType == ReportEntryType.error) { testSuite.testError( testCase( type, ReportEntryType.error, message, description == null ? null : description.toString())); } else { testSuite.testSkipped( testCase( type, ReportEntryType.skipped, message, description == null ? null : description.toString())); } }