Package org.junit.runners.model
Class MultipleFailureException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.junit.runners.model.MultipleFailureException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MultipleFailureException
public class MultipleFailureException extends Exception
Collects multipleThrowable
s into one exception.- Since:
- 4.9
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MultipleFailureException(List<Throwable> errors)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
assertEmpty(List<Throwable> errors)
Asserts that a list of throwables is empty.List<Throwable>
getFailures()
String
getMessage()
void
printStackTrace()
void
printStackTrace(PrintStream s)
void
printStackTrace(PrintWriter s)
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace, toString
-
-
-
-
Method Detail
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
printStackTrace
public void printStackTrace()
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
public void printStackTrace(PrintStream s)
- Overrides:
printStackTrace
in classThrowable
-
printStackTrace
public void printStackTrace(PrintWriter s)
- Overrides:
printStackTrace
in classThrowable
-
assertEmpty
public static void assertEmpty(List<Throwable> errors) throws Exception
Asserts that a list of throwables is empty. If it isn't empty, will throwMultipleFailureException
(if there are multiple throwables in the list) or the first element in the list (if there is only one element).- Parameters:
errors
- list to check- Throws:
Exception
- or Error if the list is not empty
-
-