{% 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 methods

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

Generates a bundle from a description and a given error.

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

Public methods

getBundleFromDescription

@NonNull
public static Bundle getBundleFromDescription(@NonNull Description description)

getBundleFromFailure

@NonNull
public static Bundle getBundleFromFailure(@NonNull Failure failure)

getBundleFromResult

@NonNull
public static Bundle getBundleFromResult(@NonNull Result result)

getBundleFromThrowable

@NonNull
public static Bundle getBundleFromThrowable(
    @NonNull Description description,
    @NonNull Throwable throwable
)

Generates a bundle from a description and a given error.

Parameters
@NonNull Description description

A JUnit Description of the test

@NonNull Throwable throwable

The root exception cause

Returns
Bundle

A bundle containing a ParcelableFailure constructed from the description and throwable

getDescription

@NonNull
public static ParcelableDescription getDescription(@NonNull Bundle bundle)

getFailure

@NonNull
public static ParcelableFailure getFailure(@NonNull Bundle bundle)

getResult

@NonNull
public static ParcelableResult getResult(@NonNull Bundle bundle)