Skip to content

Most visited

Recently visited

navigation

TestFailure

public class TestFailure
extends Object

java.lang.Object
   ↳ junit.framework.TestFailure


A TestFailure collects a failed test together with the caught exception.

See also:

Summary

Fields

protected Test fFailedTest

protected Throwable fThrownException

Public constructors

TestFailure(Test failedTest, Throwable thrownException)

Constructs a TestFailure with the given test and exception.

Public methods

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()

Inherited methods

From class java.lang.Object

Fields

fFailedTest

added in API level 1
Test fFailedTest

fThrownException

added in API level 1
Throwable fThrownException

Public constructors

TestFailure

added in API level 1
TestFailure (Test failedTest, 
                Throwable thrownException)

Constructs a TestFailure with the given test and exception.

Parameters
failedTest Test

thrownException Throwable

Public methods

exceptionMessage

added in API level 1
String exceptionMessage ()

Returns
String

failedTest

added in API level 1
Test failedTest ()

Gets the failed test.

Returns
Test

isFailure

added in API level 1
boolean isFailure ()

Returns
boolean

thrownException

added in API level 1
Throwable thrownException ()

Gets the thrown exception.

Returns
Throwable

toString

added in API level 1
String toString ()

Returns a short description of the failure.

Returns
String a string representation of the object.

trace

added in API level 1
String trace ()

Returns
String

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)