lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwe...@apache.org
Subject svn commit: r1303579 - /lucene/dev/branches/branch_3x/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
Date Wed, 21 Mar 2012 21:30:11 GMT
Author: dweiss
Date: Wed Mar 21 21:30:11 2012
New Revision: 1303579

URL: http://svn.apache.org/viewvc?rev=1303579&view=rev
Log:
Don't print seed notes on assumption errors.

Modified:
    lucene/dev/branches/branch_3x/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java

Modified: lucene/dev/branches/branch_3x/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java?rev=1303579&r1=1303578&r2=1303579&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
(original)
+++ lucene/dev/branches/branch_3x/lucene/test-framework/src/java/org/apache/lucene/util/UncaughtExceptionsRule.java
Wed Mar 21 21:30:11 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;
@@ -84,7 +85,7 @@ public class UncaughtExceptionsRule impl
           uncaughtExceptions.clear();
         }
 
-        if (!errors.isEmpty()) {
+        if (hasNonAssumptionErrors(errors)) {
           if (ltc == null) {
             // class level failure (e.g. afterclass)
             LuceneTestCase.reportPartialFailureInfo();
@@ -97,7 +98,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.
    */



Mime
View raw message