Interface TestFailureDetails
- Since:
- 7.6
- See Also:
-
Method Summary
Modifier and TypeMethodDescription@Nullable StringReturns a string representation of the actual value for an assertion failure.byte @Nullable []Returns the actual content of a file comparison assertion failure.The fully-qualified name of the underlying exception type.@Nullable StringReturns a string representation of the expected value for an assertion failure.byte @Nullable []Returns the expected content of a file comparison assertion failure.@Nullable StringReturns the failure message.Returns the stacktrace of the failure.booleanReturns true if the represented failure is recognized as an assertion failure.booleanIs this an assumption failure?booleanReturns true if the represented failure is recognized as a file comparison failure.default booleanIs this a test-framework failure (as opposed to a failure raised from inside a test method)?
-
Method Details
-
getMessage
-
getClassName
String getClassName()The fully-qualified name of the underlying exception type.- Returns:
- the class name
-
getStacktrace
String getStacktrace()Returns the stacktrace of the failure.The instances are created on the test worker side allowing the clients not to deal with non-serializable exceptions.
- Returns:
- the stacktrace string
-
isAssertionFailure
boolean isAssertionFailure()Returns true if the represented failure is recognized as an assertion failure.- Returns:
truefor assertion failures
-
isFileComparisonFailure
boolean isFileComparisonFailure()Returns true if the represented failure is recognized as a file comparison failure.If this field is
true, then thegetExpectedContent()andgetActualContent()methods might return non-null values.- Returns:
trueif this failure is a file comparison failure- Since:
- 8.3
-
getExpectedContent
byte @Nullable [] getExpectedContent()Returns the expected content of a file comparison assertion failure.- Returns:
- the expected file contents or
nullif the test framework doesn't supply detailed information on assertion failures, or it is not a file comparison failure - Since:
- 8.3
- See Also:
-
getActualContent
byte @Nullable [] getActualContent()Returns the actual content of a file comparison assertion failure.- Returns:
- the expected file contents or
nullif the test framework doesn't supply detailed information on assertion failures, or it is not a file comparison failure - Since:
- 8.3
- See Also:
-
getExpected
@Nullable String getExpected()Returns a string representation of the expected value for an assertion failure.If the current instance does not represent an assertion failure, or the test failure doesn't provide any information about expected and actual values then the method returns
null.- Returns:
- The expected value
-
getActual
@Nullable String getActual()Returns a string representation of the actual value for an assertion failure.If the current instance does not represent an assertion failure, or the test failure doesn't provide any information about expected and actual values then the method returns
null.- Returns:
- The actual value
-
isAssumptionFailure
boolean isAssumptionFailure()Is this an assumption failure?- Returns:
- true if this is an assumption failure
- Since:
- 8.14
-
isFrameworkFailure
Is this a test-framework failure (as opposed to a failure raised from inside a test method)?Framework failures arise when the test framework itself signals that something went wrong outside the body of a test method — for example, a TestNG test class whose constructor throws, a JUnit Jupiter
@BeforeAllhook that aborts the container, or a custom JUnit 4 runner whoserun()method throws. Such failures are typically attached to a synthesized leaf or to a composite descriptor (the worker root suite, the test class, etc.) rather than to a leaf test.These failures are surfaced to the user even under test logging configurations that would otherwise filter out the descriptor they are attached to.
- Returns:
trueif this is a test-framework failure- Since:
- 9.7.0
-