Serializablepublic class Failure extends Object implements 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,
Throwable thrownException) |
Constructs a
Failure with the given description and exception. |
| Modifier and Type | Method | Description |
|---|---|---|
Description |
getDescription() |
|
Throwable |
getException() |
|
String |
getMessage() |
Convenience method
|
String |
getTestHeader() |
|
String |
getTrace() |
Convenience method
|
String |
toString() |
public Failure(Description description, 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 String getTestHeader()
public Description getDescription()
public Throwable getException()
public String getMessage()
Copyright © 2002–2018 JUnit. All rights reserved.