org.junit.runners.model
Class MultipleFailureException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.junit.runners.model.MultipleFailureException
All Implemented Interfaces:
Serializable

public class MultipleFailureException
extends Exception

Collects multiple Throwables into one exception.

Since:
4.9
See Also:
Serialized Form

Constructor Summary
MultipleFailureException(List<Throwable> errors)
           
 
Method Summary
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
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultipleFailureException

public MultipleFailureException(List<Throwable> errors)
Method Detail

getFailures

public List<Throwable> getFailures()

getMessage

public String getMessage()
Overrides:
getMessage in class Throwable

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream s)
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintWriter s)
Overrides:
printStackTrace in class Throwable

assertEmpty

public static void assertEmpty(List<Throwable> errors)
                        throws Exception
Asserts that a list of throwables is empty. If it isn't empty, will throw MultipleFailureException (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


Copyright © 2002–2021 JUnit. All rights reserved.