{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

BundleJUnitUtils

public final class BundleJUnitUtils


Utility methods to turn JUnit objects into bundles holding imitations that can be used by .

Summary

Public constructors

Public methods

static Bundle
getBundleFromDescription(Description description)
static Bundle
getBundleFromFailure(Failure failure)
static Bundle
getBundleFromResult(Result result)
static Bundle
getBundleFromThrowable(Description description, Throwable throwable)

Generates a bundle from a description and a given error.

static ParcelableDescription
getDescription(Bundle bundle)
static ParcelableFailure
getFailure(Bundle bundle)
static ParcelableResult
getResult(Bundle bundle)

Public constructors

BundleJUnitUtils

public final BundleJUnitUtils()

Public methods

getBundleFromDescription

public static Bundle getBundleFromDescription(Description description)

getBundleFromFailure

public static Bundle getBundleFromFailure(Failure failure)

getBundleFromResult

public static Bundle getBundleFromResult(Result result)

getBundleFromThrowable

public static Bundle getBundleFromThrowable(Description description, Throwable throwable)

Generates a bundle from a description and a given error.

Parameters
Description description

A JUnit Description of the test

Throwable throwable

The root exception cause

Returns
Bundle

A bundle containing a ParcelableFailure constructed from the description and throwable

getDescription

public static ParcelableDescription getDescription(Bundle bundle)

getFailure

public static ParcelableFailure getFailure(Bundle bundle)

getResult

public static ParcelableResult getResult(Bundle bundle)