ParentSandboxInvocationExecution
public class ParentSandboxInvocationExecution
extends InvocationExecution
对象 | ||
↳ | com.android.tradefed.invoker.InvocationExecution | |
↳ | com.android.tradefed.invoker.sandbox.ParentSandboxInvocationExecution |
版本InvocationExecution
父调用特殊动作运行的沙箱时。
概括
公共构造函数 | |
---|---|
ParentSandboxInvocationExecution () |
公共方法 | |
---|---|
void | doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception) 执行 target_preparer 和 multi_target_preparer 清理步骤。 |
void | doSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener) 执行 target_preparer 和 multi_target_preparer 设置步骤。 |
void | doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception) 执行 target_preparer 和 multi_target_preparer 拆卸步骤。 |
boolean | fetchBuild (TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener) 执行调用的 build_provider 步骤。 |
void | reportLogs (ITestDevice device, ITestLogger logger, TestInvocation.Stage stage) 在调用的不同阶段报告一些设备日志。 |
void | runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception) 调用 |
void | runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger) |
void | runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener) 运行测试。 |
受保护的方法 | |
---|---|
IConfigurationFactory | getFactory () 返回 |
getPreparersToRun ( IConfiguration config, String deviceName) 检索要在此设备上运行的准备程序列表。 | |
IRunUtil | getRunUtil () |
boolean | prepareAndRunSandbox (TestInformation info, IConfiguration config, ITestInvocationListener listener) 返回运行沙箱的结果状态。 |
公共构造函数
ParentSandboxInvocationExecution
public ParentSandboxInvocationExecution ()
公共方法
清理
public void doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception)
执行 target_preparer 和 multi_target_preparer 清理步骤。设备是否清理。
参数 | |
---|---|
context | IInvocationContext :在IInvocationContext 调用的。 |
config | IConfiguration :在IConfiguration 此试运行。 |
exception | Throwable :原始异常由试运行抛出。 |
设置
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener)
执行 target_preparer 和 multi_target_preparer 设置步骤。是否设置了测试运行所需的所有设备。
参数 | |
---|---|
testInfo | TestInformation :在TestInformation 调用的。 |
config | IConfiguration :在IConfiguration 此试运行。 |
listener | ITestLogger :在ITestLogger 报告建立故障日志。 |
投掷 | |
---|---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
拆解
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
执行 target_preparer 和 multi_target_preparer 拆卸步骤。设备是否与设置相关联。
参数 | |
---|---|
testInfo | TestInformation :在TestInformation 调用的。 |
config | IConfiguration :在IConfiguration 此试运行。 |
logger | ITestLogger :在ITestLogger 报告日志。 |
exception | Throwable :原始异常由试运行抛出。 |
获取构建
public boolean fetchBuild (TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
执行调用的 build_provider 步骤。
参数 | |
---|---|
testInfo | TestInformation :在TestInformation 调用的。 |
config | IConfiguration :在IConfiguration 此试运行。 |
rescheduler | IRescheduler :所述IRescheduler ,用于在另一资源上重新调度的调用来执行的部分(S) |
listener | ITestInvocationListener :在ITestInvocation 到报告生成下载失败。 |
退货 | |
---|---|
boolean | 如果我们成功下载了构建,则为 true,否则为 false。 |
投掷 | |
---|---|
BuildRetrievalError | |
DeviceNotAvailableException |
报告日志
public void reportLogs (ITestDevice device, ITestLogger logger, TestInvocation.Stage stage)
在调用的不同阶段报告一些设备日志。例如:logcat。
参数 | |
---|---|
device | ITestDevice :设备从报告日志。 |
logger | ITestLogger :这些日志的记录。 |
stage | TestInvocation.Stage :调用我们正处于的阶段。 |
运行DevicePostInvocationTearDown
public void runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception)
调用ITestDevice#postInvocationTearDown(Throwable)
用于调用每个设备的一部分。
参数 | |
---|---|
context | IInvocationContext :在IInvocationContext 调用的。 |
config | IConfiguration :在IConfiguration 此试运行。 |
exception | Throwable :原始异常由试运行,如果任何异常。 |
运行DevicePreInvocationSetup
public void runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger)
参数 | |
---|---|
context | IInvocationContext :在IInvocationContext 调用的。 |
config | IConfiguration :在IConfiguration 此试运行。 |
logger | ITestLogger :在ITestLogger 报告日志。 |
投掷 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
运行测试
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
运行测试。
参数 | |
---|---|
info | TestInformation :在TestInformation 与运行测试。 |
config | IConfiguration :在IConfiguration 来运行 |
listener | ITestInvocationListener :在ITestInvocationListener 测试结果 |
受保护的方法
获取工厂
protected IConfigurationFactory getFactory ()
返回IConfigurationFactory
用于创建的配置。
退货 | |
---|---|
IConfigurationFactory |
getPreparersToRun
protectedgetPreparersToRun (IConfiguration config, String deviceName)
检索要在此设备上运行的准备程序列表。
在沙盒类中重写以限制实验室准备者在沙盒子类中运行
参数 | |
---|---|
config | IConfiguration |
deviceName | String |
退货 | |
---|---|
获取运行工具
protected IRunUtil getRunUtil ()
退货 | |
---|---|
IRunUtil |
准备运行沙盒
protected boolean prepareAndRunSandbox (TestInformation info, IConfiguration config, ITestInvocationListener listener)
返回运行沙箱的结果状态。
参数 | |
---|---|
info | TestInformation |
config | IConfiguration |
listener | ITestInvocationListener |
退货 | |
---|---|
boolean |