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 (String packageName)

Metodi pubblici

DeviceTestRunOptions addExtraListener ( ITestLifeCycleReceiver listener)

Aggiungi un ascoltatore aggiuntivo alla strumentazione in esecuzione.

DeviceTestRunOptions addInstrumentationArg (String key, String value)

Aggiungi un argomento che verrà passato alla strumentazione.

void clearExtraListeners ()
void clearInstrumentationArgs ()

Cancella tutti gli argomenti di strumentazione impostati in precedenza con addInstrumentationArg(String, String) .

String getApkFileName ()

Restituisce il nome del file apk per l'installazione dell'apk.

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

Restituisce opzioni aggiuntive del comando install.

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

È possibile interrogarsi se l'apk da installare o meno.

boolean isGrantPermission ()

Se concedere le autorizzazioni per l'installazione dell'apk.

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

Imposta il nome del file apk per l'installazione dell'apk.

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.

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

imposta se aggiungere o meno i controlli --no-hidden-api allo strumento "am" utilizzato dal lato host.

DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

imposta se aggiungere o meno --no-isolated-storage allo "strumento am" utilizzato dal lato host.

DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Imposta se aggiungere o meno --no-restart allo strumento "am" utilizzato dal lato host.

DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

imposta se aggiungere o meno l'accesso --no-test-api allo strumento "am" utilizzato dal lato host.

DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

imposta se aggiungere o meno l'animazione --no-window allo strumento "am" utilizzato dal lato host.

DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Imposta false se l'apk da installare non deve essere interrogabile.

DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Concede le autorizzazioni per l'installazione dell'apk.

DeviceTestRunOptions setInstallArgs (String... installArgs)

Imposta opzioni aggiuntive del comando install.

DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

Imposta il tempo massimo (in millisecondi) che la strumentazione completa dovrà eseguire e completare.

DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

Imposta il tempo massimo (in millisecondi) durante il quale la strumentazione può interrompere l'emissione prima di essere arrestata.

DeviceTestRunOptions setRunner (String runner)

Imposta il corridore della strumentazione da utilizzare per eseguire la strumentazione.

DeviceTestRunOptions setTestClassName (String testClassName)

Imposta il nome della classe che deve essere eseguita dalla strumentazione.

DeviceTestRunOptions setTestMethodName (String testMethodName)

Imposta il nome del metodo che la strumentazione deve eseguire.

DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

Imposta il tempo massimo (in millisecondi) che un test può essere eseguito prima di essere interrotto.

DeviceTestRunOptions setUserId (Integer userId)

Imposta l'ID utente rispetto al quale deve essere eseguita la strumentazione.

boolean shouldCheckResults ()

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

ritorna
DeviceTestRunOptions

aggiungiStrumentazioneArg

public DeviceTestRunOptions addInstrumentationArg (String key, 
                String value)

Aggiungi un argomento che verrà passato alla strumentazione.

Parametri
key String

value String

ritorna
DeviceTestRunOptions

clearExtraListeners

public void clearExtraListeners ()

clearStrumentazioneArgs

public void clearInstrumentationArgs ()

Cancella tutti gli argomenti di strumentazione impostati in precedenza con addInstrumentationArg(String, String) .

getNomeFileApk

public String getApkFileName ()

Restituisce il nome del file apk per l'installazione dell'apk.

ritorna
String

getDevice

public ITestDevice getDevice ()

ritorna
ITestDevice

getExtraListeners

public  getExtraListeners ()

ritorna

getInstallArgs

public String[] getInstallArgs ()

Restituisce opzioni aggiuntive del comando install.

ritorna
String[]

getInstrumentationArgs

public  getInstrumentationArgs ()

ritorna

getMaxInstrumentationTimeoutMs

public Long getMaxInstrumentationTimeoutMs ()

ritorna
Long

getMaxTimeToOutputMs

public Long getMaxTimeToOutputMs ()

ritorna
Long

getNomePacchetto

public String getPackageName ()

ritorna
String

getRunner

public String getRunner ()

ritorna
String

getNomeClasseTest

public String getTestClassName ()

ritorna
String

getNomeMetodoTest

public String getTestMethodName ()

ritorna
String

getTestTimeoutMs

public Long getTestTimeoutMs ()

ritorna
Long

getUserId

public Integer getUserId ()

ritorna
Integer

isForceQueryable

public boolean isForceQueryable ()

È possibile interrogarsi se l'apk da installare o meno. Il valore predefinito è vero.

ritorna
boolean

isGrantPermission

public boolean isGrantPermission ()

Se concedere le autorizzazioni per l'installazione dell'apk.

ritorna
boolean

isHiddenApiCheckDisabled

public boolean isHiddenApiCheckDisabled ()

ritorna
boolean

isIsolatedStorageDisabled

public boolean isIsolatedStorageDisabled ()

ritorna
boolean

isRestartDisabled

public boolean isRestartDisabled ()

ritorna
boolean

isTestApiCheckDisabled

public boolean isTestApiCheckDisabled ()

ritorna
boolean

isWindowAnimationDisabled

public boolean isWindowAnimationDisabled ()

ritorna
boolean

setNomeFileApk

public DeviceTestRunOptions setApkFileName (String apkFileName)

Imposta il nome del file apk per l'installazione dell'apk.

Parametri
apkFileName String

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

setDevice

public DeviceTestRunOptions setDevice (ITestDevice device)

Parametri
device ITestDevice

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

setDisableIsolatedStorage

public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

imposta se aggiungere o meno --no-isolated-storage allo "strumento am" utilizzato dal lato host.

Parametri
disableIsolatedStorage boolean

ritorna
DeviceTestRunOptions

setDisableRestart

public DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Imposta se aggiungere o meno --no-restart allo strumento "am" utilizzato dal lato host.

Parametri
disableRestart boolean

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

setForceQueryable

public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Imposta false se l'apk da installare non deve essere interrogabile.

Parametri
forceQueryable boolean

ritorna
DeviceTestRunOptions

setGrantPermission

public DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Concede le autorizzazioni per l'installazione dell'apk.

Parametri
grantPermission boolean

ritorna
DeviceTestRunOptions

setInstallArgs

public DeviceTestRunOptions setInstallArgs (String... installArgs)

Imposta opzioni aggiuntive del comando install.

Parametri
installArgs String

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

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.

Parametri
runner String

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

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

ritorna
DeviceTestRunOptions

setUserId

public DeviceTestRunOptions setUserId (Integer userId)

Imposta l'ID utente rispetto al quale deve essere eseguita la strumentazione. Opzionale.

Parametri
userId Integer

ritorna
DeviceTestRunOptions

dovrebbeCheckResults

public boolean shouldCheckResults ()

ritorna
boolean