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 listener aggiuntivo all'instrumentazione 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 |
String
|
getApkFileName()
Restituisce il nome del file APK per l'installazione dell'APK. |
ITestDevice
|
getDevice()
|
List<ITestLifeCycleReceiver>
|
getExtraListeners()
|
String[]
|
getInstallArgs()
Restituisce opzioni aggiuntive del comando di installazione. |
Map<String, String>
|
getInstrumentationArgs()
|
Long
|
getMaxInstrumentationTimeoutMs()
|
Long
|
getMaxTimeToOutputMs()
|
String
|
getPackageName()
|
String
|
getRunner()
|
String
|
getTestClassName()
|
String
|
getTestMethodName()
|
Long
|
getTestTimeoutMs()
|
Integer
|
getUserId()
|
boolean
|
isForceQueryable()
Indica se è possibile eseguire query sull'apk da installare. |
boolean
|
isGrantPermission()
Se concedere le autorizzazioni per l'installazione dell'APK. |
boolean
|
isHiddenApiCheckDisabled()
|
boolean
|
isInstrumentInPcc()
Indica se aggiungere o meno --instrument-in-pcc a "am instrument" utilizzato dal lato host. |
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)
Specifica se i risultati dell'esecuzione della strumentazione devono essere controllati e garantisce che non si siano verificati errori. |
DeviceTestRunOptions
|
setDevice(ITestDevice device)
|
DeviceTestRunOptions
|
setDisableHiddenApiCheck(boolean disableHiddenApiCheck)
imposta se aggiungere o meno --no-hidden-api-checks allo strumento "am" utilizzato dal lato host. |
DeviceTestRunOptions
|
setDisableIsolatedStorage(boolean disableIsolatedStorage)
imposta se aggiungere o meno --no-isolated-storage ad "am instrument" 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 --no-test-api-access ad "am instrument" utilizzato dal lato host. |
DeviceTestRunOptions
|
setDisableWindowAnimation(boolean disableWindowAnimation)
imposta se aggiungere o meno --no-window-animation a "am instrument" utilizzato dal lato host. |
DeviceTestRunOptions
|
setForceQueryable(boolean forceQueryable)
Imposta |
DeviceTestRunOptions
|
setGrantPermission(boolean grantPermission)
Concede le autorizzazioni per l'installazione dell'APK. |
DeviceTestRunOptions
|
setInstallArgs(String... installArgs)
Imposta opzioni aggiuntive del comando di installazione. |
DeviceTestRunOptions
|
setInstrumentInPcc(boolean instrumentInPcc)
Specifica se aggiungere o meno --instrument-in-pcc allo strumento "am" utilizzato dal lato host. |
DeviceTestRunOptions
|
setMaxInstrumentationTimeoutMs(Long maxInstrumentationTimeoutMs)
Imposta il tempo massimo (in millisecondi) per l'esecuzione e il completamento dell'instrumentazione completa. |
DeviceTestRunOptions
|
setMaxTimeToOutputMs(Long maxTimeToOutputMs)
Imposta il tempo massimo (in millisecondi) in cui la strumentazione può interrompere l'output prima di essere interrotta. |
DeviceTestRunOptions
|
setRunner(String runner)
Imposta il runner di strumentazione da utilizzare per eseguire la strumentazione. |
DeviceTestRunOptions
|
setTestClassName(String testClassName)
Imposta il nome della classe in cui deve essere eseguita la strumentazione. |
DeviceTestRunOptions
|
setTestMethodName(String testMethodName)
Imposta il nome del metodo in cui deve essere eseguita la strumentazione. |
DeviceTestRunOptions
|
setTestTimeoutMs(Long testTimeoutMs)
Imposta il tempo massimo (in millisecondi) per cui un test può essere eseguito prima di essere interrotto. |
DeviceTestRunOptions
|
setUserId(Integer userId)
Imposta l'ID utente in base al quale deve essere eseguita la strumentazione. |
boolean
|
shouldCheckResults()
|
Costruttori pubblici
DeviceTestRunOptions
public DeviceTestRunOptions (String packageName)
| Parametri | |
|---|---|
packageName |
String |
Metodi pubblici
addExtraListener
public DeviceTestRunOptions addExtraListener (ITestLifeCycleReceiver listener)
Aggiungi un listener aggiuntivo all'instrumentazione in esecuzione.
| Parametri | |
|---|---|
listener |
ITestLifeCycleReceiver |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
addInstrumentationArg
public DeviceTestRunOptions addInstrumentationArg (String key, String value)
Aggiungi un argomento che verrà passato alla strumentazione.
| Parametri | |
|---|---|
key |
String |
value |
String |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
clearExtraListeners
public void clearExtraListeners ()
clearInstrumentationArgs
public void clearInstrumentationArgs ()
Cancella tutti gli argomenti di strumentazione impostati in precedenza con addInstrumentationArg(String,String).
getApkFileName
public String getApkFileName ()
Restituisce il nome del file APK per l'installazione dell'APK.
| Resi | |
|---|---|
String |
|
getExtraListeners
public List<ITestLifeCycleReceiver> getExtraListeners ()
| Resi | |
|---|---|
List<ITestLifeCycleReceiver> |
|
getInstallArgs
public String[] getInstallArgs ()
Restituisce opzioni aggiuntive del comando di installazione.
| Resi | |
|---|---|
String[] |
|
getInstrumentationArgs
public Map<String, String> getInstrumentationArgs ()
| Resi | |
|---|---|
Map<String, String> |
|
getMaxInstrumentationTimeoutMs
public Long getMaxInstrumentationTimeoutMs ()
| Resi | |
|---|---|
Long |
|
getMaxTimeToOutputMs
public Long getMaxTimeToOutputMs ()
| Resi | |
|---|---|
Long |
|
getPackageName
public String getPackageName ()
| Resi | |
|---|---|
String |
|
getRunner
public String getRunner ()
| Resi | |
|---|---|
String |
|
getTestClassName
public String getTestClassName ()
| Resi | |
|---|---|
String |
|
getTestMethodName
public String getTestMethodName ()
| Resi | |
|---|---|
String |
|
getTestTimeoutMs
public Long getTestTimeoutMs ()
| Resi | |
|---|---|
Long |
|
getUserId
public Integer getUserId ()
| Resi | |
|---|---|
Integer |
|
isForceQueryable
public boolean isForceQueryable ()
Indica se è possibile eseguire query sull'apk da installare. Il valore predefinito è true.
| Resi | |
|---|---|
boolean |
|
isGrantPermission
public boolean isGrantPermission ()
Se concedere le autorizzazioni per l'installazione dell'APK.
| Resi | |
|---|---|
boolean |
|
isHiddenApiCheckDisabled
public boolean isHiddenApiCheckDisabled ()
| Resi | |
|---|---|
boolean |
|
isInstrumentInPcc
public boolean isInstrumentInPcc ()
Indica se aggiungere o meno --instrument-in-pcc a "am instrument" utilizzato dal lato host.
| Resi | |
|---|---|
boolean |
|
isIsolatedStorageDisabled
public boolean isIsolatedStorageDisabled ()
| Resi | |
|---|---|
boolean |
|
isRestartDisabled
public boolean isRestartDisabled ()
| Resi | |
|---|---|
boolean |
|
isTestApiCheckDisabled
public boolean isTestApiCheckDisabled ()
| Resi | |
|---|---|
boolean |
|
isWindowAnimationDisabled
public boolean isWindowAnimationDisabled ()
| Resi | |
|---|---|
boolean |
|
setApkFileName
public DeviceTestRunOptions setApkFileName (String apkFileName)
Imposta il nome del file APK per l'installazione dell'APK.
| Parametri | |
|---|---|
apkFileName |
String |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setCheckResults
public DeviceTestRunOptions setCheckResults (boolean checkResults)
Specifica se i risultati dell'esecuzione della strumentazione devono essere controllati e garantisce che non si siano verificati errori.
| Parametri | |
|---|---|
checkResults |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setDevice
public DeviceTestRunOptions setDevice (ITestDevice device)
| Parametri | |
|---|---|
device |
ITestDevice |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setDisableHiddenApiCheck
public DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)
imposta se aggiungere o meno --no-hidden-api-checks a "am instrument" utilizzato dal lato host.
| Parametri | |
|---|---|
disableHiddenApiCheck |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setDisableIsolatedStorage
public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)
imposta se aggiungere o meno --no-isolated-storage ad "am instrument" utilizzato dal lato host.
| Parametri | |
|---|---|
disableIsolatedStorage |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setDisableRestart
public DeviceTestRunOptions setDisableRestart (boolean disableRestart)
Imposta se aggiungere o meno --no-restart allo strumento "am" utilizzato dal lato host.
| Parametri | |
|---|---|
disableRestart |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setDisableTestApiCheck
public DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)
imposta se aggiungere o meno --no-test-api-access ad "am instrument" utilizzato dal lato host.
| Parametri | |
|---|---|
disableTestApiCheck |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setDisableWindowAnimation
public DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)
imposta se aggiungere o meno --no-window-animation a "am instrument" utilizzato dal lato host.
| Parametri | |
|---|---|
disableWindowAnimation |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setForceQueryable
public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)
Imposta false se non è possibile eseguire query sull'APK da installare.
| Parametri | |
|---|---|
forceQueryable |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setGrantPermission
public DeviceTestRunOptions setGrantPermission (boolean grantPermission)
Concede le autorizzazioni per l'installazione dell'APK.
| Parametri | |
|---|---|
grantPermission |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setInstallArgs
public DeviceTestRunOptions setInstallArgs (String... installArgs)
Imposta opzioni aggiuntive del comando di installazione.
| Parametri | |
|---|---|
installArgs |
String |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setInstrumentInPcc
public DeviceTestRunOptions setInstrumentInPcc (boolean instrumentInPcc)
Specifica se aggiungere o meno --instrument-in-pcc allo strumento "am" utilizzato dal lato host.
| Parametri | |
|---|---|
instrumentInPcc |
boolean |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setMaxInstrumentationTimeoutMs
public DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)
Imposta il tempo massimo (in millisecondi) per l'esecuzione e il completamento dell'instrumentazione completa. Imposta questo valore su 0 per non specificare un timeout. Facoltativo.
| Parametri | |
|---|---|
maxInstrumentationTimeoutMs |
Long |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setMaxTimeToOutputMs
public DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)
Imposta il tempo massimo (in millisecondi) in cui la strumentazione può interrompere l'output prima di essere interrotta. Imposta questo valore su 0 per non specificare un timeout. Facoltativo.
| Parametri | |
|---|---|
maxTimeToOutputMs |
Long |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setRunner
public DeviceTestRunOptions setRunner (String runner)
Imposta il runner di strumentazione da utilizzare per eseguire la strumentazione. Il runner predefinito è 'android.support.test.runner.AndroidJUnitRunner'. Facoltativo.
| Parametri | |
|---|---|
runner |
String |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setTestClassName
public DeviceTestRunOptions setTestClassName (String testClassName)
Imposta il nome della classe in cui deve essere eseguita la strumentazione. La strumentazione verrà filtrata
per eseguire solo la classe. Può essere utilizzato con setTestMethodName(String). Facoltativo.
| Parametri | |
|---|---|
testClassName |
String |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setTestMethodName
public DeviceTestRunOptions setTestMethodName (String testMethodName)
Imposta il nome del metodo in cui deve essere eseguita la strumentazione. Richiede l'impostazione di setTestClassName(String) per funzionare correttamente. Facoltativo.
| Parametri | |
|---|---|
testMethodName |
String |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setTestTimeoutMs
public DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)
Imposta il tempo massimo (in millisecondi) per cui un test può essere eseguito prima di essere interrotto. Imposta questo valore su 0 per nessun timeout. Facoltativo.
| Parametri | |
|---|---|
testTimeoutMs |
Long |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
setUserId
public DeviceTestRunOptions setUserId (Integer userId)
Imposta l'ID utente in base al quale deve essere eseguita la strumentazione. Facoltativo.
| Parametri | |
|---|---|
userId |
Integer |
| Resi | |
|---|---|
DeviceTestRunOptions |
|
shouldCheckResults
public boolean shouldCheckResults ()
| Resi | |
|---|---|
boolean |
|