ITargetPreparer
public
interface
ITargetPreparer
implements
IDisableable
| com.android.tradefed.targetprep.ITargetPreparer |
為測試執行作業準備測試環境。
例如安裝軟體、調整測試環境設定、啟動目標等。
請注意,您可以在設定中指定多個 ITargetPreparer。建議每個 ITargetPreparer 都明確記錄預期的環境前置設定和後置設定,例如,用於設定裝置以便進行測試的 ITargetPreparer,必須在安裝軟體的 ITargetPreparer 之後執行。
摘要
公用方法 | |
|---|---|
default
void
|
setUp(ITestDevice device, IBuildInfo buildInfo)
這個方法已淘汰。
改用 |
default
void
|
setUp(TestInformation testInformation)
執行目標設定以進行測試。 |
default
void
|
tearDown(TestInformation testInformation, Throwable e)
在測試後執行目標清除/拆除作業。 |
default
void
|
tearDown(ITestDevice device, IBuildInfo buildInfo, Throwable e)
這個方法已淘汰。
改用 |
公用方法
setUp
public void setUp (ITestDevice device,
IBuildInfo buildInfo)
This method is deprecated.
請改用 setUp(com.android.tradefed.invoker.TestInformation)
執行目標設定以進行測試。
| 參數 | |
|---|---|
device |
ITestDevice:要準備的 ITestDevice。 |
buildInfo |
IBuildInfo:測試中版本的資料。 |
| 擲回 | |
|---|---|
TargetSetupError |
設定環境時發生致命錯誤 |
BuildError |
如果發生與 BuildInfo 相關的錯誤 |
DeviceNotAvailableException |
如果裝置沒有回應 |
setUp
public void setUp (TestInformation testInformation)
執行目標設定以進行測試。
| 參數 | |
|---|---|
testInformation |
TestInformation:呼叫的 TestInformation。 |
| 擲回 | |
|---|---|
TargetSetupError |
設定環境時發生致命錯誤 |
BuildError |
如果因建構作業準備而發生錯誤 |
DeviceNotAvailableException |
如果裝置沒有回應 |
tearDown
public void tearDown (TestInformation testInformation,
Throwable e)在測試後執行目標清除/拆除作業。
| 參數 | |
|---|---|
testInformation |
TestInformation:呼叫的 TestInformation。 |
e |
Throwable:如果叫用作業結束時發生例外狀況,則此值會是叫用層級偵測到的例外狀況。否則,將為 null。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
如果裝置沒有回應 |
tearDown
public void tearDown (ITestDevice device,
IBuildInfo buildInfo,
Throwable e)
This method is deprecated.
請改用 tearDown(com.android.tradefed.invoker.TestInformation, Throwable)
在測試後執行目標清除/拆除作業。
| 參數 | |
|---|---|
device |
ITestDevice:要準備的 ITestDevice。 |
buildInfo |
IBuildInfo:測試中版本的資料。 |
e |
Throwable:如果叫用作業結束時發生例外狀況,則此為在叫用層級偵測到的例外狀況。否則,將為 null。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
如果裝置沒有回應 |