SubprocessTfLauncher
public
abstract
class
SubprocessTfLauncher
extends Object
implements
IBuildReceiver,
IConfigurationReceiver,
IInvocationContextReceiver,
IRemoteTest
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(TestInformation testInfo, ITestInvocationListener listener)
Runs the tests, and reports result to the listener. |
void
|
setBuild(IBuildInfo buildInfo)
|
void
|
setConfiguration(IConfiguration configuration)
Injects the |
void
|
setInvocationContext(IInvocationContext invocationContext)
|
Protected methods | |
---|---|
void
|
addJavaArguments(
Allow to add extra java parameters to the subprocess invocation. |
String
|
getJava()
|
IRunUtil
|
getRunUtil()
Returns the |
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
|
setProtoReporting(boolean protoReporting)
|
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
mCmdArgs
protectedmCmdArgs
mRootDir
protected String mRootDir
mTmpDir
protected File mTmpDir
Public constructors
SubprocessTfLauncher
public SubprocessTfLauncher ()
Public methods
run
public void run (TestInformation testInfo, ITestInvocationListener listener)
Runs the tests, and reports result to the listener.
Parameters | |
---|---|
testInfo |
TestInformation : The TestInformation object containing useful information to run
tests. |
listener |
ITestInvocationListener : the ITestInvocationListener of test results |
Throws | |
---|---|
DeviceNotAvailableException |
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. |
getJava
protected String getJava ()
Returns | |
---|---|
String |
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 |
setProtoReporting
protected void setProtoReporting (boolean protoReporting)
Parameters | |
---|---|
protoReporting |
boolean |
setRunUtil
protected void setRunUtil (IRunUtil runUtil)
Set IRunUtil. Exposed for unit testing.
Parameters | |
---|---|
runUtil |
IRunUtil |