DeviceTestRunOptions

public class DeviceTestRunOptions
extends Object

java.lang.Object
   ↳ com.android.tradefed.testtype.junit4.DeviceTestRunOptions


Klasa narzędzia do tworzenia opcji związanych z przeprowadzaniem testów urządzeń za pomocą klasy BaseHostJUnit4Test.

Podsumowanie

Konstruktory publiczne

DeviceTestRunOptions(String packageName)

Metody publiczne

DeviceTestRunOptions addExtraListener(ITestLifeCycleReceiver listener)

Dodaj dodatkowego odbiorcę do uruchamianego instrumentu.

DeviceTestRunOptions addInstrumentationArg(String key, String value)

Dodaj argument, który zostanie przekazany do instrumentacji.

void clearExtraListeners()
void clearInstrumentationArgs()

Wyczyść wszystkie argumenty instrumentacji, które zostały wcześniej ustawione za pomocą funkcji addInstrumentationArg(String,String).

String getApkFileName()

Zwraca nazwę pliku APK na potrzeby instalacji APK.

ITestDevice getDevice()
List<ITestLifeCycleReceiver> getExtraListeners()
String[] getInstallArgs()

Zwraca dodatkowe opcje polecenia instalacji.

Map<String, String> getInstrumentationArgs()
Long getMaxInstrumentationTimeoutMs()
Long getMaxTimeToOutputMs()
String getPackageName()
String getRunner()
String getTestClassName()
String getTestMethodName()
Long getTestTimeoutMs()
Integer getUserId()
boolean isForceQueryable()

Określa, czy można wysyłać zapytania dotyczące instalowanego pliku APK.

boolean isGrantPermission()

Określa, czy przyznać uprawnienia do instalacji pliku APK.

boolean isHiddenApiCheckDisabled()
boolean isInstrumentInPcc()

Określa, czy do parametru „am instrument” używanego po stronie hosta ma zostać dodany argument „--instrument-in-pcc”.

boolean isIsolatedStorageDisabled()
boolean isRestartDisabled()
boolean isTestApiCheckDisabled()
boolean isWindowAnimationDisabled()
DeviceTestRunOptions setApkFileName(String apkFileName)

Ustawia nazwę pliku APK na potrzeby instalacji.

DeviceTestRunOptions setCheckResults(boolean checkResults)

Określa, czy wyniki uruchomienia instrumentacji powinny być sprawdzane i czy nie wystąpiły żadne błędy.

DeviceTestRunOptions setDevice(ITestDevice device)
DeviceTestRunOptions setDisableHiddenApiCheck(boolean disableHiddenApiCheck)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-hidden-api-checks”.

DeviceTestRunOptions setDisableIsolatedStorage(boolean disableIsolatedStorage)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument --no-isolated-storage.

DeviceTestRunOptions setDisableRestart(boolean disableRestart)

Określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-restart”.

DeviceTestRunOptions setDisableTestApiCheck(boolean disableTestApiCheck)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-test-api-access”.

DeviceTestRunOptions setDisableWindowAnimation(boolean disableWindowAnimation)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-window-animation”.

DeviceTestRunOptions setForceQueryable(boolean forceQueryable)

Ustawia wartość false, jeśli nie można wysyłać zapytań o plik APK do zainstalowania.

DeviceTestRunOptions setGrantPermission(boolean grantPermission)

Przyznaje uprawnienia do instalowania plików APK.

DeviceTestRunOptions setInstallArgs(String... installArgs)

Ustawia dodatkowe opcje polecenia instalacji.

DeviceTestRunOptions setInstrumentInPcc(boolean instrumentInPcc)

Określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--instrument-in-pcc”.

DeviceTestRunOptions setMaxInstrumentationTimeoutMs(Long maxInstrumentationTimeoutMs)

Ustawia maksymalny czas (w milisekundach), w którym cała instrumentacja musi zostać uruchomiona i zakończona.

DeviceTestRunOptions setMaxTimeToOutputMs(Long maxTimeToOutputMs)

Określa maksymalny czas (w milisekundach), przez jaki instrumentacja może przestać generować dane wyjściowe, zanim zostanie zatrzymana.

DeviceTestRunOptions setRunner(String runner)

Ustawia narzędzie do uruchamiania instrumentacji, które ma być używane do uruchamiania instrumentacji.

DeviceTestRunOptions setTestClassName(String testClassName)

