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

getPreparersToRun(IConfiguration config, String deviceName)

检索要在此设备上运行的准备器列表。

IRunUtil getRunUtil()
boolean prepareAndRunSandbox(TestInformation info, IConfiguration config, ITestInvocationListener listener)

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

公共构造函数

ParentSandboxInvocationExecution

public ParentSandboxInvocationExecution ()

公共方法

doCleanUp

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:运行测试时抛出的原始异常。

fetchBuild

public boolean fetchBuild (TestInformation testInfo, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener listener)

执行调用的 build_provider 步骤。

参数
testInfo TestInformation:调用的 TestInformation

config IConfiguration:此测试运行的 IConfiguration

rescheduler IReschedulerIRescheduler,用于重新调度部分调用 在其他资源上执行

listener ITestInvocationListener:用于报告 build 下载失败的 ITestInvocation

返回
boolean 如果我们成功下载了构建,则为 true,否则为 false。

抛出
BuildRetrievalError
DeviceNotAvailableException

reportLogs

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

runTest

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

运行测试。

参数
info TestInformation:用于运行测试的 TestInformation

config IConfiguration:要运行的 IConfiguration

listener ITestInvocationListener:测试结果的 ITestInvocationListener

受保护的方法

getFactory

protected IConfigurationFactory getFactory ()

返回用于创建配置的 IConfigurationFactory

返回
IConfigurationFactory

getPreparersToRun

protected  getPreparersToRun (IConfiguration config, 
                String deviceName)

检索要在此设备上运行的准备器列表。

在沙盒类中被替换,以限制实验准备器在沙盒内运行 孩子

参数
config IConfiguration

deviceName String

返回

getRunUtil

protected IRunUtil getRunUtil ()

返回
IRunUtil

准备和运行沙盒

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

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

参数
info TestInformation

config IConfiguration

listener ITestInvocationListener

返回
boolean