Package junit.framework

# Class TestFailure

java.lang.Object
junit.framework.TestFailure

public class TestFailure extends Object
A `TestFailure` 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

Modifier and Type
Method
Description
`String`
`exceptionMessage()`
`Test`
`failedTest()`
Gets the failed test.
`boolean`
`isFailure()`
`Throwable`
`thrownException()`
Gets the thrown exception.
`String`
`toString()`
Returns a short description of the failure.
`String`
`trace()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### fFailedTest

protected Test fFailedTest

### fThrownException

protected Throwable fThrownException

## Constructor Details

### TestFailure

public TestFailure(Test failedTest, Throwable thrownException)
Constructs a TestFailure with the given test and exception.

## Method Details

### 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.

Overrides:
  `toString` in class `Object`

### trace

public String trace()

### exceptionMessage

public String exceptionMessage()

### isFailure

public boolean isFailure()