DeviceTestRunOptions

public class DeviceTestRunOptions
extends Object

java.lang.Objeto
com.android.tradefed.testtype.junit4.DeviceTestRunOptions


Una clase de generador para opciones relacionadas con la ejecución de pruebas de dispositivos a través de BaseHostJUnit4Test.

Resumen

Constructores públicos

DeviceTestRunOptions (String packageName)

Métodos públicos

DeviceTestRunOptions addExtraListener ( ITestLifeCycleReceiver listener)

Agregue un oyente adicional a la instrumentación que se está ejecutando.

DeviceTestRunOptions addInstrumentationArg (String key, String value)

Agregue un argumento que se pasará a la instrumentación.

void clearExtraListeners ()
void clearInstrumentationArgs ()

Borre todos los argumentos de instrumentación que se hayan establecido con addInstrumentationArg(String, String) anteriormente.

String getApkFileName ()

Devuelve el nombre del archivo apk para la instalación de apk.

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

Devuelve opciones adicionales del comando de instalación.

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

Si el apk que se instalará debe ser consultable o no.

boolean isGrantPermission ()

Ya sea para otorgar permisos para la instalación de apk.

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

Establece el nombre del archivo apk para la instalación de apk.

DeviceTestRunOptions setCheckResults (boolean checkResults)

Establece si se deben verificar o no los resultados de la ejecución de la instrumentación y garantizar que no se produzcan fallas.

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

establece si agregar o no --no-hidden-api-checks al 'instrumento am' utilizado desde el lado del host.

DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

establece si agregar o no --no-isolated-storage al 'instrumento am' utilizado desde el lado del host.

DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Establece si agregar o no --no-restart al 'instrumento am' utilizado desde el lado del host.

DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

establece si agregar o no --no-test-api-access al 'instrumento am' utilizado desde el lado del host.

DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

establece si agregar o no --no-window-animation al 'instrumento am' utilizado desde el lado del host.

DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Establece false si el apk que se instalará no debe ser consultable.

DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Otorga permisos para la instalación de apk.

DeviceTestRunOptions setInstallArgs (String... installArgs)

Establece opciones adicionales del comando de instalación.

DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

Establece el tiempo máximo (en milisegundos) que tendrá la instrumentación completa para ejecutarse y completarse.

DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

Establece el tiempo máximo (en milisegundos) que la instrumentación puede dejar de generar antes de detenerse.

DeviceTestRunOptions setRunner (String runner)

Establece el ejecutor de instrumentación que debe usarse para ejecutar la instrumentación.

DeviceTestRunOptions setTestClassName (String testClassName)

Establece el nombre de clase que debe ejecutar la instrumentación.

DeviceTestRunOptions setTestMethodName (String testMethodName)

Establece el nombre del método que debe ejecutar la instrumentación.

DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

Establece el tiempo máximo (en milisegundos) que puede ejecutarse una prueba antes de ser interrumpida.

DeviceTestRunOptions setUserId (Integer userId)

Establece el ID de usuario con el que se debe ejecutar la instrumentación.

boolean shouldCheckResults ()

Constructores públicos

DeviceTestRunOptions

public DeviceTestRunOptions (String packageName)

Parámetros
packageName String

Métodos públicos

añadirExtraListener

public DeviceTestRunOptions addExtraListener (ITestLifeCycleReceiver listener)

Agregue un oyente adicional a la instrumentación que se está ejecutando.

Parámetros
listener ITestLifeCycleReceiver

Devoluciones
DeviceTestRunOptions

addInstrumentationArg

public DeviceTestRunOptions addInstrumentationArg (String key, 
                String value)

Agregue un argumento que se pasará a la instrumentación.

Parámetros
key String

value String

Devoluciones
DeviceTestRunOptions

clearExtraListeners

public void clearExtraListeners ()

clearInstrumentationArgs

public void clearInstrumentationArgs ()

Borre todos los argumentos de instrumentación que se hayan establecido con addInstrumentationArg(String, String) anteriormente.

getApkFileName

public String getApkFileName ()

Devuelve el nombre del archivo apk para la instalación de apk.

Devoluciones
String

obtenerDispositivo

public ITestDevice getDevice ()

Devoluciones
ITestDevice

getExtraListeners

public  getExtraListeners ()

Devoluciones

getInstallArgs

public String[] getInstallArgs ()

Devuelve opciones adicionales del comando de instalación.

Devoluciones
String[]

getInstrumentationArgs

public  getInstrumentationArgs ()

Devoluciones

getMaxInstrumentationTimeoutMs

public Long getMaxInstrumentationTimeoutMs ()

Devoluciones
Long

getMaxTimeToOutputMs

public Long getMaxTimeToOutputMs ()

Devoluciones
Long

getPackageName

public String getPackageName ()

Devoluciones
String

getRunner

public String getRunner ()

Devoluciones
String

getTestClassName

public String getTestClassName ()

Devoluciones
String

getTestMethodName

public String getTestMethodName ()

Devoluciones
String

getTestTimeoutMs

public Long getTestTimeoutMs ()

Devoluciones
Long

obtener ID de usuario

public Integer getUserId ()

Devoluciones
Integer

esForceQueryable

public boolean isForceQueryable ()

Si el apk que se instalará debe ser consultable o no. El valor por defecto es verdadero.

Devoluciones
boolean

esGrantPermiso

public boolean isGrantPermission ()

Ya sea para otorgar permisos para la instalación de apk.

Devoluciones
boolean

isHiddenApiCheckDisabled

public boolean isHiddenApiCheckDisabled ()

Devoluciones
boolean

isIsolatedStorageDisabled

public boolean isIsolatedStorageDisabled ()

Devoluciones
boolean

isRestartDisabled

public boolean isRestartDisabled ()

