SubprocessTfLauncher

public abstract class SubprocessTfLauncher
extends Object implements IBuildReceiver, IInvocationContextReceiver, IRemoteTest, IConfigurationReceiver

java.lang.Object
   ↳ com.android.tradefed.testtype.SubprocessTfLauncher


A IRemoteTest for running tests against a separate TF installation.

Launches an external java process to run the tests. Used for running the TF unit or functional tests continuously.

Summary

Fields

public static final String ANDROID_SERIAL_VAR

Env.

public static final String PARENT_PROC_TAG_NAME

public static final String SUBPROCESS_TAG_NAME

The tag that will be passed to the TF subprocess to differentiate it

protected IBuildInfo mBuildInfo

protected mCmdArgs

protected IConfiguration mConfig

protected String mRootDir

protected IRunUtil mRunUtil

protected File mTmpDir

Public constructors

SubprocessTfLauncher()

Public methods

void run(ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

void setBuild(IBuildInfo buildInfo)

void setConfiguration(IConfiguration configuration)

Injects the IConfiguration in use.

void setInvocationContext(IInvocationContext invocationContext)

Protected methods

void addJavaArguments( args)

Allow to add extra java parameters to the subprocess invocation.

IRunUtil getRunUtil()

Returns the IRunUtil that will be used for the subprocess command.

void postRun(ITestInvocationListener listener, boolean exception, long elapsedTime)

Actions to take after the TF test is finished.

void preRun()

Setup before running the test.

void setEventStreaming(boolean eventStreaming)

Set use-event-streaming.

void setRunUtil(IRunUtil runUtil)

Set IRunUtil.

Fields

ANDROID_SERIAL_VAR

public static final String ANDROID_SERIAL_VAR

Env. variable that affects adb selection.

PARENT_PROC_TAG_NAME

public static final String PARENT_PROC_TAG_NAME

SUBPROCESS_TAG_NAME

public static final String SUBPROCESS_TAG_NAME

The tag that will be passed to the TF subprocess to differentiate it

mBuildInfo

protected IBuildInfo mBuildInfo

mCmdArgs

protected  mCmdArgs

mConfig

protected IConfiguration mConfig

mRootDir

protected String mRootDir

mRunUtil

protected IRunUtil mRunUtil

mTmpDir

protected File mTmpDir

Public constructors

SubprocessTfLauncher

public SubprocessTfLauncher ()

Public methods

run

public void run (ITestInvocationListener listener)

Runs the tests, and reports result to the listener.

Parameters
listener ITestInvocationListener: the ITestInvocationListener of test results

setBuild

public void setBuild (IBuildInfo buildInfo)

Parameters
buildInfo IBuildInfo

setConfiguration

public void setConfiguration (IConfiguration configuration)

Injects the IConfiguration in use.

Parameters
configuration IConfiguration

setInvocationContext

public void setInvocationContext (IInvocationContext invocationContext)

Parameters
invocationContext IInvocationContext

Protected methods

addJavaArguments

protected void addJavaArguments ( args)

Allow to add extra java parameters to the subprocess invocation.

Parameters
args : the current list of arguments to which we need to add the extra ones.

getRunUtil

protected IRunUtil getRunUtil ()

Returns the IRunUtil that will be used for the subprocess command.

Returns
IRunUtil

postRun

protected void postRun (ITestInvocationListener listener, 
                boolean exception, 
                long elapsedTime)

Actions to take after the TF test is finished.

Parameters
listener ITestInvocationListener: the original ITestInvocationListener where to report results.

exception boolean: True if exception was raised inside the test.

elapsedTime long: the time taken to run the tests.

preRun

protected void preRun ()

Setup before running the test.

setEventStreaming

protected void setEventStreaming (boolean eventStreaming)

Set use-event-streaming. Exposed for unit testing.

Parameters
eventStreaming boolean

setRunUtil

protected void setRunUtil (IRunUtil runUtil)

Set IRunUtil. Exposed for unit testing.

Parameters
runUtil IRunUtil