Opcje urządzeniaTestRun

public class DeviceTestRunOptions
extends Object

Obiekt Java.lang.Object
com.android.tradefed.testtype.junit4.DeviceTestRunOptions


Klasa konstruktora opcji związanych z uruchamianiem testów urządzeń za pomocą BaseHostJUnit4Test.

Streszczenie

Konstruktorzy publiczni

DeviceTestRunOptions (String packageName)

Metody publiczne

DeviceTestRunOptions addExtraListener ( ITestLifeCycleReceiver listener)

Dodaj dodatkowego słuchacza 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ą addInstrumentationArg(String, String) .

String getApkFileName ()

Zwraca nazwę pliku apk do instalacji apk.

ITestDevice getDevice ()
getExtraListeners ()
String[] getInstallArgs ()

Zwraca dodatkowe opcje polecenia install.

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

Należy zapytać, czy apk ma zostać zainstalowany.

boolean isGrantPermission ()

Określa, czy udzielić uprawnień do instalacji apk.

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

Ustawia nazwę pliku apk do instalacji apk.

DeviceTestRunOptions setCheckResults (boolean checkResults)

Ustawia, czy należy sprawdzić wyniki przebiegu oprzyrządowania i upewnić się, że nie wystąpiły żadne awarie.

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

ustawia, czy dodać kontrole --no-hidden-api-check do instrumentu am używanego po stronie hosta.

DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

ustawia, czy dodać --no-isolated-storage do instrumentu am' używanego po stronie hosta.

DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Ustawia, czy dodać --no-restart do instrumentu am używanego po stronie hosta.

DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

określa, czy dodać opcję --no-test-api-access do instrumentu am używanego po stronie hosta.

DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

ustawia, czy dodać animację --no-window-animację do instrumentu am używanego po stronie hosta.

DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Ustawia wartość false , jeśli apk, który ma zostać zainstalowany, nie powinien podlegać zapytaniom.

DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Przyznaje uprawnienia do instalacji apk.

DeviceTestRunOptions setInstallArgs (String... installArgs)

Ustawia dodatkowe opcje polecenia install.

DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

Ustawia maksymalny czas (w milisekundach), przez jaki całe oprzyrządowanie będzie musiało działać i zostać ukończone.

DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

Ustawia maksymalny czas (w milisekundach), przez który oprzyrządowanie może przestać wysyłać sygnał, zanim zostanie zatrzymany.

DeviceTestRunOptions setRunner (String runner)

Ustawia moduł wykonawczy oprzyrządowania, który powinien być używany do uruchamiania oprzyrządowania.

DeviceTestRunOptions setTestClassName (String testClassName)

Ustawia nazwę klasy, w której powinna działać instrumentacja.

DeviceTestRunOptions setTestMethodName (String testMethodName)

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

DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

Ustawia maksymalny czas (w milisekundach), przez który test może zostać uruchomiony, zanim zostanie przerwany.

DeviceTestRunOptions setUserId (Integer userId)

Ustawia identyfikator użytkownika, względem którego powinna działać instrumentacja.

boolean shouldCheckResults ()

Konstruktorzy publiczni

Opcje urządzeniaTestRun

public DeviceTestRunOptions (String packageName)

Parametry
packageName String

Metody publiczne

dodajExtraListener

public DeviceTestRunOptions addExtraListener (ITestLifeCycleReceiver listener)

Dodaj dodatkowego słuchacza do uruchamianego instrumentu.

Parametry
listener ITestLifeCycleReceiver

Zwroty
DeviceTestRunOptions

dodajInstrumentationArg

public DeviceTestRunOptions addInstrumentationArg (String key, 
                String value)

Dodaj argument, który zostanie przekazany do instrumentacji.

Parametry
key String

value String

Zwroty
DeviceTestRunOptions

clearExtraListeners

public void clearExtraListeners ()

clearInstrumentationArgs

public void clearInstrumentationArgs ()

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

pobierz nazwę pliku aplikacji

public String getApkFileName ()

Zwraca nazwę pliku apk do instalacji apk.

Zwroty
String

pobierz urządzenie

public ITestDevice getDevice ()

Zwroty
ITestDevice

zdobądź dodatkowych słuchaczy

public  getExtraListeners ()

Zwroty

pobierzInstallArgs

public String[] getInstallArgs ()

Zwraca dodatkowe opcje polecenia install.

Zwroty
String[]

getInstrumentationArgs

public  getInstrumentationArgs ()

Zwroty

getMaxInstrumentationTimeoutMs

public Long getMaxInstrumentationTimeoutMs ()

Zwroty
Long

getMaxTimeToOutputMs

public Long getMaxTimeToOutputMs ()

Zwroty
Long

pobierz nazwę pakietu

public String getPackageName ()

Zwroty
String

getRunner

public String getRunner ()

Zwroty
String

pobierz nazwę klasy testowej

public String getTestClassName ()

Zwroty
String

pobierz nazwę metody testowej

public String getTestMethodName ()

Zwroty
String

getTestTimeoutMs

public Long getTestTimeoutMs ()

Zwroty
Long

pobierzIdUżytkownika

public Integer getUserId ()

Zwroty
Integer

jestForceQueryable

public boolean isForceQueryable ()

Należy zapytać, czy apk ma zostać zainstalowany. Wartość domyślna to true.

Zwroty
boolean

jestGrantPermission

public boolean isGrantPermission ()

Określa, czy udzielić uprawnień do instalacji apk.

Zwroty
boolean

isHiddenApiCheckDisabled

