BaseRetryDecision
public
class
BaseRetryDecision
extends Object
implements
IConfigurationReceiver,
IRetryDecision,
ITestInformationReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.retry.BaseRetryDecision |
IRetryDecision 的基本實作方式。基本導入只會將本地信號納入考量。
摘要
公用建構函式 | |
|---|---|
BaseRetryDecision()
重試決策的建構函式 |
|
公用方法 | |
|---|---|
void
|
addLastAttempt(List<TestRunResult> lastResults)
|
void
|
addToSkipRetryList(String filterEntry)
新增項目即可略過重試。 |
List<String>
|
getCommandLineArgs()
傳回重試決策的指令列引數。 |
CurrentInvocation.IsolationGrade
|
getIsolationGrade()
|
int
|
getMaxTestCaseAttempts()
自動重試時,每次測試執行的嘗試次數上限。 |
int
|
getMaxTestCaseAttempts(ModuleDefinition module)
自動重試期間,特定模組每次測試執行的嘗試次數上限。 |
int
|
getMaxTestRunAttempts()
自動重試時,每次測試執行的嘗試次數上限。 |
int
|
getMaxTestRunAttempts(ModuleDefinition module)
自動重試期間,特定模組每次測試執行的嘗試次數上限。 |
RetryStatistics
|
getRetryStatistics()
傳回代表重試的 |
RetryStrategy
|
getRetryStrategy()
自動重試期間使用的 |
Set<String>
|
getSkipRetrySet()
|
TestInformation
|
getTestInformation()
|
boolean
|
isAutoRetryEnabled()
是否啟用自動重試。 |
boolean
|
rebootAtLastAttempt()
是否要在最後一次嘗試前重新啟動裝置。 |
void
|
setConfiguration(IConfiguration configuration)
注入使用的 |
void
|
setInvocationContext(IInvocationContext context)
Set the current invocation context. |
void
|
setTestInformation(TestInformation testInformation)
|
boolean
|
shouldRetry(IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, List<TestRunResult> previousResults, DeviceNotAvailableException dnae)
決定是否要嘗試重試。 |
boolean
|
shouldRetry(IRemoteTest test, int attemptJustExecuted, List<TestRunResult> previousResults)
決定是否要嘗試重試。 |
RetryPreparationDecision
|
shouldRetryPreparation(ModuleDefinition module, int attempt, int maxAttempt)
決定是否要重試模組準備作業。 |
boolean
|
useUpdatedReporting()
Returns true if we should use the updated reporting. |
受保護的方法 | |
|---|---|
void
|
isolateRetry(List<ITestDevice> devices)
|
公用建構函式
BaseRetryDecision
public BaseRetryDecision ()
重試決策的建構函式
公用方法
addLastAttempt
public void addLastAttempt (List<TestRunResult> lastResults)
shouldRetry(IRemoteTest,int,List) 最有可能在最後一次重試嘗試之前呼叫,因此我們可能會為了統計目的而遺漏最後一次嘗試的結果。這個方法可提供這些結果,以利進行適當的統計資料計算。
addToSkipRetryList
public void addToSkipRetryList (String filterEntry)
新增項目即可略過重試。
| 參數 | |
|---|---|
filterEntry |
String |
getCommandLineArgs
public List<String> getCommandLineArgs ()
傳回重試決策的指令列引數。
| 傳回 | |
|---|---|
List<String> |
|
getIsolationGrade
public CurrentInvocation.IsolationGrade getIsolationGrade ()
| 傳回 | |
|---|---|
CurrentInvocation.IsolationGrade |
|
getMaxTestCaseAttempts
public int getMaxTestCaseAttempts ()
自動重試時,每次測試執行的嘗試次數上限。
| 傳回 | |
|---|---|
int |
|
getMaxTestCaseAttempts
public int getMaxTestCaseAttempts (ModuleDefinition module)
自動重試期間,特定模組每次測試執行的嘗試次數上限。
| 參數 | |
|---|---|
module |
ModuleDefinition |
| 傳回 | |
|---|---|
int |
|
getMaxTestRunAttempts
public int getMaxTestRunAttempts ()
自動重試時,每次測試執行的嘗試次數上限。
| 傳回 | |
|---|---|
int |
|
getMaxTestRunAttempts
public int getMaxTestRunAttempts (ModuleDefinition module)
自動重試期間,特定模組每次測試執行的嘗試次數上限。
| 參數 | |
|---|---|
module |
ModuleDefinition |
| 傳回 | |
|---|---|
int |
|
getRetryStatistics
public RetryStatistics getRetryStatistics ()
傳回代表重試的 RetryStatistics。
| 傳回 | |
|---|---|
RetryStatistics |
|
getSkipRetrySet
public Set<String> getSkipRetrySet ()
| 傳回 | |
|---|---|
Set<String> |
|
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 |
setTestInformation
public void setTestInformation (TestInformation testInformation)
| 參數 | |
|---|---|
testInformation |
TestInformation |
shouldRetry
public boolean shouldRetry (IRemoteTest test, ModuleDefinition module, int attemptJustExecuted, List<TestRunResult> previousResults, DeviceNotAvailableException dnae)
決定是否要嘗試重試。此外,請對 IRemoteTest 進行必要變更,然後重試 (套用篩選器等)。
| 參數 | |
|---|---|
test |
IRemoteTest:剛執行的 IRemoteTest。 |
module |
ModuleDefinition:測試模組的 ModuleDefinition 物件。 |
attemptJustExecuted |
int:我們剛執行的嘗試次數。 |
previousResults |
List:剛執行的測試 TestRunResult 清單。 |
dnae |
DeviceNotAvailableException:裝置無法使用例外狀況。DeviceNotAvailableException |
| 傳回 | |
|---|---|
boolean |
如果應重試,則為 True,否則為 False。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
shouldRetry
public boolean shouldRetry (IRemoteTest test, int attemptJustExecuted, List<TestRunResult> previousResults)
決定是否要嘗試重試。此外,請對 IRemoteTest 進行必要變更,然後重試 (套用篩選器等)。
| 參數 | |
|---|---|
test |
IRemoteTest:剛執行的 IRemoteTest。 |
attemptJustExecuted |
int:我們剛執行的嘗試次數。 |
previousResults |
List:剛執行的測試 TestRunResult 清單。 |
| 傳回 | |
|---|---|
boolean |
如果應重試,則為 True,否則為 False。 |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|
shouldRetryPreparation
public RetryPreparationDecision shouldRetryPreparation (ModuleDefinition module, int attempt, int maxAttempt)
決定是否要重試模組準備作業。
| 參數 | |
|---|---|
module |
ModuleDefinition |
attempt |
int |
maxAttempt |
int |
| 傳回 | |
|---|---|
RetryPreparationDecision |
|
useUpdatedReporting
public boolean useUpdatedReporting ()
如果應使用更新版報表,則傳回 true。
| 傳回 | |
|---|---|
boolean |
|
受保護的方法
isolateRetry
protected void isolateRetry (List<ITestDevice> devices)
| 參數 | |
|---|---|
devices |
List |
| 擲回 | |
|---|---|
DeviceNotAvailableException |
|