Don't print seed notes on assumption errors.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1303578 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dawid Weiss 2012-03-21 21:28:13 +00:00
parent 9bff9fd790
commit 0e3af80452
1 changed files with 12 additions and 2 deletions

View File

@ -23,6 +23,7 @@ import java.lang.Thread.UncaughtExceptionHandler;
import java.util.ArrayList;
import java.util.List;
import org.junit.internal.AssumptionViolatedException;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.MultipleFailureException;
@ -85,7 +86,7 @@ public class UncaughtExceptionsRule implements TestRule {
uncaughtExceptions.clear();
}
if (!errors.isEmpty()) {
if (hasNonAssumptionErrors(errors)) {
if (ltc == null) {
// class level failure (e.g. afterclass)
LuceneTestCase.reportPartialFailureInfo();
@ -99,6 +100,15 @@ public class UncaughtExceptionsRule implements TestRule {
};
}
private boolean hasNonAssumptionErrors(ArrayList<Throwable> errors) {
for (Throwable t : errors) {
if (!(t instanceof AssumptionViolatedException)) {
return true;
}
}
return false;
}
/**
* Just a check if anything's been caught.
*/