BaseRetryDecision
public
class
BaseRetryDecision
extends Object
implements
IRetryDecision,
IConfigurationReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.retry.BaseRetryDecision |
IRetryDecision 的基本實作方式。基本導入作業只會考量本機信號。
摘要
公用建構函式 | |
|---|---|
BaseRetryDecision()
重試決定的建構函式 |
|
公用方法 | |
|---|---|
void
|
addLastAttempt(
|
static
|
getFailedTestCases(
傳回應重試的失敗測試案例對應項目。 |
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,
決定是否應嘗試重試。 |
boolean
|
shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted,
決定是否應嘗試重試。 |
boolean
|
useUpdatedReporting()
如果應使用更新版報表,則會傳回 true。 |
受保護的方法 | |
|---|---|
void
|
isolateRetry(
|
公用建構函式
BaseRetryDecision
public BaseRetryDecision ()
重試決定的建構函式
公用方法
addLastAttempt
public void addLastAttempt (lastResults)
ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) 很可能會在最後一次重試嘗試之前呼叫,因此我們可能會遺漏統計用途的最後一次嘗試結果。這個方法可提供這些結果,以便正確計算統計資料。
getFailedTestCases
public staticgetFailedTestCases ( previousResults)
傳回應重試的失敗測試案例對應項目。
| 參數 | |
|---|---|
previousResults |
|
| 傳回 | |
|---|---|
|
|
getIsolationGrade
public CurrentInvocation.IsolationGrade getIsolationGrade ()
| 傳回 | |
|---|---|
CurrentInvocation.IsolationGrade |
|
getMaxRetryCount
public int getMaxRetryCount ()
自動重試時的嘗試次數上限。
| 傳回 | |
|---|---|
int |
|
getRetryStatistics
public RetryStatistics getRetryStatistics ()
傳回代表重試的 RetryStatistics。
| 傳回 | |
|---|---|
RetryStatistics |
|
isAutoRetryEnabled
public boolean isAutoRetryEnabled ()
是否啟用自動重試功能。
| 傳回 | |
|---|---|
boolean |
|
rebootAtLastAttempt
public boolean rebootAtLastAttempt ()
在最後一次嘗試前,是否要重新啟動裝置。
| 傳回 | |
|---|---|
boolean |
|
setConfiguration
public void setConfiguration (IConfiguration configuration)
插入正在使用的 IConfiguration。
| 參數 | |
|---|---|
configuration |
IConfiguration |
setInvocationContext
public void setInvocationContext (IInvocationContext context)
設定目前的叫用內容。
| 參數 | |
|---|---|
context |
IInvocationContext |
shouldRetry
public boolean shouldRetry (IRemoteTest test,
int attemptJustExecuted,
previousResults) 決定是否應重試。另外,請對要重試的 IRemoteTest 進行必要變更 (例如套用篩選器)。
| 參數 | |
|---|---|
test |
IRemoteTest:剛執行的 IRemoteTest。 |
attemptJustExecuted |
int:剛執行的嘗試次數。 |
previousResults |
:剛執行的測試的 TestRunResult 清單。 |
| 傳回 | |
|---|---|
boolean |
如果應重試,則傳回 True,否則傳回 False。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
shouldRetry
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 |
|
useUpdatedReporting
public boolean useUpdatedReporting ()
如果應使用更新版報表,則會傳回 true。
| 傳回 | |
|---|---|
boolean |
|
受保護的方法
isolateRetry
protected void isolateRetry (devices)
| 參數 | |
|---|---|
devices |
|
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|