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)
此方法已废弃。
改用 setUp(com.android.tradefed.invoker.TestInformation)
执行目标设置以进行测试。
| 参数 | |
|---|---|
device |
ITestDevice:要准备的 ITestDevice。 |
buildInfo |
IBuildInfo:与受测 build 相关的数据。 |
| 抛出 | |
|---|---|
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)
此方法已废弃。
改用 tearDown(com.android.tradefed.invoker.TestInformation, Throwable)
在测试后执行目标清理/拆解。
| 参数 | |
|---|---|
device |
ITestDevice:要准备的 ITestDevice。 |
buildInfo |
IBuildInfo:与受测 build 相关的数据。 |
e |
Throwable:如果调用以异常结束,则这是在调用级别捕获的异常。否则,将为 null。 |
| 抛出 | |
|---|---|
DeviceNotAvailableException |
如果设备无响应 |