基本重試決策

public class BaseRetryDecision
extends Object implements IRetryDecision , IConfigurationReceiver , ITestInformationReceiver

java.lang.Object
com.android.tradefed.retry.BaseRetryDecision


IRetryDecision的基本實作。基本實作僅考慮本地訊號。

概括

公共構造函數

BaseRetryDecision ()

重試決策的建構函數

公共方法

void addLastAttempt ( lastResults) addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))很可能會在最後一次重試嘗試之前被調用,因此出於統計目的,我們可能會丟失最後一次嘗試的結果。

void addToSkipRetryList (String filterEntry)

新增一個條目以跳過重試。

static getFailedTestCases ( previousResults) getFailedTestCases ( previousResults)

傳回應重試的失敗測試案例的對應。

CurrentInvocation.IsolationGrade getIsolationGrade ()
int getMaxRetryCount ()

自動重試期間的最大嘗試次數。

RetryStatistics getRetryStatistics ()

傳回表示重試的RetryStatistics

RetryStrategy getRetryStrategy ()

自動重試期間使用的RetryStrategy

getSkipRetrySet ()
TestInformation getTestInformation ()
boolean isAutoRetryEnabled ()

是否啟用自動重試。

boolean rebootAtLastAttempt ()

是否在最後一次嘗試之前重新啟動裝置。

void setConfiguration ( IConfiguration configuration)

注入正在使用的IConfiguration

void setInvocationContext ( IInvocationContext context)

設定當前呼叫上下文。

void setTestInformation ( TestInformation testInformation)
boolean shouldRetry ( IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults, DeviceNotAvailableException dnae) shouldRetry ( IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults, DeviceNotAvailableException dnae)

決定是否應嘗試重試。

boolean shouldRetry ( IRemoteTest test, int attemptJustExecuted, previousResults) shouldRetry ( IRemoteTest test, int attemptJustExecuted, previousResults)

決定是否應嘗試重試。

RetryPreparationDecision shouldRetryPreparation ( ModuleDefinition module, int attempt, int maxAttempt)

決定是否應重試模組準備。

boolean useUpdatedReporting ()

如果我們應該使用更新的報告,則傳回 true。

受保護的方法

void isolateRetry ( devices) isolateRetry ( devices)

公共構造函數

基本重試決策

public BaseRetryDecision ()

重試決策的建構函數

公共方法

添加最後一次嘗試

public void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))很可能會在最後一次重試嘗試之前被調用,因此出於統計目的,我們可能會丟失最後一次嘗試的結果。該方法允許提供這些結果以進行正確的統計計算。

新增跳過重試列表

public void addToSkipRetryList (String filterEntry)

新增一個條目以跳過重試。

參數
filterEntry String

取得失敗的測試案例

public static  getFailedTestCases ( previousResults)

傳回應重試的失敗測試案例的對應。

參數
previousResults

退貨

取得隔離等級

public CurrentInvocation.IsolationGrade getIsolationGrade ()

退貨
CurrentInvocation.IsolationGrade

取得最大重試次數

public int getMaxRetryCount ()

自動重試期間的最大嘗試次數。

退貨
int

獲取重試統計信息

public RetryStatistics getRetryStatistics ()

傳回表示重試的RetryStatistics

退貨
RetryStatistics

取得重試策略

public RetryStrategy getRetryStrategy ()

自動重試期間使用的RetryStrategy

退貨
RetryStrategy

取得跳過重試集

public  getSkipRetrySet ()

退貨

獲取測試訊息

public TestInformation getTestInformation ()

退貨
TestInformation

是否啟用自動重試

public boolean isAutoRetryEnabled ()

是否啟用自動重試。

退貨
boolean

最後一次嘗試重新啟動

public boolean rebootAtLastAttempt ()

是否在最後一次嘗試之前重新啟動裝置。

退貨
boolean

設定配置

public void setConfiguration (IConfiguration configuration)

注入正在使用的IConfiguration

參數
configuration IConfiguration

設定呼叫上下文

public void setInvocationContext (IInvocationContext context)

設定當前呼叫上下文。

參數
context IInvocationContext

設定測試訊息

public void setTestInformation (TestInformation testInformation)

參數
testInformation TestInformation

應該重試

public boolean shouldRetry (IRemoteTest test, 
                ModuleDefinition module, 
                int attemptJustExecuted, 
                 previousResults, 
                DeviceNotAvailableException dnae)

決定是否應嘗試重試。也要對要重試的IRemoteTest進行任何必要的更改(應用過濾器等)。

參數
test IRemoteTest :剛運行的IRemoteTest

module ModuleDefinition :測試模組的ModuleDefinition物件。

attemptJustExecuted int :我們剛剛運行的嘗試的編號。

previousResults :剛剛執行的測試的TestRunResult列表。

dnae DeviceNotAvailableException :裝置不可用例外的DeviceNotAvailableException

退貨
boolean如果我們應該重試,則為 True,否則為 False。

投擲
DeviceNotAvailableException

應該重試

public boolean shouldRetry (IRemoteTest test, 
                int attemptJustExecuted, 
                 previousResults)

決定是否應嘗試重試。也要對要重試的IRemoteTest進行任何必要的更改(應用過濾器等)。

參數
test IRemoteTest :剛運行的IRemoteTest

attemptJustExecuted int :我們剛剛運行的嘗試的編號。

previousResults :剛剛執行的測試的TestRunResult列表。

退貨
boolean如果我們應該重試,則為 True,否則為 False。

投擲
DeviceNotAvailableException

應該重試準備

public RetryPreparationDecision shouldRetryPreparation (ModuleDefinition module, 
                int attempt, 
                int maxAttempt)

決定是否應重試模組準備。

參數
module ModuleDefinition

attempt int

maxAttempt int

退貨
RetryPreparationDecision

使用更新報告

public boolean useUpdatedReporting ()

如果我們應該使用更新的報告,則傳回 true。

退貨
boolean

受保護的方法

隔離重試

protected void isolateRetry ( devices)

參數
devices

投擲
DeviceNotAvailableException