子進程TfLauncher
public abstract class SubprocessTfLauncher
extends Object
implements IBuildReceiver , IInvocationContextReceiver , IRemoteTest, IConfigurationReceiver
java.lang.Object | |
↳ | com.android.tradefed.testtype.SubprocessTfLauncher |
用於針對單獨的 TF 安裝運行測試的IRemoteTest
。
啟動外部 java 進程來執行測試。用於連續運行 TF 單元或功能測試。
概括
領域 | |
---|---|
public static final String | ANDROID_SERIAL_VAR 環境。 |
public static final String | PARENT_PROC_TAG_NAME |
public static final String | SUBPROCESS_TAG_NAME 將傳遞給 TF 子進程以區分它的標籤 |
protected IBuildInfo | mBuildInfo |
protected | mCmdArgs |
protected IConfiguration | mConfig |
protected String | mRootDir |
protected IRunUtil | mRunUtil |
protected File | mTmpDir
|
公共構造函數 | |
---|---|
SubprocessTfLauncher () |
公共方法 | |
---|---|
void | run (TestInformation testInfo, ITestInvocationListener listener) |
void | setBuild (IBuildInfo buildInfo) |
void | setConfiguration ( IConfiguration configuration) 注入正在使用的 |
void | setInvocationContext (IInvocationContext invocationContext) |
受保護的方法 | |
---|---|
void | addJavaArguments ( args) addJavaArguments ( args) 允許向子流程呼叫添加額外的 java 參數。 |
IRunUtil | getRunUtil () 傳回將用於子進程命令的 |
void | postRun (ITestInvocationListener listener, boolean exception, long elapsedTime) TF 測試完成後要採取的操作。 |
void | preRun () 運行測試之前進行設定。 |
void | setEventStreaming (boolean eventStreaming) 設定使用事件流。 |
void | setRunUtil (IRunUtil runUtil) 設定IRunUtil。 |
領域
ANDROID_SERIAL_VAR
public static final String ANDROID_SERIAL_VAR
環境。影響 adb 選擇的變數。
PARENT_PROC_TAG_NAME
public static final String PARENT_PROC_TAG_NAME
SUBPROCESS_TAG_NAME
public static final String SUBPROCESS_TAG_NAME
將傳遞給 TF 子進程以區分它的標籤
mBuildInfo
protected IBuildInfo mBuildInfo
mCmdArgs
protectedmCmdArgs
根目錄
protected String mRootDir
運行工具
protected IRunUtil mRunUtil
暫存目錄
protected File mTmpDir
公共構造函數
子進程TfLauncher
public SubprocessTfLauncher ()
公共方法
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
參數 | |
---|---|
testInfo | TestInformation |
listener | ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
設定建置
public void setBuild (IBuildInfo buildInfo)
參數 | |
---|---|
buildInfo | IBuildInfo |
設定配置
public void setConfiguration (IConfiguration configuration)
注入正在使用的IConfiguration
。
參數 | |
---|---|
configuration | IConfiguration |
設定呼叫上下文
public void setInvocationContext (IInvocationContext invocationContext)
參數 | |
---|---|
invocationContext | IInvocationContext |
受保護的方法
新增Java參數
protected void addJavaArguments (args)
允許向子流程呼叫添加額外的 java 參數。
參數 | |
---|---|
args |
運行後
protected void postRun (ITestInvocationListener listener, boolean exception, long elapsedTime)
TF 測試完成後要採取的操作。
參數 | |
---|---|
listener | ITestInvocationListener :原始ITestInvocationListener 報告結果的位置。 |
exception | boolean :如果在測試中引發異常,則為 True。 |
elapsedTime | long :運行測試所需的時間。 |
預先運行
protected void preRun ()
運行測試之前進行設定。
設定事件流
protected void setEventStreaming (boolean eventStreaming)
設定使用事件流。暴露用於單元測試。
參數 | |
---|---|
eventStreaming | boolean |
設定運行工具
protected void setRunUtil (IRunUtil runUtil)
設定IRunUtil。暴露用於單元測試。
參數 | |
---|---|
runUtil | IRunUtil |