DeviceTestRunOptions
public class DeviceTestRunOptions
extends Object
java.lang.Object |
↳ | com.android.tradefed.testtype.junit4.DeviceTestRunOptions |
Una classe di builder per le opzioni relative all'esecuzione di test del dispositivo tramite BaseHostJUnit4Test.
Riepilogo
Costruttori pubblici
DeviceTestRunOptions
public DeviceTestRunOptions (String packageName)
Parametri |
---|
packageName | String |
Metodi pubblici
aggiungiExtraListener
public DeviceTestRunOptions addExtraListener (ITestLifeCycleReceiver listener)
Aggiungi un ascoltatore aggiuntivo alla strumentazione in esecuzione.
Parametri |
---|
listener | ITestLifeCycleReceiver |
aggiungiStrumentazioneArg
public DeviceTestRunOptions addInstrumentationArg (String key,
String value)
Aggiungi un argomento che verrà passato alla strumentazione.
Parametri |
---|
key | String |
value | String |
public void clearExtraListeners ()
getNomeFileApk
public String getApkFileName ()
Restituisce il nome del file apk per l'installazione dell'apk.
public getExtraListeners ()
getInstallArgs
public String[] getInstallArgs ()
Restituisce opzioni aggiuntive del comando install.
getInstrumentationArgs
public getInstrumentationArgs ()
getMaxInstrumentationTimeoutMs
public Long getMaxInstrumentationTimeoutMs ()
getMaxTimeToOutputMs
public Long getMaxTimeToOutputMs ()
getNomePacchetto
public String getPackageName ()
getRunner
public String getRunner ()
getNomeClasseTest
public String getTestClassName ()
getNomeMetodoTest
public String getTestMethodName ()
getTestTimeoutMs
public Long getTestTimeoutMs ()
getUserId
public Integer getUserId ()
isForceQueryable
public boolean isForceQueryable ()
È possibile interrogarsi se l'apk da installare o meno. Il valore predefinito è vero.
isGrantPermission
public boolean isGrantPermission ()
Se concedere le autorizzazioni per l'installazione dell'apk.
isHiddenApiCheckDisabled
public boolean isHiddenApiCheckDisabled ()
isIsolatedStorageDisabled
public boolean isIsolatedStorageDisabled ()
isRestartDisabled
public boolean isRestartDisabled ()
isTestApiCheckDisabled
public boolean isTestApiCheckDisabled ()
isWindowAnimationDisabled
public boolean isWindowAnimationDisabled ()
setNomeFileApk
public DeviceTestRunOptions setApkFileName (String apkFileName)
Imposta il nome del file apk per l'installazione dell'apk.
Parametri |
---|
apkFileName | String |
setCheckResults
public DeviceTestRunOptions setCheckResults (boolean checkResults)
Imposta se i risultati dell'analisi della strumentazione devono essere controllati o meno per garantire che non si siano verificati guasti.
Parametri |
---|
checkResults | boolean |
setDisableHiddenApiCheck
public DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)
imposta se aggiungere o meno i controlli --no-hidden-api allo strumento "am" utilizzato dal lato host.
Parametri |
---|
disableHiddenApiCheck | boolean |
setDisableIsolatedStorage
public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)
imposta se aggiungere o meno --no-isolated-storage allo "strumento am" utilizzato dal lato host.
Parametri |
---|
disableIsolatedStorage | boolean |
setDisableRestart
public DeviceTestRunOptions setDisableRestart (boolean disableRestart)
Imposta se aggiungere o meno --no-restart allo strumento "am" utilizzato dal lato host.
Parametri |
---|
disableRestart | boolean |
setDisableTestApiCheck
public DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)
imposta se aggiungere o meno l'accesso --no-test-api allo strumento "am" utilizzato dal lato host.
Parametri |
---|
disableTestApiCheck | boolean |
setDisableWindowAnimation
public DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)
imposta se aggiungere o meno l'animazione --no-window allo strumento "am" utilizzato dal lato host.
Parametri |
---|
disableWindowAnimation | boolean |
setForceQueryable
public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)
Imposta false
se l'apk da installare non deve essere interrogabile.
Parametri |
---|
forceQueryable | boolean |
setGrantPermission
public DeviceTestRunOptions setGrantPermission (boolean grantPermission)
Concede le autorizzazioni per l'installazione dell'apk.
Parametri |
---|
grantPermission | boolean |
setInstallArgs
public DeviceTestRunOptions setInstallArgs (String... installArgs)
Imposta opzioni aggiuntive del comando install.
Parametri |
---|
installArgs | String |
setMaxInstrumentationTimeoutMs
public DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)
Imposta il tempo massimo (in millisecondi) che la strumentazione completa dovrà eseguire e completare. Impostato su 0 per nessun timeout. Opzionale.
Parametri |
---|
maxInstrumentationTimeoutMs | Long |
setMaxTimeToOutputMs
public DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)
Imposta il tempo massimo (in millisecondi) durante il quale la strumentazione può interrompere l'emissione prima di essere arrestata. Impostato su 0 per nessun timeout. Opzionale.
Parametri |
---|
maxTimeToOutputMs | Long |
setRunner
public DeviceTestRunOptions setRunner (String runner)
Imposta il corridore della strumentazione da utilizzare per eseguire la strumentazione. Il runner predefinito è "android.support.test.runner.AndroidJUnitRunner". Opzionale.
setNomeClasseTest
public DeviceTestRunOptions setTestClassName (String testClassName)
Imposta il nome della classe che deve essere eseguita dalla strumentazione. La strumentazione verrà filtrata per eseguire solo la lezione. Può essere utilizzato con setTestMethodName(String)
. Opzionale.
Parametri |
---|
testClassName | String |
setNomeMetodoTest
public DeviceTestRunOptions setTestMethodName (String testMethodName)
Imposta il nome del metodo che la strumentazione deve eseguire. Richiede setTestClassName(String)
da impostare per funzionare correttamente. Opzionale.
Parametri |
---|
testMethodName | String |
setTestTimeoutMs
public DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)
Imposta il tempo massimo (in millisecondi) che un test può essere eseguito prima di essere interrotto. Impostato su 0 per nessun timeout. Opzionale.
Parametri |
---|
testTimeoutMs | Long |
setUserId
public DeviceTestRunOptions setUserId (Integer userId)
Imposta l'ID utente rispetto al quale deve essere eseguita la strumentazione. Opzionale.
dovrebbeCheckResults
public boolean shouldCheckResults ()