Package junit.framework
Class TestFailure
java.lang.Object
junit.framework.TestFailure
A
TestFailure
collects a failed test together with
the caught exception.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTestFailure
(Test failedTest, Throwable thrownException) Constructs a TestFailure with the given test and exception. -
Method Summary
Modifier and TypeMethodDescriptionReturns a String containing the message from the thrown exception.Gets the failed test.boolean
Returnstrue
if the error is considered a failure (i.e.Gets the thrown exception.toString()
Returns a short description of the failure.trace()
Returns a String containing the stack trace of the error thrown by TestFailure.
-
Field Details
-
fFailedTest
-
fThrownException
-
-
Constructor Details
-
TestFailure
Constructs a TestFailure with the given test and exception.
-
-
Method Details
-
failedTest
Gets the failed test. -
thrownException
Gets the thrown exception. -
toString
Returns a short description of the failure. -
trace
Returns a String containing the stack trace of the error thrown by TestFailure. -
exceptionMessage
Returns a String containing the message from the thrown exception. -
isFailure
public boolean isFailure()Returnstrue
if the error is considered a failure (i.e. if it is an instance ofAssertionFailedError
),false
otherwise.
-