安装的仪器测试
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) shouldRetry (int attemptJustExecuted, previousResults) |
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 |
setMetricCollectors
public void setMetricCollectors (collectors)
设置为测试运行定义的IMetricCollector
的列表。
参数 | |
---|---|
collectors |
应该重试
public boolean shouldRetry (int attemptJustExecuted,previousResults)
委托自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 列表。 |
退货 | |
---|---|
boolean | 如果我们应该重试,则为 True,否则为 False。 |
投掷 | |
---|---|
DeviceNotAvailableException |
分裂
publicsplit (int shardCountHint)
split()
的替代版本,它还提供尝试运行的 shardCount。这对于某些有时不能随意决定的测试运行器很有用。
参数 | |
---|---|
shardCountHint | int :尝试的分片数。 |
退货 | |
---|---|
要单独执行的子测试的集合,如果测试当前不可分片则为null |