public boolean isHiddenApiCheckDisabled ()

Zwroty
boolean

isIsolatedStorageDisabled

public boolean isIsolatedStorageDisabled ()

Zwroty
boolean

isRestartDisabled

public boolean isRestartDisabled ()

Zwroty
boolean

isTestApiCheckWyłączone

public boolean isTestApiCheckDisabled ()

Zwroty
boolean

isWindowAnimationWyłączone

public boolean isWindowAnimationDisabled ()

Zwroty
boolean

ustawNazwęPlikuApk

public DeviceTestRunOptions setApkFileName (String apkFileName)

Ustawia nazwę pliku apk do instalacji apk.

Parametry
apkFileName String

Zwroty
DeviceTestRunOptions

setCheckResults

public DeviceTestRunOptions setCheckResults (boolean checkResults)

Ustawia, czy należy sprawdzić wyniki przebiegu oprzyrządowania i upewnić się, że nie wystąpiły żadne awarie.

Parametry
checkResults boolean

Zwroty
DeviceTestRunOptions

ustaw urządzenie

public DeviceTestRunOptions setDevice (ITestDevice device)

Parametry
device ITestDevice

Zwroty
DeviceTestRunOptions

setDisableHiddenApiCheck

public DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)

ustawia, czy dodać kontrole --no-hidden-api-check do instrumentu am używanego po stronie hosta.

Parametry
disableHiddenApiCheck boolean

Zwroty
DeviceTestRunOptions

setDisableIsolatedStorage

public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

ustawia, czy dodać --no-isolated-storage do instrumentu am' używanego po stronie hosta.

Parametry
disableIsolatedStorage boolean

Zwroty
DeviceTestRunOptions

setDisableRestart

public DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Ustawia, czy dodać --no-restart do instrumentu am używanego po stronie hosta.

Parametry
disableRestart boolean

Zwroty
DeviceTestRunOptions

setDisableTestApiCheck

public DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

określa, czy dodać opcję --no-test-api-access do instrumentu am używanego po stronie hosta.

Parametry
disableTestApiCheck boolean

Zwroty
DeviceTestRunOptions

setDisableWindowAnimation

public DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

ustawia, czy dodać animację --no-window-animację do instrumentu am używanego po stronie hosta.

Parametry
disableWindowAnimation boolean

Zwroty
DeviceTestRunOptions

setForceQueryable

public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Ustawia wartość false , jeśli apk, który ma zostać zainstalowany, nie powinien podlegać zapytaniom.

Parametry
forceQueryable boolean

Zwroty
DeviceTestRunOptions

ustawGrantPermission

public DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Przyznaje uprawnienia do instalacji apk.

Parametry
grantPermission boolean

Zwroty
DeviceTestRunOptions

ustawInstallArgs

public DeviceTestRunOptions setInstallArgs (String... installArgs)

Ustawia dodatkowe opcje polecenia install.

Parametry
installArgs String

Zwroty
DeviceTestRunOptions

setMaxInstrumentationTimeoutMs

public DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

Ustawia maksymalny czas (w milisekundach), przez jaki całe oprzyrządowanie będzie musiało działać i zostać ukończone. Ustaw na 0, aby nie przekroczyć limitu czasu. Opcjonalny.

Parametry
maxInstrumentationTimeoutMs Long

Zwroty
DeviceTestRunOptions

setMaxTimeToOutputMs

public DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

Ustawia maksymalny czas (w milisekundach), przez który oprzyrządowanie może przestać wysyłać sygnał, zanim zostanie zatrzymany. Ustaw na 0, aby nie przekroczyć limitu czasu. Opcjonalny.

Parametry
maxTimeToOutputMs Long

Zwroty
DeviceTestRunOptions

setRunner

public DeviceTestRunOptions setRunner (String runner)

Ustawia moduł wykonawczy oprzyrządowania, który powinien być używany do uruchamiania oprzyrządowania. Domyślnym modułem uruchamiającym jest „android.support.test.runner.AndroidJUnitRunner”. Opcjonalny.

Parametry
runner String

Zwroty
DeviceTestRunOptions

setNazwaKlasyTestowej

public DeviceTestRunOptions setTestClassName (String testClassName)

Ustawia nazwę klasy, w której powinna działać instrumentacja. Instrumentacja zostanie odfiltrowana w celu uruchomienia tylko zajęć. Można go używać z setTestMethodName(String) . Opcjonalny.

Parametry
testClassName String

Zwroty
DeviceTestRunOptions

setNazwaMetody Testowej

public DeviceTestRunOptions setTestMethodName (String testMethodName)

Ustawia nazwę metody, którą powinna uruchomić instrumentacja. Aby działać poprawnie, wymaga ustawienia setTestClassName(String) . Opcjonalny.

Parametry
testMethodName String

Zwroty
DeviceTestRunOptions

setTestTimeoutMs

public DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

Ustawia maksymalny czas (w milisekundach), przez który test może zostać uruchomiony, zanim zostanie przerwany. Ustaw na 0, aby nie przekroczyć limitu czasu. Opcjonalny.

Parametry
testTimeoutMs Long

Zwroty
DeviceTestRunOptions

ustawIdUżytkownika

public DeviceTestRunOptions setUserId (Integer userId)

Ustawia identyfikator użytkownika, względem którego powinna działać instrumentacja. Opcjonalny.

Parametry
userId Integer

Zwroty
DeviceTestRunOptions

powinienSprawdzićWyniki

public boolean shouldCheckResults ()

Zwroty
boolean