Package junit.framework
Class TestFailure
- java.lang.Object
-
- junit.framework.TestFailure
-
public class TestFailure extends java.lang.ObjectATestFailurecollects a failed test together with the caught exception.- See Also:
TestResult
-
-
Field Summary
Fields Modifier and Type Field Description protected TestfFailedTestprotected java.lang.ThrowablefThrownException
-
Constructor Summary
Constructors Constructor Description TestFailure(Test failedTest, java.lang.Throwable thrownException)Constructs a TestFailure with the given test and exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringexceptionMessage()Returns a String containing the message from the thrown exception.TestfailedTest()Gets the failed test.booleanisFailure()Returnstrueif the error is considered a failure (i.e.java.lang.ThrowablethrownException()Gets the thrown exception.java.lang.StringtoString()Returns a short description of the failure.java.lang.Stringtrace()Returns a String containing the stack trace of the error thrown by TestFailure.
-
-
-
Field Detail
-
fFailedTest
protected Test fFailedTest
-
fThrownException
protected java.lang.Throwable fThrownException
-
-
Constructor Detail
-
TestFailure
public TestFailure(Test failedTest, java.lang.Throwable thrownException)
Constructs a TestFailure with the given test and exception.
-
-
Method Detail
-
failedTest
public Test failedTest()
Gets the failed test.
-
thrownException
public java.lang.Throwable thrownException()
Gets the thrown exception.
-
toString
public java.lang.String toString()
Returns a short description of the failure.- Overrides:
toStringin classjava.lang.Object
-
trace
public java.lang.String trace()
Returns a String containing the stack trace of the error thrown by TestFailure.
-
exceptionMessage
public java.lang.String exceptionMessage()
Returns a String containing the message from the thrown exception.
-
isFailure
public boolean isFailure()
Returnstrueif the error is considered a failure (i.e. if it is an instance ofAssertionFailedError),falseotherwise.
-
-