BaseHostJUnit4Test

public abstract class BaseHostJUnit4Test
extends Object implements IAbiReceiver , ITestInformationReceiver

java.lang.Object
com.android.tradefed.testtype.junit4.BaseHostJUnit4Test


Classe di test di base per l'esecuzione di test di stile JUnit4 dell'host. Questa classe fornisce supporto per l'installazione, l'esecuzione e la pulizia dei test della strumentazione dal lato host. Questa classe è compatibile con più dispositivi. Dovrebbe essere l'unica fonte di verità per eseguire test di strumentazione dal lato host al fine di evitare utilità e classe base duplicate.

Riepilogo

Costruttori pubblici

BaseHostJUnit4Test ()

Metodi pubblici

final void autoTearDown ()

Smontaggio automatico per tutti gli apk installati.

final IAbi getAbi ()
final IBuildInfo getBuild ()
final ITestDevice getDevice ()
final IInvocationContext getInvocationContext ()
final TestRunResult getLastDeviceRunResults ()

Restituisce il TestRunResult risultante dagli ultimi runDeviceTests eseguiti.

final getListDevices ()
TestInformation getTestInformation ()
boolean hasDeviceFeature (String feature)
final void installPackage ( DeviceTestRunOptions options)

Installa un apk basato su DeviceTestRunOptions sul dispositivo.

final void installPackage (String apkFileName, String... options)

Installa un apk con il suo nome sul dispositivo.

final void installPackage ( ITestDevice device, String apkFileName, String... options)

Installa un apk con il suo nome su un determinato dispositivo.

final void installPackageAsUser ( ITestDevice device, String apkFileName, boolean grantPermission, int userId, String... options)

Installa un apk con il suo nome per un utente specifico su un determinato dispositivo.

final void installPackageAsUser (String apkFileName, boolean grantPermission, int userId, String... options)

Installa un apk con il suo nome per un utente specifico.

final boolean isPackageInstalled (String pkg)

Controlla se sul dispositivo è installato un pacchetto con un determinato nome

final boolean isPackageInstalled ( ITestDevice device, String pkg)

Controlla se sul dispositivo è installato un pacchetto con un determinato nome

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, instrumentationArgs, extraListeners)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName, Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, instrumentationArgs) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, instrumentationArgs)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests (String pkgName, String testClassName, String testMethodName)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( DeviceTestRunOptions options)

