aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/junit/runners/model/MultipleFailureException.java
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2021-02-24 15:52:50 +0000
committerDavid Srbecky <dsrbecky@google.com>2021-02-24 15:52:50 +0000
commit08a6d4b74555db6d01048fc7065eb1e2bfaf33bc (patch)
tree81124de095a6b4a53b223d0f70cadde9744ee44a /src/main/java/org/junit/runners/model/MultipleFailureException.java
parent6a658e7a4df0cc8ea6465da46fcf1a823cb0d491 (diff)
downloadjunit-08a6d4b74555db6d01048fc7065eb1e2bfaf33bc.tar.gz
Revert "Upgrade external/junit to 4.13.2"
Revert submission 1601635 Reason for revert: b/181123058 Reverted Changes: I8f5cd1266:Remove support for stuck threads Ifdb59336d:Remove DisableOnDebug (new in 4.12) as it is not s... I6abae5aed:Extra generic type information to aid certain java... I5ec909df6:Upgrade external/junit to 4.13.2 Change-Id: Idaddfc2039816a8d7b12c91fdd540b801ab854ff
Diffstat (limited to 'src/main/java/org/junit/runners/model/MultipleFailureException.java')
-rw-r--r--src/main/java/org/junit/runners/model/MultipleFailureException.java41
1 files changed, 3 insertions, 38 deletions
diff --git a/src/main/java/org/junit/runners/model/MultipleFailureException.java b/src/main/java/org/junit/runners/model/MultipleFailureException.java
index 8e355a7..325c645 100644
--- a/src/main/java/org/junit/runners/model/MultipleFailureException.java
+++ b/src/main/java/org/junit/runners/model/MultipleFailureException.java
@@ -1,13 +1,9 @@
package org.junit.runners.model;
-import java.io.PrintStream;
-import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.junit.TestCouldNotBeSkippedException;
-import org.junit.internal.AssumptionViolatedException;
import org.junit.internal.Throwables;
/**
@@ -21,22 +17,12 @@ public class MultipleFailureException extends Exception {
/*
* We have to use the f prefix until the next major release to ensure
* serialization compatibility.
- * See https://github.com/junit-team/junit4/issues/976
+ * See https://github.com/junit-team/junit/issues/976
*/
private final List<Throwable> fErrors;
public MultipleFailureException(List<Throwable> errors) {
- if (errors.isEmpty()) {
- throw new IllegalArgumentException(
- "List of Throwables must not be empty");
- }
- this.fErrors = new ArrayList<Throwable>(errors.size());
- for (Throwable error : errors) {
- if (error instanceof AssumptionViolatedException) {
- error = new TestCouldNotBeSkippedException((AssumptionViolatedException) error);
- }
- fErrors.add(error);
- }
+ this.fErrors = new ArrayList<Throwable>(errors);
}
public List<Throwable> getFailures() {
@@ -48,32 +34,11 @@ public class MultipleFailureException extends Exception {
StringBuilder sb = new StringBuilder(
String.format("There were %d errors:", fErrors.size()));
for (Throwable e : fErrors) {
- sb.append(String.format("%n %s(%s)", e.getClass().getName(), e.getMessage()));
+ sb.append(String.format("\n %s(%s)", e.getClass().getName(), e.getMessage()));
}
return sb.toString();
}
- @Override
- public void printStackTrace() {
- for (Throwable e: fErrors) {
- e.printStackTrace();
- }
- }
-
- @Override
- public void printStackTrace(PrintStream s) {
- for (Throwable e: fErrors) {
- e.printStackTrace(s);
- }
- }
-
- @Override
- public void printStackTrace(PrintWriter s) {
- for (Throwable e: fErrors) {
- e.printStackTrace(s);
- }
- }
-
/**
* Asserts that a list of throwables is empty. If it isn't empty,
* will throw {@link MultipleFailureException} (if there are