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.RunMode

The different mode an invocation can run into. 

enum TestInvocation.Stage

 

Fields

public static final String COMMAND_ARGS_KEY

Key of the command line args attributes

Public constructors

TestInvocation()

Public methods

IInvocationExecution createInvocationExec(TestInvocation.RunMode mode)

Create the invocation path that should be followed.

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 notifyInvocationStopped()

Notify the TestInvocation that TradeFed has been requested to stop.

static void printStageDelimiter(TestInvocation.Stage phase, boolean end)

Prints a delimiter for a given Stage of the invocation.

String toString()

Protected methods

void setExitCode(CommandRunner.ExitCode code, Throwable stack)

Helper to set the exit code.

Fields

COMMAND_ARGS_KEY

public static final String COMMAND_ARGS_KEY

Key of the command line args attributes

Public constructors

TestInvocation

public TestInvocation ()

Public methods

createInvocationExec

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

Create the invocation path that should be followed.

Parameters
mode TestInvocation.RunMode: The mode we are currently running as.

Returns
IInvocationExecution The IInvocationExecution describing the invocation.

getDeviceLogName

public static String getDeviceLogName (TestInvocation.Stage stage)

Parameters
stage TestInvocation.Stage

Returns
String

getEmulatorLogName

public static String getEmulatorLogName (TestInvocation.Stage stage)

Parameters
stage TestInvocation.Stage

Returns
String

invoke

public 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

notifyInvocationStopped

public void notifyInvocationStopped ()

Notify the TestInvocation that TradeFed has been requested to stop.

printStageDelimiter

public static void printStageDelimiter (TestInvocation.Stage phase, 
                boolean end)

Prints a delimiter for a given Stage of the invocation.

Parameters
phase TestInvocation.Stage

end boolean

toString

public String toString ()

Returns
String

Protected methods

setExitCode

protected void setExitCode (CommandRunner.ExitCode code, 
                Throwable stack)

Helper to set the exit code. Exposed for testing.

Parameters
code CommandRunner.ExitCode

stack Throwable