InstalledInstrumentationsTest

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

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(List<IMetricCollector> collectors)

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

boolean shouldRetry(int attemptJustExecuted, List<TestRunResult> previousResults, Set<String> skipList)

委托方:IRetryDecision.shouldRetry(IRemoteTest,int,List)

Collection<IRemoteTest> split(int shardCountHint)

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

公共构造函数

InstalledInstrumentationsTest

public InstalledInstrumentationsTest ()

公共方法

getDevice

public ITestDevice getDevice ()

获取被测设备。

返回
ITestDevice ITestDevice

run

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

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

参数
testInfo TestInformation:包含用于运行测试的实用信息的 TestInformation 对象。

listener ITestInvocationListener:测试结果的 ITestInvocationListener

抛出
DeviceNotAvailableException

setConfiguration

public void setConfiguration (IConfiguration configuration)

注入正在使用的 IConfiguration

参数
configuration IConfiguration

setDevice

public void setDevice (ITestDevice device)

注入被测设备。

参数
device ITestDevice:要使用的 ITestDevice

setMetricCollectors

public void setMetricCollectors (List<IMetricCollector> collectors)

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

参数
collectors List

shouldRetry

public boolean shouldRetry (int attemptJustExecuted, 
                List<TestRunResult> previousResults, 
                Set<String> skipList)

委托方:IRetryDecision.shouldRetry(IRemoteTest,int,List)。决定是否应尝试重试。此外,还要对 IRemoteTest 进行任何必要的更改,以便重试(应用过滤条件、准备下一次运行等)。

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

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

skipList Set:不应重试的商品集。

返回
boolean 如果应重试,则为 True;否则为 False。

抛出
DeviceNotAvailableException

分解

public Collection<IRemoteTest> split (int shardCountHint)

split() 的替代版本,还提供尝试运行的 shardCount。这对于有时无法任意决定的某些测试运行程序非常有用。

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

返回
Collection<IRemoteTest> 要单独执行的子测试集合,如果测试目前无法分片,则为 null