GranularRetriableTestWrapper
public
class
GranularRetriableTestWrapper
extends Object
implements
IRemoteTest,
ITestCollector
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.suite.GranularRetriableTestWrapper |
Klasa opakowująca działa na poziomie IRemoteTest, aby podzielić IRemoteTest na poziom testu.
Test IRemoteTest może zawierać wiele testów. Wcześniej te testy były traktowane jako całość: podczas uruchamiania IRemoteTest uruchamiane są wszystkie testy. Niektóre obiekty IRemoteTest (te, które implementują ITestFilterReceiver) mogą akceptować listę dozwolonych testów i uruchamiać tylko te testy. Ta klasa korzysta z dotychczasowej funkcji i zapewnia bardziej elastyczny sposób uruchamiania zestawu testów.
- Pojedynczy przypadek testowy można powtórzyć kilka razy (w ramach tego samego przebiegu IRemoteTest), aby zmniejszyć wskaźnik błędów niezwiązanych z błędami testu.
- Testy, które mają być powtórzone, są dynamicznie zbierane z poprzednich niepowodzeń.
Uwaga:
- Warunkiem wdrożenia podzbioru przypadków testowych jest to, aby typ testu implementował interfejs
ITestFilterReceiver. - X to niestandardowa maksymalna liczba prób.
Podsumowanie
Zagnieżdżone klasy | |
|---|---|
class |
GranularRetriableTestWrapper.StartEndCollector
Pomocnik klasy do wychwytywania brakujących początków i zakończeń biegu. |
Konstruktory publiczne | |
|---|---|
GranularRetriableTestWrapper(IRemoteTest test, ITestInvocationListener mainListener, int maxRunLimit)
|
|
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit)
|
|
GranularRetriableTestWrapper(IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit, boolean useModuleResultsForwarder)
|
|
Metody publiczne | |
|---|---|
final
int
|
getExpectedTestsCount()
Oblicz liczbę testów w |
final
|
getFinalTestRunResults()
Pobierz scalone wyniki testu TestRunResults z każdego z |
final
|
getPassedTests()
|
ModuleListener
|
getResultListener()
Zwraca obiekt listener zawierający wszystkie wyniki. |
int
|
getRetryCount()
|
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
Zaplanuj serię |
void
|
setCollectTestsOnly(boolean shouldCollectTest)
Włącza lub wyłącza tryb testowy zbierania danych |
void
|
setInvocationContext(IInvocationContext moduleInvocationContext)
Ustaw atrybut |
void
|
setLogSaver(ILogSaver logSaver)
Ustaw atrybut |
void
|
setMarkTestsSkipped(boolean skipTestCases)
Ustaw atrybut |
void
|
setMetricCollectors(
Ustaw runMetricCollector w elementach |
void
|
setModuleConfig(IConfiguration moduleConfiguration)
Ustaw atrybut ModuleConfig modułu |
void
|
setModuleId(String moduleId)
Ustaw nazwę |
void
|
setRetryDecision(IRetryDecision decision)
Ustawia |
Konstruktory publiczne
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test, ITestInvocationListener mainListener, int maxRunLimit)
| Parametry | |
|---|---|
test |
IRemoteTest |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit)
| Parametry | |
|---|---|
test |
IRemoteTest |
module |
ModuleDefinition |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
GranularRetriableTestWrapper
public GranularRetriableTestWrapper (IRemoteTest test, ModuleDefinition module, ITestInvocationListener mainListener, int maxRunLimit, boolean useModuleResultsForwarder)
| Parametry | |
|---|---|
test |
IRemoteTest |
module |
ModuleDefinition |
mainListener |
ITestInvocationListener |
maxRunLimit |
int |
useModuleResultsForwarder |
boolean |
Metody publiczne
getExpectedTestsCount
public final int getExpectedTestsCount ()
Oblicz liczbę testów w IRemoteTest. Ta wartość odróżnia te same przypadki testowe, które są ponownie planowane.
| Zwroty | |
|---|---|
int |
|
getFinalTestRunResults
public finalgetFinalTestRunResults ()
Pobierz scalone wyniki testu TestRunResults z każdego z IRemoteTest testów.
| Zwroty | |
|---|---|
|
|
getPassedTests
public finalgetPassedTests ()
| Zwroty | |
|---|---|
|
|
getResultListener
public ModuleListener getResultListener ()
Zwraca obiekt listener zawierający wszystkie wyniki.
| Zwroty | |
|---|---|
ModuleListener |
|
getRetryCount
public int getRetryCount ()
| Zwroty | |
|---|---|
int |
|
home run
public void run (TestInformation testInfo, ITestInvocationListener listener)
Zaplanuj serię IRemoteTest.run(TestInformation, ITestInvocationListener).
| Parametry | |
|---|---|
testInfo |
TestInformation: obiekt TestInformation zawierający przydatne informacje do przeprowadzania testów. |
listener |
ITestInvocationListener: odbiornik ResultForwarder zawierający nowy modułListener dla każdej pętli. |
| Rzuty | |
|---|---|
DeviceNotAvailableException |
|
setCollectTestsOnly
public void setCollectTestsOnly (boolean shouldCollectTest)
Włącza lub wyłącza tryb testowy zbierania danych
setInvocationContext
public void setInvocationContext (IInvocationContext moduleInvocationContext)
Ustaw atrybut IInvocationContext jako atrybut GranularRetriableTestWrapper.
| Parametry | |
|---|---|
moduleInvocationContext |
IInvocationContext: w razie potrzeby opakowanie używa InvocationContext do inicjowania klasy MetricCollector. |
setLogSaver
public void setLogSaver (ILogSaver logSaver)
Ustaw atrybut ILogSaver modułu jako atrybut GranularRetriableTestWrapper.
| Parametry | |
|---|---|
logSaver |
ILogSaver: Odsłuchi dla każdego uruchomienia testu powinny zapisywać dzienniki. |
setMarkTestsSkipped
public void setMarkTestsSkipped (boolean skipTestCases)
Ustaw atrybut ModuleDefinition RunStrategy jako atrybut GranularRetriableTestWrapper.
| Parametry | |
|---|---|
skipTestCases |
boolean: czy testy powinny zostać pominięte. |
setMetricCollectors
public void setMetricCollectors (runMetricCollectors)
Ustaw runMetricCollector w elementach ModuleDefinition jako atrybut GranularRetriableTestWrapper.
| Parametry | |
|---|---|
runMetricCollectors |
: lista obiektów MetricCollector dla modułu. |
setModuleConfig
public void setModuleConfig (IConfiguration moduleConfiguration)
Ustaw atrybut ModuleConfig modułu ModuleDefinition jako atrybut GranularRetriableTestWrapper.
| Parametry | |
|---|---|
moduleConfiguration |
IConfiguration: podaj dane modułu. |
setModuleId
public void setModuleId (String moduleId)
Ustaw nazwę ModuleDefinition jako atrybut GranularRetriableTestWrapper.
| Parametry | |
|---|---|
moduleId |
String: nazwa moduleDefinition. |
setRetryDecision
public void setRetryDecision (IRetryDecision decision)
Ustawia IRetryDecision do użycia.
| Parametry | |
|---|---|
decision |
IRetryDecision |