Esegue la strumentazione in base alle informazioni contenute in DeviceTestRunOptions .

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, boolean isWindowAnimationDisabled, boolean isRestartDisabled, instrumentationArgs, extraListeners)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( ITestDevice device, String pkgName, String testClassName, String testMethodName)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests (String pkgName, String testClassName, Integer userId, Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests (String pkgName, String testClassName)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests (String pkgName, String testClassName, Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners) runDeviceTests ( ITestDevice device, String runner, String pkgName, String testClassName, String testMethodName, Integer userId, Long testTimeoutMs, Long maxTimeToOutputMs, Long maxInstrumentationTimeoutMs, boolean checkResults, boolean isHiddenApiCheckDisabled, boolean isTestApiCheckDisabled, boolean isIsolatedStorageDisabled, instrumentationArgs, extraListeners)

Metodo per eseguire un pacchetto di strumentazione installato.

final boolean runDeviceTests (String runner, String pkgName, String testClassName, String testMethodName)

Metodo per eseguire un pacchetto di strumentazione installato.

final void setAbi ( IAbi abi)
final void setTestInformation ( TestInformation testInformation)
final String uninstallPackage (String pkgName)

Disinstalla un pacchetto sul dispositivo.

final String uninstallPackage ( ITestDevice device, String pkgName)

Disinstalla un pacchetto sul dispositivo

Costruttori pubblici

BaseHostJUnit4Test

public BaseHostJUnit4Test ()

Metodi pubblici

smontaggio automatico

public final void autoTearDown ()

Smontaggio automatico per tutti gli apk installati. Questo disinstallerà tutto l'apk dal dispositivo su cui erano installati.

Lancia
DeviceNotAvailableException

getAbi

public final IAbi getAbi ()

ritorna
IAbi

getBuild

public final IBuildInfo getBuild ()

ritorna
IBuildInfo

getDevice

public final ITestDevice getDevice ()

ritorna
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

ritorna
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

Restituisce il TestRunResult risultante dagli ultimi runDeviceTests eseguiti. Oppure null se non sono disponibili risultati.

ritorna
TestRunResult

getListDevices

public final  getListDevices ()

ritorna

getTestInformation

public TestInformation getTestInformation ()

ritorna
TestInformation

hasDeviceFeature

public boolean hasDeviceFeature (String feature)

Parametri
feature String

ritorna
boolean

Lancia
DeviceNotAvailableException

installPacchetto

public final void installPackage (DeviceTestRunOptions options)

Installa un apk basato su DeviceTestRunOptions sul dispositivo. L'apk verrà pulito automaticamente.

Parametri
options DeviceTestRunOptions : le opzioni di installazione del pacchetto.

Lancia
DeviceNotAvailableException
TargetSetupError

installPacchetto

public final void installPackage (String apkFileName, 
                String... options)

Installa un apk con il suo nome sul dispositivo. L'apk verrà pulito automaticamente.

Parametri
apkFileName String : il nome del file apk.

options String : opzioni extra fornite al comando install

Lancia
DeviceNotAvailableException
TargetSetupError

installPacchetto

public final void installPackage (ITestDevice device, 
                String apkFileName, 
                String... options)

Installa un apk con il suo nome su un determinato dispositivo. L'apk verrà pulito automaticamente.

Parametri
device ITestDevice : l' ITestDevice su cui installare l'apk.

apkFileName String : il nome del file apk.

options String : opzioni extra fornite al comando install

Lancia
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

public final void installPackageAsUser (ITestDevice device, 
                String apkFileName, 
                boolean grantPermission, 
                int userId, 
                String... options)

Installa un apk con il suo nome per un utente specifico su un determinato dispositivo.

Parametri
device ITestDevice : l' ITestDevice su cui installare l'apk.

apkFileName String : il nome del file apk.

grantPermission boolean : se passare il flag di concessione dell'autorizzazione durante l'installazione dell'apk.

userId int : l'ID utente dell'utente su cui installare l'apk.

options String : opzioni extra fornite al comando install

Lancia
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

public final void installPackageAsUser (String apkFileName, 
                boolean grantPermission, 
                int userId, 
                String... options)

Installa un apk con il suo nome per un utente specifico.

Parametri
apkFileName String : il nome del file apk.

grantPermission boolean : se passare il flag di concessione dell'autorizzazione durante l'installazione dell'apk.

userId int : l'ID utente dell'utente su cui installare l'apk.

options String : opzioni extra fornite al comando install

Lancia
DeviceNotAvailableException
TargetSetupError

isPackageInstalled

public final boolean isPackageInstalled (String pkg)

Controlla se sul dispositivo è installato un pacchetto con un determinato nome

Parametri
pkg String : il nome del pacchetto

ritorna
boolean true se il pacchetto viene trovato sul dispositivo

Lancia
DeviceNotAvailableException

isPackageInstalled

public final boolean isPackageInstalled (ITestDevice device, 
                String pkg)

Controlla se sul dispositivo è installato un pacchetto con un determinato nome

Parametri
device ITestDevice : il dispositivo che dovrebbe disinstallare il pacchetto.

pkg String : il nome del pacchetto

ritorna
boolean true se il pacchetto viene trovato sul dispositivo

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

userId Integer : l'ID dell'utente su cui eseguire il test. può essere nullo.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

maxTimeToOutputMs Long : il timeout massimo di cui il test deve iniziare a produrre qualcosa.

maxInstrumentationTimeoutMs Long : il timeout massimo che l'intera strumentazione deve completare.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                boolean isWindowAnimationDisabled, 
                 instrumentationArgs, 
                 extraListeners)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

runner String

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

userId Integer : l'ID dell'utente su cui eseguire il test. può essere nullo.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

maxTimeToOutputMs Long : il timeout massimo di cui il test deve iniziare a produrre qualcosa.

maxInstrumentationTimeoutMs Long : il timeout massimo che l'intera strumentazione deve completare.

checkResults boolean : se i risultati vengono controllati o meno per verificare la presenza di arresti anomali.

isHiddenApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo delle API nascoste.

isTestApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo dell'API di test.

isIsolatedStorageDisabled boolean : se dobbiamo disabilitare o meno l'archiviazione isolata.

isWindowAnimationDisabled boolean : se dobbiamo disabilitare o meno l'animazione della finestra.

instrumentationArgs : argomenti da passare alla strumentazione.

extraListeners

ritorna
boolean Vero se ha avuto successo senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                 instrumentationArgs)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

runner String

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

userId Integer : l'ID dell'utente su cui eseguire il test. può essere nullo.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

maxTimeToOutputMs Long : il timeout massimo di cui il test deve iniziare a produrre qualcosa.

maxInstrumentationTimeoutMs Long : il timeout massimo che l'intera strumentazione deve completare.

checkResults boolean : se i risultati vengono controllati o meno per verificare la presenza di arresti anomali.

isHiddenApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo delle API nascoste.

instrumentationArgs : argomenti da passare alla strumentazione.

ritorna
boolean Vero se ha avuto successo senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                String testMethodName)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (DeviceTestRunOptions options)

Esegue la strumentazione in base alle informazioni contenute in DeviceTestRunOptions .

Parametri
options DeviceTestRunOptions : DeviceTestRunOptions che guida la configurazione della strumentazione.

ritorna
boolean Vero se ha avuto successo senza fallire. Falso altrimenti.

Lancia
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                boolean isWindowAnimationDisabled, 
                boolean isRestartDisabled, 
                 instrumentationArgs, 
                 extraListeners)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

runner String

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

userId Integer : l'ID dell'utente su cui eseguire il test. può essere nullo.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

maxTimeToOutputMs Long : il timeout massimo di cui il test deve iniziare a produrre qualcosa.

maxInstrumentationTimeoutMs Long : il timeout massimo che l'intera strumentazione deve completare.

checkResults boolean : se i risultati vengono controllati o meno per verificare la presenza di arresti anomali.

isHiddenApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo delle API nascoste.

isTestApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo dell'API di test.

isIsolatedStorageDisabled boolean : se dobbiamo disabilitare o meno l'archiviazione isolata.

isWindowAnimationDisabled boolean : se dobbiamo disabilitare o meno l'animazione della finestra.

isRestartDisabled boolean

instrumentationArgs : argomenti da passare alla strumentazione.

extraListeners

ritorna
boolean Vero se ha avuto successo senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String pkgName, 
                String testClassName, 
                String testMethodName)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                Integer userId, 
                Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

userId Integer : l'ID dell'utente su cui eseguire il test. può essere nullo.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName, 
                Long testTimeoutMs)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (ITestDevice device, 
                String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName, 
                Integer userId, 
                Long testTimeoutMs, 
                Long maxTimeToOutputMs, 
                Long maxInstrumentationTimeoutMs, 
                boolean checkResults, 
                boolean isHiddenApiCheckDisabled, 
                boolean isTestApiCheckDisabled, 
                boolean isIsolatedStorageDisabled, 
                 instrumentationArgs, 
                 extraListeners)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
device ITestDevice : il dispositivo contro il quale eseguire la strumentazione.

runner String

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

userId Integer : l'ID dell'utente su cui eseguire il test. può essere nullo.

testTimeoutMs Long : il timeout in millisecondi da applicare a ciascun caso di test.

maxTimeToOutputMs Long : il timeout massimo di cui il test deve iniziare a produrre qualcosa.

maxInstrumentationTimeoutMs Long : il timeout massimo che l'intera strumentazione deve completare.

checkResults boolean : se i risultati vengono controllati o meno per verificare la presenza di arresti anomali.

isHiddenApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo delle API nascoste.

isTestApiCheckDisabled boolean : se dobbiamo disabilitare o meno il controllo dell'API di test.

isIsolatedStorageDisabled boolean : se dobbiamo disabilitare o meno l'archiviazione isolata.

instrumentationArgs : argomenti da passare alla strumentazione.

extraListeners

ritorna
boolean Vero se ha avuto successo senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

eseguireDeviceTests

public final boolean runDeviceTests (String runner, 
                String pkgName, 
                String testClassName, 
                String testMethodName)

Metodo per eseguire un pacchetto di strumentazione installato. Utilizza getLastDeviceRunResults() subito dopo per ottenere i dettagli dei risultati.

Parametri
runner String : il corridore della strumentazione da utilizzare.

pkgName String : il nome del pacchetto da eseguire.

testClassName String : il nome della classe di test da eseguire.

testMethodName String : il nome del metodo di test nella classe da eseguire.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Lancia
DeviceNotAvailableException

setAbi

public final void setAbi (IAbi abi)

Parametri
abi IAbi

setTestInformation

public final void setTestInformation (TestInformation testInformation)

Parametri
testInformation TestInformation

uninstallPackage

public final String uninstallPackage (String pkgName)

Disinstalla un pacchetto sul dispositivo.

Parametri
pkgName String : il pacchetto Android da disinstallare

ritorna
String una String con un codice di errore o null in caso di successo

Lancia
DeviceNotAvailableException

uninstallPackage

public final String uninstallPackage (ITestDevice device, 
                String pkgName)

Disinstalla un pacchetto sul dispositivo

Parametri
device ITestDevice : il dispositivo che dovrebbe disinstallare il pacchetto.

pkgName String : il pacchetto Android da disinstallare

ritorna
String una String con un codice di errore o null in caso di successo

Lancia
DeviceNotAvailableException