You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2012/03/21 22:28:13 UTC
svn commit: r1303578 -
/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
Author: dweiss
Date: Wed Mar 21 21:28:13 2012
New Revision: 1303578
URL: http://svn.apache.org/viewvc?rev=1303578&view=rev
Log:
Don't print seed notes on assumption errors.
Modified:
lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
Modified: lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java?rev=1303578&r1=1303577&r2=1303578&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java (original)
+++ lucene/dev/trunk/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java Wed Mar 21 21:28:13 2012
@@ -23,6 +23,7 @@ import java.lang.Thread.UncaughtExceptio
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 impl
uncaughtExceptions.clear();
}
- if (!errors.isEmpty()) {
+ if (hasNonAssumptionErrors(errors)) {
if (ltc == null) {
// class level failure (e.g. afterclass)
LuceneTestCase.reportPartialFailureInfo();
@@ -98,7 +99,16 @@ public class UncaughtExceptionsRule impl
}
};
}
-
+
+ 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.
*/