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 | 如果设备变得无响应 |