public class TestFailure extends Object
TestFailure collects a failed test together with
the caught exception.TestResult| Modifier and Type | Field and Description |
|---|---|
protected Test |
fFailedTest |
protected Throwable |
fThrownException |
| Constructor and Description |
|---|
TestFailure(Test failedTest,
Throwable thrownException)
Constructs a TestFailure with the given test and exception.
|
| Modifier and Type | Method and Description |
|---|---|
String |
exceptionMessage()
Returns a String containing the message from the thrown exception.
|
Test |
failedTest()
Gets the failed test.
|
boolean |
isFailure()
Returns
true if the error is considered a failure
(i.e. |
Throwable |
thrownException()
Gets the thrown exception.
|
String |
toString()
Returns a short description of the failure.
|
String |
trace()
Returns a String containing the stack trace of the error
thrown by TestFailure.
|
protected Test fFailedTest
protected Throwable fThrownException
public TestFailure(Test failedTest, Throwable thrownException)
public Test failedTest()
public Throwable thrownException()
public String trace()
public String exceptionMessage()
public boolean isFailure()
true if the error is considered a failure
(i.e. if it is an instance of AssertionFailedError),
false otherwise.Copyright © 2002–2020 JUnit. All rights reserved.