ParentSandboxInvocationExecution

public class ParentSandboxInvocationExecution
extends InvocationExecution

java.lang.Object
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)

为调用的每个设备部分调用ITestDevice#postInvocationTearDown(Throwable)

void runDevicePreInvocationSetup ( IInvocationContext context, IConfiguration config, ITestLogger logger)

为调用的每个设备部分调用ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo))

void runTests ( TestInformation info, IConfiguration config, ITestInvocationListener listener)

运行测试。

受保护的方法

IConfigurationFactory getFactory ()

返回用于创建配置的IConfigurationFactory

getLabPreparersToRun ( IConfiguration config, String deviceName)

检索要在此设备上运行的实验室准备者列表。

IRunUtil getRunUtil ()
getTargetPreparersToRun ( IConfiguration config, String deviceName)

检索要在此设备上运行的目标准备程序列表。

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 IReschedulerIRescheduler ,用于重新安排调用的一部分以在另一个资源上执行

listener ITestInvocationListener :报告构建下载失败的ITestInvocation

退货
boolean如果我们成功下载构建,则为真,否则为假。

投掷
BuildRetrievalError
DeviceNotAvailableException

报告日志

public void reportLogs (ITestDevice device, 
                ITestLogger logger, 
                TestInvocation.Stage stage)

在调用的不同阶段报告一些设备日志。例如:logcat。

参数
device ITestDevice :要从中报告日志的设备。

logger ITestLogger :日志的记录器。

stage TestInvocation.Stage :我们所处的调用阶段。

runDevicePostInvocationTearDown

public void runDevicePostInvocationTearDown (IInvocationContext context, 
                IConfiguration config, 
                Throwable exception)

为调用的每个设备部分调用ITestDevice#postInvocationTearDown(Throwable)

参数
context IInvocationContext :调用的IInvocationContext

config IConfiguration :本次测试运行的IConfiguration

exception Throwable :测试运行时抛出的原始异常(如果有)。

runDevicePreInvocationSetup

public void runDevicePreInvocationSetup (IInvocationContext context, 
                IConfiguration config, 
                ITestLogger logger)

为调用的每个设备部分调用ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo))

参数
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

getLabPreparersToRun

protected  getLabPreparersToRun (IConfiguration config, 
                String deviceName)

检索要在此设备上运行的实验室准备者列表。

在沙盒类中覆盖以限制实验室准备者在沙盒子类中运行

参数
config IConfiguration

deviceName String

退货

getRunUtil

protected IRunUtil getRunUtil ()

退货
IRunUtil

getTargetPreparersToRun

protected  getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

检索要在此设备上运行的目标准备程序列表。

在沙盒类中覆盖以限制实验室准备者在沙盒子类中运行

参数
config IConfiguration

deviceName String

退货

准备和运行沙箱

protected boolean prepareAndRunSandbox (TestInformation info, 
                IConfiguration config, 
                ITestInvocationListener listener)

返回运行沙箱的结果状态。

参数
info TestInformation

config IConfiguration

listener ITestInvocationListener

退货
boolean