public static String makeResultFileName(TestSummary summary, long time) { SimpleDateFormat format = new SimpleDateFormat(TEST_RESULT_FILE_DATE_PATTERN); String datePart = format.format(new Date(time)); return String.format( "%s_%d_%d_%d_%d.xml", datePart, summary.getRight(), summary.getWrong(), summary.getIgnores(), summary.getExceptions()); }
@Override public void testComplete(WikiTestPage test, TestSummary testSummary) { increaseCompletedTests(); if (firstFailure != null) { notifier.fireTestFailure(new Failure(descriptionFor(test), firstFailure)); } else if (test.isTestPage()) { if (testSummary.getExceptions() > 0) { notifier.fireTestFailure( new Failure( descriptionFor(test), new Exception("Exception occurred on page " + test.getFullPath()))); } else if (testSummary.getWrong() > 0) { notifier.fireTestFailure( new Failure( descriptionFor(test), new AssertionError("Test failures occurred on page " + test.getFullPath()))); } else { notifier.fireTestFinished(descriptionFor(test)); } } }