Package org.opentest4j
Class MultipleFailuresError
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Error
-
- java.lang.AssertionError
-
- org.opentest4j.MultipleFailuresError
-
- All Implemented Interfaces:
java.io.Serializable
public class MultipleFailuresError extends java.lang.AssertionErrorMultipleFailuresErroris anAssertionErrorthat aggregates multiple failures thrown in a given context (i.e., typically within the invocation of a single test).- Since:
- 1.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringEOLprivate java.util.List<java.lang.Throwable>failuresprivate java.lang.Stringheadingprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description MultipleFailuresError(java.lang.String heading, java.util.List<? extends java.lang.Throwable> failures)Constructs anMultipleFailuresErrorwith the supplied heading and failures.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Throwable>getFailures()Returns the list of failures contained in this error.java.lang.StringgetMessage()booleanhasFailures()Returns whether this error contains any failures.private static booleanisBlank(java.lang.String str)private static java.lang.StringnullSafeMessage(java.lang.Throwable failure)private static java.lang.Stringpluralize(int count, java.lang.String singular, java.lang.String plural)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
EOL
private static final java.lang.String EOL
-
heading
private final java.lang.String heading
-
failures
private final java.util.List<java.lang.Throwable> failures
-
-
Constructor Detail
-
MultipleFailuresError
public MultipleFailuresError(java.lang.String heading, java.util.List<? extends java.lang.Throwable> failures)Constructs anMultipleFailuresErrorwith the supplied heading and failures.- Parameters:
heading- the message heading; a default value will be used ifnullor blankfailures- the list of failures; must not benullor containnullelements
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessagein classjava.lang.Throwable
-
getFailures
public java.util.List<java.lang.Throwable> getFailures()
Returns the list of failures contained in this error.
-
hasFailures
public boolean hasFailures()
Returns whether this error contains any failures.
-
isBlank
private static boolean isBlank(java.lang.String str)
-
pluralize
private static java.lang.String pluralize(int count, java.lang.String singular, java.lang.String plural)
-
nullSafeMessage
private static java.lang.String nullSafeMessage(java.lang.Throwable failure)
-
-