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

OrchestrationResultPrinter

public 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

static final @NonNull String

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

static final @NonNull String

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

static final @NonNull String

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

static final @NonNull 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.

static final @NonNull String

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

static final @NonNull String

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

static final @NonNull int

The test completed with an assumption failure.

static final @NonNull int

This field is deprecated.

not supported in JUnit4, use REPORT_VALUE_RESULT_FAILURE instead

static final @NonNull int

The test completed with a failure.

static final @NonNull int

The test was ignored.

static final @NonNull int

The test completed successfully.

static final @NonNull int

The test is starting.

Public constructors

Public methods

@NonNull void
orchestrationRunFinished(
    @NonNull PrintStream streamResult,
    @NonNull OrchestrationResult orchestrationResults
)
@NonNull void
@NonNull void

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

@NonNull void
sendStatus(@NonNull int code, @NonNull Bundle bundle)

Convenience method for getInstrumentation

@NonNull void
testAssumptionFailure(@NonNull ParcelableFailure failure)
@NonNull void
testFailure(@NonNull ParcelableFailure failure)
@NonNull void
testFinished(@NonNull ParcelableDescription description)
@NonNull void
testIgnored(@NonNull ParcelableDescription description)
@NonNull void
testStarted(@NonNull ParcelableDescription description)

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

Constants

REPORT_KEY_NAME_CLASS

@NonNull
public static final @NonNull String REPORT_KEY_NAME_CLASS

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

@NonNull
public static final @NonNull String REPORT_KEY_NAME_TEST

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

@NonNull
public static final @NonNull String REPORT_KEY_NUM_CURRENT

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

@NonNull
public static final @NonNull String REPORT_KEY_NUM_TOTAL

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

@NonNull
public static final @NonNull String REPORT_KEY_STACK

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

@NonNull
public static final @NonNull String REPORT_VALUE_ID

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

@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_ASSUMPTION_FAILURE

The test completed with an assumption failure.

REPORT_VALUE_RESULT_ERROR

@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_ERROR

The test completed with an error.

REPORT_VALUE_RESULT_FAILURE

@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_FAILURE

The test completed with a failure.

REPORT_VALUE_RESULT_IGNORED

@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_IGNORED

The test was ignored.

REPORT_VALUE_RESULT_OK

@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_OK

The test completed successfully.

REPORT_VALUE_RESULT_START

@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_START

The test is starting.

Public constructors

OrchestrationResultPrinter

public OrchestrationResultPrinter()

Public methods

orchestrationRunFinished

@NonNull
public void orchestrationRunFinished(
    @NonNull PrintStream streamResult,
    @NonNull OrchestrationResult orchestrationResults
)

orchestrationRunStarted

@NonNull
public void orchestrationRunStarted(@NonNull int testCount)

reportProcessCrash

@NonNull
public void reportProcessCrash(@NonNull Throwable t)

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

sendStatus

@NonNull
public void sendStatus(@NonNull int code, @NonNull Bundle bundle)

Convenience method for getInstrumentation

testAssumptionFailure

@NonNull
public void testAssumptionFailure(@NonNull ParcelableFailure failure)

testFailure

@NonNull
public void testFailure(@NonNull ParcelableFailure failure)

testFinished

@NonNull
public void testFinished(@NonNull ParcelableDescription description)

testIgnored

@NonNull
public void testIgnored(@NonNull ParcelableDescription description)

testStarted

@NonNull
public void testStarted(@NonNull ParcelableDescription description)

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