安装仪器测试

public class InstalledInstrumentationsTest
extends Object implements IDeviceTest , IShardableTest , IMetricCollectorReceiver , IAutoRetriableTest , IConfigurationReceiver

java.lang.Object
com.android.tradefed.testtype.InstalledInstrumentationsTest


运行当前设备上找到的所有检测。

概括

公共构造函数

InstalledInstrumentationsTest ()

公共方法

ITestDevice getDevice ()

获取被测设备。

void run ( TestInformation testInfo, ITestInvocationListener listener)

运行测试,并将结果报告给侦听器。

void setConfiguration ( IConfiguration configuration)

注入正在使用的IConfiguration

void setDevice ( ITestDevice device)

注入被测设备。

void setMetricCollectors ( collectors) setMetricCollectors ( collectors)

设置为测试运行定义的IMetricCollector列表。

boolean shouldRetry (int attemptJustExecuted, previousResults, skipList) shouldRetry (int attemptJustExecuted, previousResults, skipList) shouldRetry (int attemptJustExecuted, previousResults, skipList)

委托自ERROR(IRetryDecision#shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision#shouldRetry(IRemoteTest, int, List))

split (int shardCountHint)

split()的替代版本还提供尝试运行的 shardCount。

公共构造函数

安装仪器测试

public InstalledInstrumentationsTest ()

公共方法

获取设备

public ITestDevice getDevice ()

获取被测设备。

退货
ITestDevice ITestDevice

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

运行测试,并将结果报告给侦听器。

参数
testInfo TestInformationTestInformation对象包含运行测试的有用信息。

listener ITestInvocationListener :测试结果的ITestInvocationListener

投掷
DeviceNotAvailableException

设置配置

public void setConfiguration (IConfiguration configuration)

注入正在使用的IConfiguration

参数
configuration IConfiguration

设置设备

public void setDevice (ITestDevice device)

注入被测设备。

参数
device ITestDevice :要使用的ITestDevice

设置MetricCollectors

public void setMetricCollectors ( collectors)

设置为测试运行定义的IMetricCollector列表。

参数
collectors

应该重试

public boolean shouldRetry (int attemptJustExecuted, 
                 previousResults, 
                 skipList)

委托自ERROR(IRetryDecision#shouldRetry(IRemoteTest, int, List)/com.android.tradefed.retry.IRetryDecision#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List) IRetryDecision#shouldRetry(IRemoteTest, int, List)) 。决定是否应尝试重试。还要对要重试的IRemoteTest进行任何必要的更改(应用过滤器、准备下一次运行等)。

参数
attemptJustExecuted int :我们刚刚运行的尝试的编号。

previousResults :刚刚运行的测试的TestRunResult列表。

skipList :不应重试的一组项目。

退货
boolean如果我们应该重试,则为 True,否则为 False。

投掷
DeviceNotAvailableException

分裂

public  split (int shardCountHint)

split()的替代版本还提供尝试运行的 shardCount。这对于某些有时无法随意决定的测试运行者很有用。

参数
shardCountHint int :尝试的分片计数。

退货
要单独执行的子测试集合,如果测试当前不可分片,则为null