ExecutableBaseTest
public
abstract
class
ExecutableBaseTest
extends Object
implements
IAbiReceiver,
IConfigurationReceiver,
IDiscoverDependencies,
IRemoteTest,
IRuntimeHintProvider,
IShardableTest,
ITestCollector,
ITestFilterReceiver
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.binary.ExecutableBaseTest |
Klasa bazowa dla wykonywalnego stylu testów. Na przykład: pliki binarne, skrypty powłoki.
Podsumowanie
Stałe | |
|---|---|
String |
NO_BINARY_ERROR
|
Konstruktory publiczne | |
|---|---|
ExecutableBaseTest()
|
|
Metody publiczne | |
|---|---|
void
|
addAllExcludeFilters(Set<String> filters)
Dodaje |
void
|
addAllIncludeFilters(Set<String> filters)
Dodaje |
void
|
addExcludeFilter(String filter)
Dodaje filtr określający, które testy mają zostać wykluczone. |
void
|
addIncludeFilter(String filter)
Dodaje filtr określający, które testy mają być uwzględnione. |
void
|
clearExcludeFilters()
Usuń wszystkie obecnie śledzone filtry wykluczeń. |
void
|
clearIncludeFilters()
Usuń wszystkie obecnie śledzone filtry uwzględniania. |
abstract
String
|
findBinary(String binary)
Wyszukaj plik binarny, aby móc go uruchomić. |
IAbi
|
getAbi()
|
boolean
|
getCollectTestsOnly()
|
Set<String>
|
getExcludeFilters()
Zwraca bieżącą |
Set<String>
|
getIncludeFilters()
Zwraca bieżącą |
final
long
|
getRuntimeHint()
Zwraca oczekiwany czas działania testu w milisekundach. |
Set<String>
|
reportDependencies()
|
void
|
run(TestInformation testInfo, ITestInvocationListener listener)
Przeprowadza testy i przekazuje wyniki odbiorcy. |
abstract
void
|
runBinary(String binaryPath, ITestInvocationListener listener, TestDescription description)
Uruchamia plik binarny w podanej ścieżce. |
final
void
|
setAbi(IAbi abi)
|
final
void
|
setCollectTestsOnly(boolean shouldCollectTest)
Włącza lub wyłącza tryb zbierania testów |
void
|
setConfiguration(IConfiguration configuration)
Wstawia używaną wartość |
FailureDescription
|
shouldAbortRun(TestDescription description)
Sprawdź, czy testRun powinien zakończyć się wcześniej. |
final
Collection<IRemoteTest>
|
split(int shardHint)
Alternatywna wersja |
Metody chronione | |
|---|---|
boolean
|
doesRunBinaryGenerateTestResults()
|
boolean
|
doesRunBinaryGenerateTestRuns()
|
Map<String, String>
|
getAllTestCommands()
Aby zachować spójność, przekonwertowano mBinaryPaths na mTestCommands. |
IConfiguration
|
getConfiguration()
Zwraca konfigurację testu. |
TestDescription[]
|
getFilterDescriptions(Map<String, String> testCommands)
|
String
|
getModuleId(IInvocationContext context)
|
long
|
getTimeoutPerBinaryMs()
|
boolean
|
isTestFailed(String testName)
|
Stałe
NO_BINARY_ERROR
public static final String NO_BINARY_ERROR
Wartość stała: „Plik binarny %s nie istnieje”.
Konstruktory publiczne
ExecutableBaseTest
public ExecutableBaseTest ()
Metody publiczne
addAllExcludeFilters
public void addAllExcludeFilters (Set<String> filters)
Dodaje Set filtrów określających, które testy mają zostać wykluczone.
| Parametry | |
|---|---|
filters |
Set |
addAllIncludeFilters
public void addAllIncludeFilters (Set<String> filters)
Dodaje Set filtrów, które określają, jakie testy mają być uwzględnione.
| Parametry | |
|---|---|
filters |
Set |
addExcludeFilter
public void addExcludeFilter (String filter)
Dodaje filtr określający, które testy mają zostać wykluczone.
| Parametry | |
|---|---|
filter |
String |
addIncludeFilter
public void addIncludeFilter (String filter)
Dodaje filtr określający, które testy mają być uwzględnione.
| Parametry | |
|---|---|
filter |
String |
clearExcludeFilters
public void clearExcludeFilters ()
Usuń wszystkie obecnie śledzone filtry wykluczeń.
clearIncludeFilters
public void clearIncludeFilters ()
Usuń wszystkie obecnie śledzone filtry uwzględniania.
findBinary
public abstract String findBinary (String binary)
Wyszukaj plik binarny, aby móc go uruchomić.
| Parametry | |
|---|---|
binary |
String: ścieżka do pliku binarnego lub po prostu jego nazwa. |
| Zwraca | |
|---|---|
String |
Ścieżka do pliku binarnego lub wartość null, jeśli nie znaleziono pliku. |
| Zgłasza | |
|---|---|
DeviceNotAvailableException |
|
getCollectTestsOnly
public boolean getCollectTestsOnly ()
| Zwraca | |
|---|---|
boolean |
|
getExcludeFilters
public Set<String> getExcludeFilters ()
Zwraca bieżącą Set filtrów wykluczeń.
| Zwraca | |
|---|---|
Set<String> |
|
getIncludeFilters
public Set<String> getIncludeFilters ()
Zwraca bieżącą Set filtrów uwzględniania.
| Zwraca | |
|---|---|
Set<String> |
|
getRuntimeHint
public final long getRuntimeHint ()
Zwraca oczekiwany czas działania testu w milisekundach. Ten czas jest używany do równoważenia obciążenia podczas wykonywania podzielonego na fragmenty.
| Zwraca | |
|---|---|
long |
|
reportDependencies
public Set<String> reportDependencies ()
| Zwraca | |
|---|---|
Set<String> |
|
home run
public void run (TestInformation testInfo, ITestInvocationListener listener)
Przeprowadza testy i przekazuje wyniki odbiorcy.
| Parametry | |
|---|---|
testInfo |
TestInformation: obiekt TestInformation zawierający przydatne informacje do przeprowadzania testów. |
listener |
ITestInvocationListener: ITestInvocationListener wyników testu |
| Zgłasza | |
|---|---|
DeviceNotAvailableException |
|
runBinary
public abstract void runBinary (String binaryPath,
ITestInvocationListener listener,
TestDescription description)Uruchamia plik binarny w podanej ścieżce.
| Parametry | |
|---|---|
binaryPath |
String: ścieżka pliku binarnego. |
listener |
ITestInvocationListener: odbiorca, do którego należy zgłosić wyniki. |
description |
TestDescription: trwający test. |
| Zgłasza | |
|---|---|
DeviceNotAvailableException |
|
IOException |
|
setCollectTestsOnly
public final void setCollectTestsOnly (boolean shouldCollectTest)
Włącza lub wyłącza tryb zbierania testów
setConfiguration
public void setConfiguration (IConfiguration configuration)
Wstawia używaną wartość IConfiguration.
| Parametry | |
|---|---|
configuration |
IConfiguration |
shouldAbortRun
public FailureDescription shouldAbortRun (TestDescription description)
Sprawdź, czy testRun powinien zakończyć się wcześniej.
| Parametry | |
|---|---|
description |
TestDescription: trwający test. |
| Zwraca | |
|---|---|
FailureDescription |
FailureDescription, jeśli pętla wykonania ma zostać zakończona. |
podziel
public final Collection<IRemoteTest> split (int shardHint)
Alternatywna wersja split(), która podaje też liczbę fragmentów, które mają zostać uruchomione. Jest to przydatne w przypadku niektórych programów do uruchamiania testów, które nie mogą czasami podejmować arbitralnych decyzji.
| Parametry | |
|---|---|
shardHint |
int: liczba fragmentów, których utworzenie zostało podjęte. |
| Zwraca | |
|---|---|
Collection<IRemoteTest> |
zbiór podtestów do wykonania osobno lub null, jeśli test nie jest obecnie podzielony na części. |
Metody chronione
doesRunBinaryGenerateTestResults
protected boolean doesRunBinaryGenerateTestResults ()
| Zwraca | |
|---|---|
boolean |
|
doesRunBinaryGenerateTestRuns
protected boolean doesRunBinaryGenerateTestRuns ()
| Zwraca | |
|---|---|
boolean |
|
getAllTestCommands
protected Map<String, String> getAllTestCommands ()
Aby zachować spójność, przekonwertuj mBinaryPaths na mTestCommands.
| Zwraca | |
|---|---|
Map<String, String> |
MapLinkedHashMap<string, string=""> testCommands.</string,> |
getConfiguration
protected IConfiguration getConfiguration ()
Zwraca konfigurację testu.
| Zwraca | |
|---|---|
IConfiguration |
obiekt IConfiguration, |
getFilterDescriptions
protected TestDescription[] getFilterDescriptions (Map<String, String> testCommands)
| Parametry | |
|---|---|
testCommands |
Map |
| Zwraca | |
|---|---|
TestDescription[] |
|
getModuleId
protected String getModuleId (IInvocationContext context)
| Parametry | |
|---|---|
context |
IInvocationContext |
| Zwraca | |
|---|---|
String |
|
getTimeoutPerBinaryMs
protected long getTimeoutPerBinaryMs ()
| Zwraca | |
|---|---|
long |
czas oczekiwania zastosowany do każdego pliku binarnego podczas jego wykonywania. |
isTestFailed
protected boolean isTestFailed (String testName)
| Parametry | |
|---|---|
testName |
String |
| Zwraca | |
|---|---|
boolean |
|