ITargetPreparer

public interface ITargetPreparer
implements IDisableable

com.android.tradefed.targetprep.ITargetPreparer


為測試運行準備測試環境。

例如,安裝軟體、調整環境設定以進行測試、啟動目標等。

請注意,可以在配置中指定多個ITargetPreparer 。建議每個 ITargetPreparer 清楚地記錄其預期環境預設定和設定後。例如,配置測試設備的 ITargetPreparer 必須在安裝軟體的 ITargetPreparer 之後執行。

概括

公共方法

default void setUp ( ITestDevice device, IBuildInfo buildInfo)

此方法已被棄用。使用setUp(com.android.tradefed.invoker.TestInformation)代替

default void setUp ( TestInformation testInformation)

執行測試目標設定。

default void tearDown ( TestInformation testInformation, Throwable e)

測試後執行目標清理/拆卸。

default void tearDown ( ITestDevice device, IBuildInfo buildInfo, Throwable e)

此方法已被棄用。使用tearDown(com.android.tradefed.invoker.TestInformation, Throwable)代替

公共方法

設定

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如果設備沒有回應