use of org.mockito.internal.junit.util.JUnitFailureHacker in project mockito by mockito.
the class VerboseMockitoJUnitRunner method run.
@Override
public void run(RunNotifier notifier) {
//a listener that changes the failure's exception in a very hacky way...
RunListener listener = new RunListener() {
WarningsCollector warningsCollector;
@Override
public void testStarted(Description description) throws Exception {
warningsCollector = new WarningsCollector();
}
@Override
@SuppressWarnings("deprecation")
public void testFailure(final Failure failure) throws Exception {
String warnings = warningsCollector.getWarnings();
new JUnitFailureHacker().appendWarnings(failure, warnings);
}
};
notifier.addFirstListener(listener);
runner.run(notifier);
}
Aggregations