# 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: 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: List<TestFailure>): TestFailure
Creates a new TestFailure instance from an assertion failure.
fromTestFrameworkFailure
Link copied to clipboard
open fun fromTestFrameworkFailure(failure: Throwable): TestFailure
open fun fromTestFrameworkFailure(failure: Throwable, @Nullable causes: List<TestFailure>): TestFailure
Creates a new TestFailure instance from a test framework failure.
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.