コード例 #1
0
 @Override
 public void testStarted(WikiTestPage test) {
   String pageName = test.getFullPath();
   testHistoryFormatter = new TestXmlFormatter(context, test.getSourcePage(), writerFactory);
   testHistoryFormatter.testStarted(test);
   referenceToCurrentTest =
       new SuiteExecutionReport.PageHistoryReference(pageName, testHistoryFormatter.startedAt());
 }
 @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));
     }
   }
 }
 private Description descriptionFor(WikiTestPage test) {
   return Description.createTestDescription(mainClass, test.getFullPath());
 }