安裝的儀器測試

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

split (int shardCountHint)

split()的替代版本,它還提供嘗試運行的 shardCount。

公共構造函數

安裝的儀器測試

public InstalledInstrumentationsTest ()

公共方法

獲取設備

public ITestDevice getDevice ()

獲取待測設備。

退貨
ITestDevice ITestDevice

跑步

public void run (TestInformation testInfo, 
                ITestInvocationListener listener)

運行測試,並將結果報告給偵聽器。

參數
testInfo TestInformation :包含運行測試的有用信息的TestInformation對象。

listener ITestInvocationListener : 測試結果的ITestInvocationListener

投擲
DeviceNotAvailableException

設置配置

public void setConfiguration (IConfiguration configuration)

注入正在使用的IConfiguration

參數
configuration IConfiguration

設置設備

public void setDevice (ITestDevice device)

注入被測設備。

參數
device ITestDevice :要使用的ITestDevice

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

分裂

public  split (int shardCountHint)

split()的替代版本,它還提供嘗試運行的 shardCount。這對於某些有時不能隨意決定的測試運行器很有用。

參數
shardCountHint int :嘗試的分片數。

退貨
要單獨執行的子測試的集合,如果測試當前不可分片則為null