委托调用执行

public class DelegatedInvocationExecution
extends InvocationExecution

java.lang.Object
com.android.tradefed.invoker.InvocationExecution
com.android.tradefed.invoker.DelegatedInvocationExecution


InvocationExecution将执行委托给另一个 Tradefed 二进制文件。

概括

字段

public static final String DELEGATED_MODE_VAR

如果存在,则调用正在委托模式下执行

公共构造函数

DelegatedInvocationExecution ()

公共方法

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 拆卸步骤。

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)

运行测试。

boolean shardConfig ( IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)

尝试将配置分片为子配置,以重新安排在多个资源上并行运行。

字段

DELEGATED_MODE_VAR

public static final String DELEGATED_MODE_VAR

如果存在,则调用正在委托模式下执行

公共构造函数

委托调用执行

public DelegatedInvocationExecution ()

公共方法

清理

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

分片配置

public boolean shardConfig (IConfiguration config, 
                TestInformation testInfo, 
                IRescheduler rescheduler, 
                ITestLogger logger)

尝试将配置分片为子配置,以重新安排在多个资源上并行运行。

如果分片计数大于 1,它将简单地通过设置分片索引为每个分片创建配置并重新安排它们。如果未设置分片计数,它将回IShardHelper#shardConfig

参数
config IConfiguration :当前的IConfiguration

testInfo TestInformation :保存测试信息的TestInformation

rescheduler IReschedulerIRescheduler

logger ITestLogger : ITestLogger用于在分片期间记录文件。

退货
boolean如果测试被分片,则为真。否则返回false