private boolean isTestExpectedToFail(Test test) {
return getExpectedFailureAnnotation(test) != null;
}
private void processException(Test test, Throwable t) {
ExpectedFailure annotation = getExpectedFailureAnnotation(test);
try {
annotation.withAsserter().newInstance().assertException(annotation, t);
} catch (AssertionFailedError e) {
String msg = "Assertion failed for thrown exception: " + e.getMessage()
+ "\n(Actual thrown exception is reported below via 'caused by')";
AssertionFailedError errorToReport = new AssertionFailedError(msg);
errorToReport.initCause(t);