Top Description Fields Constructors Methods
org.opentest4j

public Class MultipleFailuresError

extends AssertionError
Class Inheritance
Imports
java.util.ArrayList, .Collections, .List

MultipleFailuresError is an AssertionError that aggregates multiple failures thrown in a given context (i.e., typically within the invocation of a single test).
Authors
Johannes Link, Sam Brannen, Marc Philipp
Since
1.0

Field Summary

Modifier and TypeField and Description
private static final String
private final List<Throwable>
private final String
private static final long

Constructor Summary

AccessConstructor and Description
public
MultipleFailuresError(String
the message heading; a default value will be used if null or blank
heading
,
List<? extends Throwable>
the list of failures; must not be null or contain null elements
failures
)

Constructs an MultipleFailuresError with the supplied heading and failures.

Method Summary

Modifier and TypeMethod and Description
public List<Throwable>
getFailures()

Returns the list of failures contained in this error.

public String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.
public boolean
hasFailures()

Returns whether this error contains any failures.

private static boolean
private static String
private static String
pluralize(int count, String singular, String plural)

Field Detail

EOLback to summary
private static final String EOL
failuresback to summary
private final List<Throwable> failures
headingback to summary
private final String heading
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.AssertionError.serialVersionUID.

Constructor Detail

MultipleFailuresErrorback to summary
public MultipleFailuresError(String heading, List<? extends Throwable> failures)

Constructs an MultipleFailuresError with the supplied heading and failures.

Parameters
heading:String

the message heading; a default value will be used if null or blank

failures:List<? extends Throwable>

the list of failures; must not be null or contain null elements

Method Detail

getFailuresback to summary
public List<Throwable> getFailures()

Returns the list of failures contained in this error.

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Doc from java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

Returns:String

the detail message string of this Throwable instance (which may be null).

Annotations
@Override
hasFailuresback to summary
public boolean hasFailures()

Returns whether this error contains any failures.

isBlankback to summary
private static boolean isBlank(String str)
nullSafeMessageback to summary
private static String nullSafeMessage(Throwable failure)
pluralizeback to summary
private static String pluralize(int count, String singular, String plural)