Ustawia nazwę klasy, w której ma być uruchomione narzędzie.

DeviceTestRunOptions setTestMethodName(String testMethodName)

Ustawia nazwę metody, którą ma uruchomić instrumentacja.

DeviceTestRunOptions setTestTimeoutMs(Long testTimeoutMs)

Określa maksymalny czas (w milisekundach), przez jaki test może być uruchomiony, zanim zostanie przerwany.

DeviceTestRunOptions setUserId(Integer userId)

Ustawia identyfikator użytkownika, na podstawie którego ma działać instrumentacja.

boolean shouldCheckResults()

Konstruktory publiczne

DeviceTestRunOptions

public DeviceTestRunOptions (String packageName)

Parametry
packageName String

Metody publiczne

addExtraListener

public DeviceTestRunOptions addExtraListener (ITestLifeCycleReceiver listener)

Dodaj dodatkowego odbiorcę do uruchamianego instrumentu.

Parametry
listener ITestLifeCycleReceiver

Zwraca
DeviceTestRunOptions

addInstrumentationArg

public DeviceTestRunOptions addInstrumentationArg (String key, 
                String value)

Dodaj argument, który zostanie przekazany do instrumentacji.

Parametry
key String

value String

Zwraca
DeviceTestRunOptions

clearExtraListeners

public void clearExtraListeners ()

clearInstrumentationArgs

public void clearInstrumentationArgs ()

Wyczyść wszystkie argumenty instrumentacji, które zostały wcześniej ustawione za pomocą funkcji addInstrumentationArg(String,String).

getApkFileName

public String getApkFileName ()

Zwraca nazwę pliku APK na potrzeby instalacji APK.

Zwraca
String

getDevice

public ITestDevice getDevice ()

Zwraca
ITestDevice

getExtraListeners

public List<ITestLifeCycleReceiver> getExtraListeners ()

Zwraca
List<ITestLifeCycleReceiver>

getInstallArgs

public String[] getInstallArgs ()

Zwraca dodatkowe opcje polecenia instalacji.

Zwraca
String[]

getInstrumentationArgs

public Map<String, String> getInstrumentationArgs ()

Zwraca
Map<String, String>

getMaxInstrumentationTimeoutMs

public Long getMaxInstrumentationTimeoutMs ()

Zwraca
Long

getMaxTimeToOutputMs

public Long getMaxTimeToOutputMs ()

Zwraca
Long

getPackageName

public String getPackageName ()

Zwraca
String

getRunner

public String getRunner ()

Zwraca
String

getTestClassName

public String getTestClassName ()

Zwraca
String

getTestMethodName

public String getTestMethodName ()

Zwraca
String

getTestTimeoutMs

public Long getTestTimeoutMs ()

Zwraca
Long

getUserId

public Integer getUserId ()

Zwraca
Integer

isForceQueryable

public boolean isForceQueryable ()

Określa, czy można wysyłać zapytania dotyczące instalowanego pliku APK. Wartość domyślna to true (prawda).

Zwraca
boolean

isGrantPermission

public boolean isGrantPermission ()

Określa, czy przyznać uprawnienia do instalacji pliku APK.

Zwraca
boolean

isHiddenApiCheckDisabled

public boolean isHiddenApiCheckDisabled ()

Zwraca
boolean

isInstrumentInPcc

public boolean isInstrumentInPcc ()

Określa, czy do parametru „am instrument” używanego po stronie hosta ma zostać dodany argument „--instrument-in-pcc”.

Zwraca
boolean

isIsolatedStorageDisabled

public boolean isIsolatedStorageDisabled ()

Zwraca
boolean

isRestartDisabled

public boolean isRestartDisabled ()

Zwraca
boolean

isTestApiCheckDisabled

public boolean isTestApiCheckDisabled ()

Zwraca
boolean

isWindowAnimationDisabled

public boolean isWindowAnimationDisabled ()

Zwraca
boolean

setApkFileName

public DeviceTestRunOptions setApkFileName (String apkFileName)

Ustawia nazwę pliku APK na potrzeby instalacji.

Parametry
apkFileName String

Zwraca
DeviceTestRunOptions

setCheckResults

public DeviceTestRunOptions setCheckResults (boolean checkResults)

Określa, czy wyniki uruchomienia instrumentacji powinny być sprawdzane i czy nie wystąpiły żadne błędy.

Parametry
checkResults boolean

