public class MultipleFailuresError
extends java.lang.AssertionError
MultipleFailuresError
is an AssertionError
that aggregates
multiple failures thrown in a given context (i.e., typically within the
invocation of a single test).Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
EOL |
private java.util.List<java.lang.Throwable> |
failures |
private java.lang.String |
heading |
private static long |
serialVersionUID |
Constructor and Description |
---|
MultipleFailuresError(java.lang.String heading,
java.util.List<? extends java.lang.Throwable> failures)
Constructs an
MultipleFailuresError with the supplied heading and
failures. |
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.Throwable> |
getFailures()
Returns the list of failures contained in this error.
|
java.lang.String |
getMessage() |
boolean |
hasFailures()
Returns whether this error contains any failures.
|
private static boolean |
isBlank(java.lang.String str) |
private static java.lang.String |
nullSafeMessage(java.lang.Throwable failure) |
private static java.lang.String |
pluralize(int count,
java.lang.String singular,
java.lang.String plural) |
private static final long serialVersionUID
private static final java.lang.String EOL
private final java.lang.String heading
private final java.util.List<java.lang.Throwable> failures
public MultipleFailuresError(java.lang.String heading, java.util.List<? extends java.lang.Throwable> failures)
MultipleFailuresError
with the supplied heading and
failures.heading
- the message heading; a default value will be used if
null
or blankfailures
- the list of failures; must not be null
or contain
null
elementspublic java.lang.String getMessage()
getMessage
in class java.lang.Throwable
public java.util.List<java.lang.Throwable> getFailures()
public boolean hasFailures()
private static boolean isBlank(java.lang.String str)
private static java.lang.String pluralize(int count, java.lang.String singular, java.lang.String plural)
private static java.lang.String nullSafeMessage(java.lang.Throwable failure)