{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
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.
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 void |
orchestrationRunStarted(@NonNull int testCount) |
@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" |
@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.
@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.
@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.
@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.
@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.
@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.
@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_ASSUMPTION_FAILURE
The test completed with an assumption failure.
@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_ERROR
The test completed with an error.
@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_FAILURE
The test completed with a failure.
@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_IGNORED
The test was ignored.
@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_OK
The test completed successfully.
@NonNull
public static final @NonNull int REPORT_VALUE_RESULT_START
The test is starting.
@NonNull
public void orchestrationRunFinished(
@NonNull PrintStream streamResult,
@NonNull OrchestrationResult orchestrationResults
)
@NonNull
public void reportProcessCrash(@NonNull Throwable t)
Produce a more meaningful crash report including stack trace and report it back to Instrumentation results.
@NonNull
public void sendStatus(@NonNull int code, @NonNull Bundle bundle)
Convenience method for getInstrumentation
@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"