# TestFailure

@Incubating
abstract class TestFailure(source)

Describes a test failure. Contains a reference to the failure and some structural information retrieved by the test worker.

#### Since

7.6

## Constructors

TestFailure
Link copied to clipboard
constructor()

## Functions

fromFileComparisonFailure
Link copied to clipboard
open fun fromFileComparisonFailure(failure: Throwable, expected: String, actual: String, expectedContent: Array<Byte>, actualContent: Array<Byte>, @Nullable causes: @Nullable List<TestFailure>): TestFailure
Todo
fromTestAssertionFailure
Link copied to clipboard
open fun fromTestAssertionFailure(failure: Throwable, expected: String, actual: String): TestFailure
open fun fromTestAssertionFailure(failure: Throwable, expected: String, actual: String, @Nullable causes: @Nullable List<TestFailure>): TestFailure
Creates a new TestFailure instance from an assertion failure.
fromTestFrameworkFailure
Link copied to clipboard
open fun fromTestFrameworkFailure(failure: Throwable): TestFailure
Creates a new TestFailure instance from a test framework failure.
open fun fromTestFrameworkFailure(failure: Throwable, @Nullable causes: @Nullable List<TestFailure>): TestFailure
Creates a new TestFailure instance from a test framework failure.
fromTestMethodFailure
Link copied to clipboard
@Incubating
open fun fromTestMethodFailure(failure: Throwable): TestFailure
Creates a new TestFailure instance representing a failure occurring during the execution of a test method.
getCauses
Link copied to clipboard
abstract fun getCauses(): List<TestFailure>
Returns the list of causes.
getDetails
Link copied to clipboard
abstract fun getDetails(): TestFailureDetails
Returns structural information about the failure.
getRawFailure
Link copied to clipboard
abstract fun getRawFailure(): Throwable
Returns the raw failure.