SubprocessTfLauncher
public
abstract
class
SubprocessTfLauncher
extends Object
implements
IBuildReceiver,
IConfigurationReceiver,
IInvocationContextReceiver,
IRemoteTest
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.SubprocessTfLauncher |
IRemoteTest,可針對獨立的 TF 安裝項目執行測試。
啟動外部 Java 程序來執行測試。用於持續執行 TF 單元或功能測試。
摘要
常數 | |
|---|---|
String |
ANDROID_SERIAL_VAR
Env. |
String |
PARENT_PROC_TAG_NAME
|
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)
Runs the tests, and reports result to the listener. |
void
|
setBuild(IBuildInfo buildInfo)
|
void
|
setConfiguration(IConfiguration configuration)
注入使用的 |
void
|
setInvocationContext(IInvocationContext invocationContext)
|
受保護的方法 | |
|---|---|
void
|
addJavaArguments(
允許在子程序呼叫中新增額外 Java 參數。 |
String
|
getJava()
|
IRunUtil
|
getRunUtil()
傳回將用於子程序指令的 |
void
|
postRun(ITestInvocationListener listener, boolean exception, long elapsedTime)
完成 TF 測試後應採取的行動。 |
void
|
preRun()
請先完成設定,再執行測試。 |
void
|
setEventStreaming(boolean eventStreaming)
Set use-event-streaming. |
void
|
setProtoReporting(boolean protoReporting)
|
void
|
setRunUtil(IRunUtil runUtil)
設定 IRunUtil。 |
常數
ANDROID_SERIAL_VAR
public static final String ANDROID_SERIAL_VAR
影響 adb 選取的環境變數。
常數值: "ANDROID_SERIAL"
PARENT_PROC_TAG_NAME
public static final String PARENT_PROC_TAG_NAME
常數值: "parentprocess"
SUBPROCESS_TAG_NAME
public static final String SUBPROCESS_TAG_NAME
系統會將這個標記傳遞至 TF 子程序,以區分兩者
常數值: "subprocess"
欄位
mCmdArgs
protectedmCmdArgs
mRootDir
protected String mRootDir
mTmpDir
protected File mTmpDir
公用建構函式
SubprocessTfLauncher
public SubprocessTfLauncher ()
公用方法
得分
public void run (TestInformation testInfo, ITestInvocationListener listener)
執行測試,並向接聽程式回報結果。
| 參數 | |
|---|---|
testInfo |
TestInformation:包含執行測試的實用資訊的 TestInformation 物件。 |
listener |
ITestInvocationListener:測試結果的 ITestInvocationListener |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
setConfiguration
public void setConfiguration (IConfiguration configuration)
插入使用的 IConfiguration。
| 參數 | |
|---|---|
configuration |
IConfiguration |
setInvocationContext
public void setInvocationContext (IInvocationContext invocationContext)
| 參數 | |
|---|---|
invocationContext |
IInvocationContext |
受保護的方法
addJavaArguments
protected void addJavaArguments (args)
允許在子程序呼叫中新增額外 Java 參數。
| 參數 | |
|---|---|
args |
:目前的引數清單,我們需要新增額外引數。 |
getJava
protected String getJava ()
| 傳回 | |
|---|---|
String |
|
postRun
protected void postRun (ITestInvocationListener listener, boolean exception, long elapsedTime)
完成 TF 測試後應採取的行動。
| 參數 | |
|---|---|
listener |
ITestInvocationListener:原始 ITestInvocationListener,用於回報結果。 |
exception |
boolean:如果測試中引發例外狀況,則為 True。 |
elapsedTime |
long:執行測試所花的時間。 |
preRun
protected void preRun ()
請先完成設定,再執行測試。
setEventStreaming
protected void setEventStreaming (boolean eventStreaming)
設定 use-event-streaming。 公開以進行單元測試。
| 參數 | |
|---|---|
eventStreaming |
boolean |
setProtoReporting
protected void setProtoReporting (boolean protoReporting)
| 參數 | |
|---|---|
protoReporting |
boolean |