public class

OrchestrationResultPrinter

extends OrchestrationRunListener
java.lang.Object
   ↳ android.support.test.orchestrator.listeners.OrchestrationRunListener
     ↳ android.support.test.orchestrator.listeners.OrchestrationResultPrinter

Class Overview

A line by line reimplementation of ERROR(/android.support.test.internal.runner.listener.InstrumentationResultPrinter)

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 AndroidTestOrchestrator cannot access.

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

Summary

Constants
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.
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.
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.
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.
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.
String REPORT_VALUE_ID This value, if stored with key REPORT_KEY_IDENTIFIER, identifies AndroidJUnitRunner as the source of the report.
int REPORT_VALUE_RESULT_ASSUMPTION_FAILURE The test completed with an assumption failure.
int REPORT_VALUE_RESULT_ERROR This constant is deprecated. not supported in JUnit4, use REPORT_VALUE_RESULT_FAILURE instead
int REPORT_VALUE_RESULT_FAILURE The test completed with a failure.
int REPORT_VALUE_RESULT_IGNORED The test was ignored.
int REPORT_VALUE_RESULT_OK The test completed successfully.
int REPORT_VALUE_RESULT_START The test is starting.
Public Constructors
OrchestrationResultPrinter()
Public Methods
void orchestrationRunFinished(PrintStream streamResult, OrchestrationResult orchestrationResults)
void orchestrationRunStarted(int testCount)
void reportProcessCrash(Throwable t)
Produce a more meaningful crash report including stack trace and report it back to Instrumentation results.
void sendStatus(int code, Bundle bundle)
void testAssumptionFailure(ParcelableFailure failure)
void testFailure(ParcelableFailure failure)
void testFinished(ParcelableDescription description)
void testIgnored(ParcelableDescription description)
void testStarted(ParcelableDescription description)
send a status for the start of a each test, so long tests can be seen as "running"
[Expand]
Inherited Methods
From class android.support.test.orchestrator.listeners.OrchestrationRunListener
From class java.lang.Object

Constants

public static final 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.

Constant Value: "class"

public static final 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.

Constant Value: "test"

public static final 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.

Constant Value: "current"

public static final 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.

Constant Value: "numtests"

public static final 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.

Constant Value: "stack"

public static final 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.

Constant Value: "AndroidJUnitRunner"

public static final int REPORT_VALUE_RESULT_ASSUMPTION_FAILURE

The test completed with an assumption failure.

Constant Value: -4 (0xfffffffc)

public static final int REPORT_VALUE_RESULT_ERROR

This constant is deprecated.
not supported in JUnit4, use REPORT_VALUE_RESULT_FAILURE instead

The test completed with an error.

Constant Value: -1 (0xffffffff)

public static final int REPORT_VALUE_RESULT_FAILURE

The test completed with a failure.

Constant Value: -2 (0xfffffffe)

public static final int REPORT_VALUE_RESULT_IGNORED

The test was ignored.

Constant Value: -3 (0xfffffffd)

public static final int REPORT_VALUE_RESULT_OK

The test completed successfully.

Constant Value: 0 (0x00000000)

public static final int REPORT_VALUE_RESULT_START

The test is starting.

Constant Value: 1 (0x00000001)

Public Constructors

public OrchestrationResultPrinter ()

Public Methods

public void orchestrationRunFinished (PrintStream streamResult, OrchestrationResult orchestrationResults)

Parameters
streamResult PrintStream
orchestrationResults OrchestrationResult

public void orchestrationRunStarted (int testCount)

Parameters
testCount int

public void reportProcessCrash (Throwable t)

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

Parameters
t Throwable

public void sendStatus (int code, Bundle bundle)

Convenience method for ERROR(/#getInstrumentation()#sendStatus())

Parameters
code int
bundle Bundle

public void testAssumptionFailure (ParcelableFailure failure)

Parameters
failure ParcelableFailure

public void testFailure (ParcelableFailure failure)

Parameters
failure ParcelableFailure

public void testFinished (ParcelableDescription description)

Parameters
description ParcelableDescription

public void testIgnored (ParcelableDescription description)

Parameters
description ParcelableDescription

public void testStarted (ParcelableDescription description)

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

Parameters
description ParcelableDescription