基礎重試決定
public class BaseRetryDecision
extends Object
implements IRetryDecision , IConfigurationReceiver , ITestInformationReceiver
java.lang.Object | |
↳ | com.android.tradefed.retry.BaseRetryDecision |
IRetryDecision
的基礎實現。基本實現僅考慮本地信號。
概括
公共構造函數 | |
---|---|
BaseRetryDecision () 重試決定的構造函數 |
公共方法 | |
---|---|
void | addLastAttempt ( lastResults) addLastAttempt ( lastResults) |
void | addToSkipRetryList (String filterEntry) 添加一個條目以跳過重試。 |
static | getFailedTestCases ( previousResults) getFailedTestCases ( previousResults) 返回應該重試的失敗測試用例的映射。 |
CurrentInvocation.IsolationGrade | getIsolationGrade () |
int | getMaxRetryCount () 自動重試期間的最大嘗試次數。 |
RetryStatistics | getRetryStatistics () 返回表示重試的 |
RetryStrategy | getRetryStrategy () 自動重試期間使用的 |
getSkipRetrySet () | |
TestInformation | getTestInformation () |
boolean | isAutoRetryEnabled () 是否啟用自動重試。 |
boolean | rebootAtLastAttempt () 在最後一次嘗試之前是否重啟設備。 |
void | setConfiguration ( IConfiguration configuration) 注入正在使用的 |
void | setInvocationContext ( IInvocationContext context) 設置當前調用上下文。 |
void | setTestInformation ( TestInformation testInformation) |
boolean | shouldRetry ( IRemoteTest test, int attemptJustExecuted, previousResults) shouldRetry ( IRemoteTest test, int attemptJustExecuted, previousResults) 決定是否應該嘗試重試。 |
boolean | shouldRetry ( IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, previousResults) shouldRetry ( IRemoteTest test, ModuleDefinition module, 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 staticgetFailedTestCases ( previousResults)
返回應該重試的失敗測試用例的映射。
參數 | |
---|---|
previousResults |
退貨 | |
---|---|
獲取隔離等級
public CurrentInvocation.IsolationGrade getIsolationGrade ()
退貨 | |
---|---|
CurrentInvocation.IsolationGrade |
獲取最大重試次數
public int getMaxRetryCount ()
自動重試期間的最大嘗試次數。
退貨 | |
---|---|
int |
getRetryStatistics
public RetryStatistics getRetryStatistics ()
返回表示重試的RetryStatistics
。
退貨 | |
---|---|
RetryStatistics |
getSkipRetrySet
publicgetSkipRetrySet ()
退貨 | |
---|---|
isAutoRetryEnabled
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, int attemptJustExecuted,previousResults)
決定是否應該嘗試重試。還要對要重試的IRemoteTest
進行任何必要的更改(應用過濾器等)。
參數 | |
---|---|
test | IRemoteTest :剛剛運行的IRemoteTest 。 |
attemptJustExecuted | int :我們剛剛運行的嘗試次數。 |
previousResults | TestRunResult 列表。 |
退貨 | |
---|---|
boolean | 如果我們應該重試,則為 True,否則為 False。 |
投擲 | |
---|---|
DeviceNotAvailableException |
應該重試
public boolean shouldRetry (IRemoteTest test, ModuleDefinition module, int attemptJustExecuted,previousResults)
決定是否應該嘗試重試。還要對要重試的IRemoteTest
進行任何必要的更改(應用過濾器等)。
參數 | |
---|---|
test | IRemoteTest :剛剛運行的IRemoteTest 。 |
module | ModuleDefinition :測試模塊的ModuleDefinition 對象。 |
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 |