安裝儀器測試

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