基礎重試決定
public class BaseRetryDecision
extends Object
implements IRetryDecision , IConfigurationReceiver
對象 | |
↳ | com.android.tradefed.retry.BaseRetryDecision |
基本實現IRetryDecision
。基本實現只考慮本地信號。
概括
公共構造函數 | |
---|---|
BaseRetryDecision () 重試決定的構造函數 |
公共方法 | |
---|---|
void | addLastAttempt ( lastResults) addLastAttempt ( lastResults) |
static | getFailedTestCases ( previousResults) getFailedTestCases ( previousResults) 返回應該重試的失敗測試用例的映射。 |
CurrentInvocation.IsolationGrade | getIsolationGrade () |
int | getMaxRetryCount () 自動重試期間的最大嘗試次數。 |
RetryStatistics | getRetryStatistics () 返回 |
RetryStrategy | getRetryStrategy () 該 |
boolean | isAutoRetryEnabled () 是否開啟自動重試。 |
boolean | rebootAtLastAttempt () 上次嘗試前是否重啟設備。 |
void | setConfiguration ( IConfiguration configuration) 注入的 |
void | setInvocationContext (IInvocationContext context) 設置當前調用上下文。 |
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) 決定是否應該嘗試重試。 |
boolean | useUpdatedReporting () 如果我們應該使用更新的報告,則返回 true。 |
受保護的方法 | |
---|---|
void | isolateRetry ( devices) isolateRetry ( devices) |
公共構造函數
基礎重試決定
public BaseRetryDecision ()
重試決定的構造函數
公共方法
添加最後一次嘗試
public void addLastAttempt (lastResults)
ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List))
將最有可能在最後一個試嘗試之前調用,所以我們可能會丟失統計目的的最後嘗試的結果。該方法允許為適當的統計計算提供這些結果。
獲取失敗的測試用例
public staticgetFailedTestCases ( previousResults)
返回應該重試的失敗測試用例的映射。
參數 | |
---|---|
previousResults |
退貨 | |
---|---|
獲得隔離等級
public CurrentInvocation.IsolationGrade getIsolationGrade ()
退貨 | |
---|---|
CurrentInvocation.IsolationGrade |
獲取最大重試計數
public int getMaxRetryCount ()
自動重試期間的最大嘗試次數。
退貨 | |
---|---|
int |
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 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 boolean useUpdatedReporting ()
如果我們應該使用更新的報告,則返回 true。
退貨 | |
---|---|
boolean |
受保護的方法
重試
protected void isolateRetry (devices)
參數 | |
---|---|
devices |
投擲 | |
---|---|
DeviceNotAvailableException |