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 cleanUp 步骤。

void doSetup(TestInformation testInfo, IConfiguration config, ITestLogger listener)

执行 target_preparer 和 multi_target_preparer setUp 步骤。

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 ()

公共方法

doCleanUp

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

执行 target_preparer 和 multi_target_preparer cleanUp 步骤。设备是否会进行清理。

参数
context IInvocationContext:调用的 IInvocationContext

config IConfiguration:此测试运行的 IConfiguration

exception Throwable:测试运行时抛出的原始异常。

doSetup

public void doSetup (TestInformation testInfo, 
                IConfiguration config, 
                ITestLogger listener)

执行 target_preparer 和 multi_target_preparer 的 setUp 步骤。是否已完成运行测试所需的所有设备设置。

参数
testInfo TestInformation:调用的 TestInformation

config IConfiguration:此测试运行的 IConfiguration

listener ITestLogger:用于报告设置失败日志的 ITestLogger

抛出
BuildError
DeviceNotAvailableException
TargetSetupError

doTeardown

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 如果成功下载 build,则为 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

runTests

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

运行测试。

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

config IConfiguration:要运行的 IConfiguration

listener ITestInvocationListener:测试结果的 ITestInvocationListener

受保护的方法

getFactory

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

返回

prepareAndRunSandbox

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

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

参数
info TestInformation

config IConfiguration

listener ITestInvocationListener

返回
boolean