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

OrchestrationResultPrinter

class OrchestrationResultPrinter


A line by line reimplementation of

androidx.test.orchestrator.AndroidTestOrchestrator needs to mirror the output of a non-orchestrated AndroidJUnitRunner multi-test run, and thus requires a result printer. InstrumentationResultPrinter cannot be reused because it extends from the JUnit RunListener, which passes in JUnit specific objects which cannot access.

TODO(b/35394729): Refactor expertise from this and InstrumentationResultPrinter to one place.

Summary

Constants

String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the name of the current test class.

String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the name of the current test.

String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the sequence number of the current test.

String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the total number of tests that are being run.

String

If included in the status bundle sent to an IInstrumentationWatcher, this key identifies a stack trace describing an error or failure.

String

This value, if stored with key REPORT_KEY_IDENTIFIER, identifies AndroidJUnitRunner as the source of the report.

Int

The test completed with an assumption failure.

Int

This property is deprecated.

not supported in JUnit4, use REPORT_VALUE_RESULT_FAILURE instead

Int

The test completed with a failure.

Int

The test was ignored.

Int

The test completed successfully.

Int

The test is starting.

Public constructors

Public functions

Unit
orchestrationRunFinished(
    streamResult: PrintStream,
    orchestrationResults: OrchestrationResult
)
Unit
Unit

Produce a more meaningful crash report including stack trace and report it back to Instrumentation results.

Unit
sendStatus(code: Int, bundle: Bundle)

Convenience method for getInstrumentation

Unit
testAssumptionFailure(failure: ParcelableFailure)
Unit
testFailure(failure: ParcelableFailure)
Unit
testFinished(description: ParcelableDescription)
Unit
testIgnored(description: ParcelableDescription)
Unit
testStarted(description: ParcelableDescription)

send a status for the start of a each test, so long tests can be seen as "running"

Constants

REPORT_KEY_NAME_CLASS

val REPORT_KEY_NAME_CLASS: String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the name of the current test class. This is sent with any status message describing a specific test being started or completed.

REPORT_KEY_NAME_TEST

val REPORT_KEY_NAME_TEST: String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the name of the current test. This is sent with any status message describing a specific test being started or completed.

REPORT_KEY_NUM_CURRENT

val REPORT_KEY_NUM_CURRENT: String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the sequence number of the current test. This is sent with any status message describing a specific test being started or completed.

REPORT_KEY_NUM_TOTAL

val REPORT_KEY_NUM_TOTAL: String

If included in the status or final bundle sent to an IInstrumentationWatcher, this key identifies the total number of tests that are being run. This is sent with all status messages.

REPORT_KEY_STACK

val REPORT_KEY_STACK: String

If included in the status bundle sent to an IInstrumentationWatcher, this key identifies a stack trace describing an error or failure. This is sent with any status message describing a specific test being completed.

REPORT_VALUE_ID

val REPORT_VALUE_ID: String

This value, if stored with key REPORT_KEY_IDENTIFIER, identifies AndroidJUnitRunner as the source of the report. This is sent with all status messages.

REPORT_VALUE_RESULT_ASSUMPTION_FAILURE

val REPORT_VALUE_RESULT_ASSUMPTION_FAILURE: Int

The test completed with an assumption failure.

REPORT_VALUE_RESULT_ERROR

val REPORT_VALUE_RESULT_ERROR: Int

The test completed with an error.

REPORT_VALUE_RESULT_FAILURE

val REPORT_VALUE_RESULT_FAILURE: Int

The test completed with a failure.

REPORT_VALUE_RESULT_IGNORED

val REPORT_VALUE_RESULT_IGNORED: Int

The test was ignored.

REPORT_VALUE_RESULT_OK

val REPORT_VALUE_RESULT_OK: Int

The test completed successfully.

REPORT_VALUE_RESULT_START

val REPORT_VALUE_RESULT_START: Int

The test is starting.

Public constructors

OrchestrationResultPrinter

OrchestrationResultPrinter()

Public functions

orchestrationRunFinished

fun orchestrationRunFinished(
    streamResult: PrintStream,
    orchestrationResults: OrchestrationResult
): Unit

orchestrationRunStarted

fun orchestrationRunStarted(testCount: Int): Unit

reportProcessCrash

fun reportProcessCrash(t: Throwable): Unit

Produce a more meaningful crash report including stack trace and report it back to Instrumentation results.

sendStatus

fun sendStatus(code: Int, bundle: Bundle): Unit

Convenience method for getInstrumentation

testAssumptionFailure

fun testAssumptionFailure(failure: ParcelableFailure): Unit

testFailure

fun testFailure(failure: ParcelableFailure): Unit

testFinished

fun testFinished(description: ParcelableDescription): Unit

testIgnored

fun testIgnored(description: ParcelableDescription): Unit

testStarted

fun testStarted(description: ParcelableDescription): Unit

send a status for the start of a each test, so long tests can be seen as "running"