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 裝置沒有回應時

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)

此方法已淘汰。
請改用 tearDown(com.android.tradefed.invoker.TestInformation, Throwable)

測試後,執行目標清理/拆除作業。

參數
device ITestDevice:要準備的 ITestDevice

buildInfo IBuildInfo:受測試版本的資料。

e Throwable:如果叫用因例外狀況而結束,這就是在叫用層級所擷取的例外狀況。否則為 null

擲回
DeviceNotAvailableException 裝置沒有回應時