Package junit.framework
Class TestFailure
- java.lang.Object
-
- junit.framework.TestFailure
-
public class TestFailure extends Object
ATestFailure
collects a failed test together with the caught exception.- See Also:
TestResult
-
-
Field Summary
Fields Modifier and Type Field Description protected Test
fFailedTest
protected Throwable
fThrownException
-
Constructor Summary
Constructors Constructor Description TestFailure(Test failedTest, Throwable thrownException)
Constructs a TestFailure with the given test and exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
exceptionMessage()
Returns a String containing the message from the thrown exception.Test
failedTest()
Gets the failed test.boolean
isFailure()
Returnstrue
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.
-
-
-
Method Detail
-
failedTest
public Test failedTest()
Gets the failed test.
-
thrownException
public Throwable thrownException()
Gets the thrown exception.
-
toString
public String toString()
Returns a short description of the failure.
-
trace
public String trace()
Returns a String containing the stack trace of the error thrown by TestFailure.
-
exceptionMessage
public String 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.
-
-