子進程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 參數。 |
String | getJava () |
IRunUtil | getRunUtil () 返回將用於子進程命令的 |
void | postRun ( ITestInvocationListener listener, boolean exception, long elapsedTime) TF 測試完成後要採取的操作。 |
void | preRun () 運行測試之前進行設置。 |
void | setEventStreaming (boolean eventStreaming) 設置使用事件流。 |
void | setProtoReporting (boolean protoReporting) |
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 IConfiguration mConfig
根目錄
protected String mRootDir
運行工具
protected IRunUtil mRunUtil
臨時目錄
protected File mTmpDir
公共構造函數
子進程TfLauncher
public SubprocessTfLauncher ()
公共方法
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
運行測試,並將結果報告給偵聽器。
參數 | |
---|---|
testInfo | TestInformation : TestInformation 對象包含運行測試的有用信息。 |
listener | ITestInvocationListener :測試結果的ITestInvocationListener |
投擲 | |
---|---|
DeviceNotAvailableException |
設置配置
public void setConfiguration (IConfiguration configuration)
注入正在使用的IConfiguration
。
參數 | |
---|---|
configuration | IConfiguration |
設置調用上下文
public void setInvocationContext (IInvocationContext invocationContext)
參數 | |
---|---|
invocationContext | IInvocationContext |
受保護的方法
添加Java參數
protected void addJavaArguments (args)
允許向子流程調用添加額外的 java 參數。
參數 | |
---|---|
args |
獲取Java
protected String getJava ()
退貨 | |
---|---|
String |
運行後
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 |
設置ProtoReporting
protected void setProtoReporting (boolean protoReporting)
參數 | |
---|---|
protoReporting | boolean |