Zwraca
DeviceTestRunOptions

setDevice

public DeviceTestRunOptions setDevice (ITestDevice device)

Parametry
device ITestDevice

Zwraca
DeviceTestRunOptions

setDisableHiddenApiCheck

public DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-hidden-api-checks”.

Parametry
disableHiddenApiCheck boolean

Zwraca
DeviceTestRunOptions

setDisableIsolatedStorage

public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument --no-isolated-storage.

Parametry
disableIsolatedStorage boolean

Zwraca
DeviceTestRunOptions

setDisableRestart

public DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-restart”.

Parametry
disableRestart boolean

Zwraca
DeviceTestRunOptions

setDisableTestApiCheck

public DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-test-api-access”.

Parametry
disableTestApiCheck boolean

Zwraca
DeviceTestRunOptions

setDisableWindowAnimation

public DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--no-window-animation”.

Parametry
disableWindowAnimation boolean

Zwraca
DeviceTestRunOptions

setForceQueryable

public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Ustawia wartość false, jeśli nie można wysyłać zapytań o plik APK do zainstalowania.

Parametry
forceQueryable boolean

Zwraca
DeviceTestRunOptions

setGrantPermission

public DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Przyznaje uprawnienia do instalowania plików APK.

Parametry
grantPermission boolean

Zwraca
DeviceTestRunOptions

setInstallArgs

public DeviceTestRunOptions setInstallArgs (String... installArgs)

Ustawia dodatkowe opcje polecenia instalacji.

Parametry
installArgs String

Zwraca
DeviceTestRunOptions

setInstrumentInPcc

public DeviceTestRunOptions setInstrumentInPcc (boolean instrumentInPcc)

Określa, czy do polecenia „am instrument” używanego po stronie hosta ma być dodawany argument „--instrument-in-pcc”.

Parametry
instrumentInPcc boolean

Zwraca
DeviceTestRunOptions

setMaxInstrumentationTimeoutMs

public DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

Ustawia maksymalny czas (w milisekundach), w którym cała instrumentacja musi zostać uruchomiona i zakończona. Ustaw wartość 0, aby wyłączyć limit czasu. Opcjonalnie.

Parametry
maxInstrumentationTimeoutMs Long

Zwraca
DeviceTestRunOptions

setMaxTimeToOutputMs

public DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

Określa maksymalny czas (w milisekundach), przez jaki instrumentacja może przestać generować dane wyjściowe, zanim zostanie zatrzymana. Ustaw wartość 0, aby wyłączyć limit czasu. Opcjonalnie.

Parametry
maxTimeToOutputMs Long

Zwraca
DeviceTestRunOptions

setRunner

public DeviceTestRunOptions setRunner (String runner)

Ustawia narzędzie do uruchamiania instrumentacji, które ma być używane do uruchamiania instrumentacji. Domyślny program uruchamiający to „android.support.test.runner.AndroidJUnitRunner”. Opcjonalnie.

Parametry
runner String

Zwraca
DeviceTestRunOptions

setTestClassName

public DeviceTestRunOptions setTestClassName (String testClassName)

Ustawia nazwę klasy, w której ma być uruchomione narzędzie. Instrumentacja zostanie przefiltrowana, aby uruchomić tylko klasę. Może być używany z setTestMethodName(String). Opcjonalnie.

Parametry
testClassName String

Zwraca
DeviceTestRunOptions

setTestMethodName

public DeviceTestRunOptions setTestMethodName (String testMethodName)

Ustawia nazwę metody, którą ma uruchomić instrumentacja. Aby działać prawidłowo, wymaga ustawienia wartości setTestClassName(String). Opcjonalnie.

Parametry
testMethodName String

Zwraca
DeviceTestRunOptions

setTestTimeoutMs

public DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

Określa maksymalny czas (w milisekundach), przez jaki test może być uruchomiony, zanim zostanie przerwany. Ustaw wartość 0, aby wyłączyć limit czasu. Opcjonalnie.

Parametry
testTimeoutMs Long

Zwraca
DeviceTestRunOptions

setUserId

public DeviceTestRunOptions setUserId (Integer userId)

Ustawia identyfikator użytkownika, na podstawie którego ma działać instrumentacja. Opcjonalnie.

Parametry
userId Integer

Zwraca
DeviceTestRunOptions

shouldCheckResults

public boolean shouldCheckResults ()

Zwraca
boolean