BaseRetryDecision

public class BaseRetryDecision
extends Object implements IConfigurationReceiver, IRetryDecision, ITestInformationReceiver

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


IRetryDecision 的基本實作方式。基本導入作業只會考量本機信號。

摘要

公用建構函式

BaseRetryDecision()

重試決定的建構函式

公用方法

void addLastAttempt( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) 很可能會在最後一次重試嘗試之前呼叫,因此我們可能會遺漏統計用途的最後一次嘗試結果。

void addToSkipRetryList(String filterEntry)

新增項目,略過重試。

static getFailedTestCases( previousResults)

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

CurrentInvocation.IsolationGrade getIsolationGrade()
int getMaxRetryCount()

自動重試期間的嘗試次數上限。

int getMaxRetryCount(ModuleDefinition module)

指定模組自動重試時的最大重試次數。

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)

決定是否應嘗試重試。

boolean shouldRetry(IRemoteTest test, int attemptJustExecuted, previousResults)

決定是否應嘗試重試。

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

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

boolean useUpdatedReporting()

如果應使用更新版報表,則會傳回 true。

受保護的方法

void isolateRetry( devices)

公用建構函式

BaseRetryDecision

public BaseRetryDecision ()

重試決定的建構函式

公用方法

addLastAttempt

public void addLastAttempt ( lastResults)

ERROR(/#shouldRetry(com.android.tradefed.testtype.IRemoteTest,int,List)) 很可能會在最後一次重試嘗試之前呼叫,因此我們可能會遺漏統計用途的最後一次嘗試結果。這個方法可提供這些結果,以便正確計算統計資料。

addToSkipRetryList

public void addToSkipRetryList (String filterEntry)

新增項目來略過重試。

參數
filterEntry String

getFailedTestCases

public static  getFailedTestCases ( previousResults)

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

參數
previousResults

傳回

getIsolationGrade

public CurrentInvocation.IsolationGrade getIsolationGrade ()

傳回
CurrentInvocation.IsolationGrade

getMaxRetryCount

public int getMaxRetryCount ()

自動重試時的嘗試次數上限。

傳回
int

getMaxRetryCount

public int getMaxRetryCount (ModuleDefinition module)

指定模組自動重試時的最大重試次數。

參數
module ModuleDefinition

傳回
int

getRetryStatistics

public RetryStatistics getRetryStatistics ()

傳回代表重試的 RetryStatistics

傳回
RetryStatistics

getRetryStrategy

public RetryStrategy getRetryStrategy ()

自動重試期間使用的 RetryStrategy

傳回
RetryStrategy

getSkipRetrySet

public  getSkipRetrySet ()

傳回

getTestInformation

public TestInformation getTestInformation ()

傳回
TestInformation

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, 
                 previousResults, 
                DeviceNotAvailableException dnae)

決定是否應重試。另外,請對要重試的 IRemoteTest 進行必要變更 (例如套用篩選器)。

參數
test IRemoteTest:剛執行的 IRemoteTest

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

attemptJustExecuted int:剛執行的嘗試次數。

previousResults :剛執行的測試的 TestRunResult 清單。

dnae DeviceNotAvailableException:裝置的 DeviceNotAvailableException 無法使用例外狀況。

傳回
boolean 如果應重試,則傳回 True,否則傳回 False。

擲回
DeviceNotAvailableException

shouldRetry

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

決定是否應重試。另外,請對要重試的 IRemoteTest 進行必要變更 (例如套用篩選器)。

參數
test IRemoteTest:剛執行的 IRemoteTest

attemptJustExecuted int:剛執行的嘗試次數。

previousResults :剛執行的測試的 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 ( devices)

參數
devices

擲回
DeviceNotAvailableException