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

BundleJUnitUtils

class BundleJUnitUtils


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

Summary

Public functions

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

Generates a bundle from a description and a given error.

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

Public functions

getBundleFromDescription

fun getBundleFromDescription(description: Description): Bundle

getBundleFromFailure

fun getBundleFromFailure(failure: Failure): Bundle

getBundleFromResult

fun getBundleFromResult(result: Result): Bundle

getBundleFromThrowable

fun getBundleFromThrowable(description: Description, throwable: Throwable): Bundle

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

fun getDescription(bundle: Bundle): ParcelableDescription

getFailure

fun getFailure(bundle: Bundle): ParcelableFailure

getResult

fun getResult(bundle: Bundle): ParcelableResult