TestInvocation

public class TestInvocation
extends Object implements ITestInvocation

java.lang.Object
   ↳ com.android.tradefed.invoker.TestInvocation


Default implementation of ITestInvocation.

Loads major objects based on IConfiguration - retrieves build - prepares target - runs tests - reports results

Summary

Nested classes

enum TestInvocation.Stage

 

Constants

String BATT_TAG

String BUILD_ERROR_BUGREPORT_NAME

String DEVICE_LOG_NAME_PREFIX

String DEVICE_UNRESPONSIVE_BUGREPORT_NAME

String EMULATOR_LOG_NAME_PREFIX

String INVOCATION_ENDED_BUGREPORT_NAME

String TARGET_SETUP_ERROR_BUGREPORT_NAME

String TRADEFED_LOG_NAME

Public constructors

TestInvocation()

Public methods

static String getDeviceLogName(TestInvocation.Stage stage)
static String getEmulatorLogName(TestInvocation.Stage stage)
void invoke(IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)

Perform the test invocation.

void invoke(ITestDevice device, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)

This method is deprecated. use invoke(IInvocationContext, IConfiguration, IRescheduler, ITestInvocationListener[]) instead.

String toString()

Protected methods

IConfigurationFactory getConfigFactory()

Factory method for getting a reference to the IConfigurationFactory

void setExitCode(CommandRunner.ExitCode code, Throwable stack)

Helper to set the exit code.

Constants

BATT_TAG

String BATT_TAG

Constant Value: "[battery level]"

BUILD_ERROR_BUGREPORT_NAME

String BUILD_ERROR_BUGREPORT_NAME

Constant Value: "build_error_bugreport"

DEVICE_LOG_NAME_PREFIX

String DEVICE_LOG_NAME_PREFIX

Constant Value: "device_logcat_"

DEVICE_UNRESPONSIVE_BUGREPORT_NAME

String DEVICE_UNRESPONSIVE_BUGREPORT_NAME

Constant Value: "device_unresponsive_bugreport"

EMULATOR_LOG_NAME_PREFIX

String EMULATOR_LOG_NAME_PREFIX

Constant Value: "emulator_log_"

INVOCATION_ENDED_BUGREPORT_NAME

String INVOCATION_ENDED_BUGREPORT_NAME

Constant Value: "invocation_ended_bugreport"

TARGET_SETUP_ERROR_BUGREPORT_NAME

String TARGET_SETUP_ERROR_BUGREPORT_NAME

Constant Value: "target_setup_error_bugreport"

TRADEFED_LOG_NAME

String TRADEFED_LOG_NAME

Constant Value: "host_log"

Public constructors

TestInvocation

TestInvocation ()

Public methods

getDeviceLogName

String getDeviceLogName (TestInvocation.Stage stage)

Parameters
stage TestInvocation.Stage
Returns
String

getEmulatorLogName

String getEmulatorLogName (TestInvocation.Stage stage)

Parameters
stage TestInvocation.Stage
Returns
String

invoke

void invoke (IInvocationContext context, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener... extraListeners)

Perform the test invocation.

Parameters
context IInvocationContext: the IInvocationContext to perform tests.
config IConfiguration: the IConfiguration of this test run.
rescheduler IRescheduler: the IRescheduler, for rescheduling portions of the invocation for execution on another resource(s)
extraListeners ITestInvocationListener: ITestInvocationListeners to notify, in addition to those in config
Throws
DeviceNotAvailableException
Throwable

invoke

void invoke (ITestDevice device, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener... extraListeners)

This method is deprecated.
use invoke(IInvocationContext, IConfiguration, IRescheduler, ITestInvocationListener[]) instead.

Perform the test invocation. FIXME: Remove when fully moved to new interface.

Parameters
device ITestDevice: the ITestDevice to perform tests.
config IConfiguration: the IConfiguration of this test run.
rescheduler IRescheduler: the IRescheduler, for rescheduling portions of the invocation for execution on another resource(s)
extraListeners ITestInvocationListener: ITestInvocationListeners to notify, in addition to those in config
Throws
DeviceNotAvailableException
Throwable

toString

String toString ()

Returns
String

Protected methods

getConfigFactory

IConfigurationFactory getConfigFactory ()

Factory method for getting a reference to the IConfigurationFactory

Returns
IConfigurationFactory the IConfigurationFactory to use

setExitCode

void setExitCode (CommandRunner.ExitCode code, 
                Throwable stack)

Helper to set the exit code. Exposed for testing.

Parameters
code CommandRunner.ExitCode
stack Throwable