// Not strictly necessary but probably desirable.
// JUnit 4-specific test GUIs will show just "failures".
// But Ant's output shows "failures" vs. "errors".
// We would prefer to show "failure" for things that logically are.
String msg = t.getMessage();
AssertionFailedError failure = msg != null
? new AssertionFailedError(msg) : new AssertionFailedError();
failure.setStackTrace(t.getStackTrace());
testListener.addFailure(test, failure);
} else {
testListener.addError(test, t);
}
}