安装仪器测试
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) 注入正在使用的 |
void | setDevice ( ITestDevice device) 注入被测设备。 |
void | setMetricCollectors ( collectors) setMetricCollectors ( collectors) 设置为测试运行定义的 |
boolean | shouldRetry (int attemptJustExecuted, previousResults, skipList) shouldRetry (int attemptJustExecuted, previousResults, skipList) shouldRetry (int attemptJustExecuted, previousResults, skipList) |
split (int shardCountHint) |
公共构造函数
安装仪器测试
public InstalledInstrumentationsTest ()
公共方法
跑步
public void run (TestInformation testInfo, ITestInvocationListener listener)
运行测试,并将结果报告给侦听器。
参数 | |
---|---|
testInfo | TestInformation : TestInformation 对象包含运行测试的有用信息。 |
listener | ITestInvocationListener :测试结果的ITestInvocationListener |
投掷 | |
---|---|
DeviceNotAvailableException |
设置配置
public void setConfiguration (IConfiguration configuration)
注入正在使用的IConfiguration
。
参数 | |
---|---|
configuration | IConfiguration |
设置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 |
分裂
publicsplit (int shardCountHint)
split()
的替代版本还提供尝试运行的 shardCount。这对于某些有时无法随意决定的测试运行者很有用。
参数 | |
---|---|
shardCountHint | int :尝试的分片计数。 |
退货 | |
---|---|
要单独执行的子测试集合,如果测试当前不可分片,则为null |