November 2004
Intermediate to advanced
212 pages
5h 2m
English
TestFailure
TestFailure
(see Figure B-7) is a
class containing a Test and an associated
exception. TestResult produces a
TestFailure whenever there is a test failure or
error.
![]() |
public class TestFailure extends Object
TestFailure(Test failedTest, Throwable thrownException)
Constructs a TestFailure for a
Test and its exception.
String exceptionMessage( )
Gets the exception message.
Test failedTest( )
Gets the failed test.
boolean isFailure( )
Returns TRUE if the exception is a failure
represented by an instance of
AssertionFailedError. If FALSE,
the test produced an error.
Throwable thrownException( )
Gets the exception.
String toString( )
Returns a description of the failure consisting of the string
Test.toString( ) and the exception message.
String trace( )
Returns the stack trace for the exception.
None.
protected Test fFailedTest
protected Throwable fThrownException
These attributes contain the Test and the
exception.
Read now
Unlock full access