Devoluciones
boolean

isTestApiCheckDisabled

public boolean isTestApiCheckDisabled ()

Devoluciones
boolean

isWindowAnimationDisabled

public boolean isWindowAnimationDisabled ()

Devoluciones
boolean

establecerApkFileName

public DeviceTestRunOptions setApkFileName (String apkFileName)

Establece el nombre del archivo apk para la instalación de apk.

Parámetros
apkFileName String

Devoluciones
DeviceTestRunOptions

setCheckResults

public DeviceTestRunOptions setCheckResults (boolean checkResults)

Establece si se deben verificar o no los resultados de la ejecución de la instrumentación y garantizar que no se produzcan fallas.

Parámetros
checkResults boolean

Devoluciones
DeviceTestRunOptions

establecer dispositivo

public DeviceTestRunOptions setDevice (ITestDevice device)

Parámetros
device ITestDevice

Devoluciones
DeviceTestRunOptions

setDisableHiddenApiCheck

public DeviceTestRunOptions setDisableHiddenApiCheck (boolean disableHiddenApiCheck)

establece si agregar o no --no-hidden-api-checks al 'instrumento am' utilizado desde el lado del host.

Parámetros
disableHiddenApiCheck boolean

Devoluciones
DeviceTestRunOptions

setDisableIsolatedStorage

public DeviceTestRunOptions setDisableIsolatedStorage (boolean disableIsolatedStorage)

establece si agregar o no --no-isolated-storage al 'instrumento am' utilizado desde el lado del host.

Parámetros
disableIsolatedStorage boolean

Devoluciones
DeviceTestRunOptions

setDisableRestart

public DeviceTestRunOptions setDisableRestart (boolean disableRestart)

Establece si agregar o no --no-restart al 'instrumento am' utilizado desde el lado del host.

Parámetros
disableRestart boolean

Devoluciones
DeviceTestRunOptions

setDisableTestApiCheck

public DeviceTestRunOptions setDisableTestApiCheck (boolean disableTestApiCheck)

establece si agregar o no --no-test-api-access al 'instrumento am' utilizado desde el lado del host.

Parámetros
disableTestApiCheck boolean

Devoluciones
DeviceTestRunOptions

setDisableWindowAnimation

public DeviceTestRunOptions setDisableWindowAnimation (boolean disableWindowAnimation)

establece si agregar o no --no-window-animation al 'instrumento am' utilizado desde el lado del host.

Parámetros
disableWindowAnimation boolean

Devoluciones
DeviceTestRunOptions

setForceQueryable

public DeviceTestRunOptions setForceQueryable (boolean forceQueryable)

Establece false si el apk que se instalará no debe ser consultable.

Parámetros
forceQueryable boolean

Devoluciones
DeviceTestRunOptions

establecerGrantPermission

public DeviceTestRunOptions setGrantPermission (boolean grantPermission)

Otorga permisos para la instalación de apk.

Parámetros
grantPermission boolean

Devoluciones
DeviceTestRunOptions

establecerArgs de instalación

public DeviceTestRunOptions setInstallArgs (String... installArgs)

Establece opciones adicionales del comando de instalación.

Parámetros
installArgs String

Devoluciones
DeviceTestRunOptions

setMaxInstrumentationTimeoutMs

public DeviceTestRunOptions setMaxInstrumentationTimeoutMs (Long maxInstrumentationTimeoutMs)

Establece el tiempo máximo (en milisegundos) que tendrá la instrumentación completa para ejecutarse y completarse. Establecer en 0 para ningún tiempo de espera. Opcional.

Parámetros
maxInstrumentationTimeoutMs Long

Devoluciones
DeviceTestRunOptions

establecerMaxTimeToOutputMs

public DeviceTestRunOptions setMaxTimeToOutputMs (Long maxTimeToOutputMs)

Establece el tiempo máximo (en milisegundos) que la instrumentación puede dejar de generar antes de detenerse. Establecer en 0 para ningún tiempo de espera. Opcional.

Parámetros
maxTimeToOutputMs Long

Devoluciones
DeviceTestRunOptions

conjuntoCorredor

public DeviceTestRunOptions setRunner (String runner)

Establece el ejecutor de instrumentación que debe usarse para ejecutar la instrumentación. El corredor predeterminado es 'android.support.test.runner.AndroidJUnitRunner'. Opcional.

Parámetros
runner String

Devoluciones
DeviceTestRunOptions

setTestClassName

public DeviceTestRunOptions setTestClassName (String testClassName)

Establece el nombre de clase que debe ejecutar la instrumentación. La instrumentación se filtrará para ejecutar solo la clase. Se puede usar con setTestMethodName(String) . Opcional.

Parámetros
testClassName String

Devoluciones
DeviceTestRunOptions

setTestMethodName

public DeviceTestRunOptions setTestMethodName (String testMethodName)

Establece el nombre del método que debe ejecutar la instrumentación. Requiere establecer setTestClassName(String) para que funcione correctamente. Opcional.

Parámetros
testMethodName String

Devoluciones
DeviceTestRunOptions

establecerTestTimeoutMs

public DeviceTestRunOptions setTestTimeoutMs (Long testTimeoutMs)

Establece el tiempo máximo (en milisegundos) que puede ejecutarse una prueba antes de ser interrumpida. Establecer en 0 para ningún tiempo de espera. Opcional.

Parámetros
testTimeoutMs Long

Devoluciones
DeviceTestRunOptions

establecer ID de usuario

public DeviceTestRunOptions setUserId (Integer userId)

Establece el ID de usuario con el que se debe ejecutar la instrumentación. Opcional.

Parámetros
userId Integer

Devoluciones
DeviceTestRunOptions

deberíaverificar resultados

public boolean shouldCheckResults ()

Devoluciones
boolean