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) 此方法已棄用。使用 |
公共方法
設置
public void setUp (ITestDevice device, IBuildInfo buildInfo)
此方法已棄用。
改為使用setUp(com.android.tradefed.invoker.TestInformation)
執行目標設置以進行測試。
參數 | |
---|---|
device | ITestDevice :要準備的ITestDevice 。 |
buildInfo | IBuildInfo :有關被測構建的數據。 |
投擲 | |
---|---|
TargetSetupError | 如果發生致命錯誤設置環境 |
BuildError | 如果發生與 BuildInfo 相關的錯誤 |
DeviceNotAvailableException | 如果設備變得無響應 |
設置
public void setUp (TestInformation testInformation)
執行目標設置以進行測試。
參數 | |
---|---|
testInformation | TestInformation :調用的TestInformation 。 |
投擲 | |
---|---|
TargetSetupError | 如果發生致命錯誤設置環境 |
BuildError | 如果由於正在準備構建而發生錯誤 |
DeviceNotAvailableException | 如果設備變得無響應 |
拆除
public void tearDown (TestInformation testInformation, Throwable e)
測試後執行目標清理/拆卸。
參數 | |
---|---|
testInformation | TestInformation :調用的TestInformation 。 |
e | Throwable :如果調用以異常結束,這將是在調用級別捕獲的異常。否則,將為null 。 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備變得無響應 |
拆除
public void tearDown (ITestDevice device, IBuildInfo buildInfo, Throwable e)
此方法已棄用。
使用tearDown(com.android.tradefed.invoker.TestInformation, Throwable)
代替
測試後執行目標清理/拆卸。
參數 | |
---|---|
device | ITestDevice :要準備的ITestDevice 。 |
buildInfo | IBuildInfo :有關被測構建的數據。 |
e | Throwable :如果調用以異常結束,這將是在調用級別捕獲的異常。否則,將為null 。 |
投擲 | |
---|---|
DeviceNotAvailableException | 如果設備變得無響應 |