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

List<ITargetPreparer> getLabPreparersToRun(IConfiguration config, String deviceName)

检索要在相应设备上运行的实验准备器的列表。

IRunUtil getRunUtil()
List<ITargetPreparer> 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:测试运行抛出的原始异常。

抛出
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

抛出
Throwable

受保护的方法

getFactory

protected IConfigurationFactory getFactory ()

返回用于创建配置的 IConfigurationFactory

返回
IConfigurationFactory

getLabPreparersToRun

protected List<ITargetPreparer> getLabPreparersToRun (IConfiguration config, 
                String deviceName)

检索要在相应设备上运行的实验准备器的列表。

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

参数
config IConfiguration

deviceName String

返回
List<ITargetPreparer>

getRunUtil

protected IRunUtil getRunUtil ()

返回
IRunUtil

getTargetPreparersToRun

protected List<ITargetPreparer> getTargetPreparersToRun (IConfiguration config, 
                String deviceName)

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

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

参数
config IConfiguration

deviceName String

返回
List<ITargetPreparer>

prepareAndRunSandbox

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

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

参数
info TestInformation

config IConfiguration

listener ITestInvocationListener

返回
boolean

抛出
Throwable