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

Constants

String TF_GLOBAL_CONFIG

Fields

protected IBuildInfo mBuildInfo

protected List<String> 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(List<String> 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.

Constants

TF_GLOBAL_CONFIG

protected static final String TF_GLOBAL_CONFIG

Constant Value: "TF_GLOBAL_CONFIG"

Fields

mBuildInfo

protected IBuildInfo mBuildInfo

mCmdArgs

protected List<String> 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 (List<String> args)

Allow to add extra java parameters to the subprocess invocation.

Parameters
args List: 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