public class TestFailure
extends java.lang.Object
TestFailure
collects a failed test together with
the caught exception.TestResult
Modifier and Type | Field and Description |
---|---|
protected Test |
fFailedTest |
protected java.lang.Throwable |
fThrownException |
Constructor and Description |
---|
TestFailure(Test failedTest,
java.lang.Throwable thrownException)
Constructs a TestFailure with the given test and exception.
|
Modifier and Type | Method and Description |
---|---|
java.lang.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. |
java.lang.Throwable |
thrownException()
Gets the thrown exception.
|
java.lang.String |
toString()
Returns a short description of the failure.
|
java.lang.String |
trace()
Returns a String containing the stack trace of the error
thrown by TestFailure.
|
protected Test fFailedTest
protected java.lang.Throwable fThrownException
public TestFailure(Test failedTest, java.lang.Throwable thrownException)
public Test failedTest()
public java.lang.Throwable thrownException()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String trace()
public java.lang.String exceptionMessage()
public boolean isFailure()
true
if the error is considered a failure
(i.e. if it is an instance of AssertionFailedError
),
false
otherwise.