java.io.Serializablepublic class Failure
extends java.lang.Object
implements java.io.Serializable
Failure holds a description of the failed test and the
exception that was thrown while running it. In most cases the Description
will be of a single test. However, if problems are encountered while constructing the
test (for example, if a BeforeClass method is not static), it may describe
something other than a single test.| Constructor | Description |
|---|---|
Failure(Description description,
java.lang.Throwable thrownException) |
Constructs a
Failure with the given description and exception. |
| Modifier and Type | Method | Description |
|---|---|---|
Description |
getDescription() |
|
java.lang.Throwable |
getException() |
|
java.lang.String |
getMessage() |
Convenience method
|
java.lang.String |
getTestHeader() |
|
java.lang.String |
getTrace() |
Convenience method
|
java.lang.String |
toString() |
public Failure(Description description, java.lang.Throwable thrownException)
Failure with the given description and exception.description - a Description of the test that failedthrownException - the exception that was thrown while running the testpublic java.lang.String getTestHeader()
public Description getDescription()
public java.lang.Throwable getException()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getTrace()
public java.lang.String getMessage()