BaseHostJUnit4Test

public abstract class BaseHostJUnit4Test
extends Object implements IAbiReceiver , ITestInformationReceiver

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


Classe di test di base per l'esecuzione di test in stile JUnit4 dell'host. Questa classe fornisce supporto per l'installazione, l'esecuzione e la pulizia dei test di 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 l'utilità duplicata e la classe base.

Riepilogo

Costruttori pubblici

BaseHostJUnit4Test ()

Metodi pubblici

final void autoTearDown ()

Abbattimento 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 runDeviceTest 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 dato il suo nome sul dispositivo.

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

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

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

Installa un apk dato 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 dato il suo nome per un utente specifico.

final boolean isPackageInstalled (String pkg)

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

final boolean isPackageInstalled ( ITestDevice device, String pkg)

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

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 basata sulle informazioni 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

autoTearDown

public final void autoTearDown ()

Abbattimento automatico per tutti gli apk installati. Questo disinstallerà tutti gli apk dal dispositivo su cui sono stati installati.

Getta
DeviceNotAvailableException

getAbi

public final IAbi getAbi ()

ritorna
IAbi

getBuild

public final IBuildInfo getBuild ()

ritorna
IBuildInfo

getDispositivo

public final ITestDevice getDevice ()

ritorna
ITestDevice

getInvocationContext

public final IInvocationContext getInvocationContext ()

ritorna
IInvocationContext

getLastDeviceRunResults

public final TestRunResult getLastDeviceRunResults ()

Restituisce il TestRunResult risultante dagli ultimi runDeviceTest eseguiti. O 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

Getta
DeviceNotAvailableException

installPackage

public final void installPackage (DeviceTestRunOptions options)

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

Parametri
options DeviceTestRunOptions : le opzioni dell'installazione del pacchetto.

Getta
DeviceNotAvailableException
TargetSetupError

installPackage

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

Installa un apk dato il suo nome sul dispositivo. Apk verrà pulito automaticamente.

Parametri
apkFileName String : il nome del file apk.

options String : opzioni extra date al comando install

Getta
DeviceNotAvailableException
TargetSetupError

installPackage

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

Installa un apk dato il suo nome su un determinato dispositivo. 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 date al comando install

Getta
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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

Installa un apk dato 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 dove installare l'apk.

options String : opzioni extra date al comando install

Getta
DeviceNotAvailableException
TargetSetupError

installPackageAsUser

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

Installa un apk dato 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 dove installare l'apk.

options String : opzioni extra date al comando install

Getta
DeviceNotAvailableException
TargetSetupError

isPackageInstalled

public final boolean isPackageInstalled (String pkg)

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

Parametri
pkg String : il nome del pacchetto

ritorna
boolean true se il pacchetto viene trovato nel dispositivo

Getta
DeviceNotAvailableException

isPackageInstalled

public final boolean isPackageInstalled (ITestDevice device, 
                String pkg)

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

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

pkg String : il nome del pacchetto

ritorna
boolean true se il pacchetto viene trovato nel dispositivo

Getta
DeviceNotAvailableException

runDeviceTests

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

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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 ad ogni test case.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Getta
DeviceNotAvailableException

runDeviceTests

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. Usa 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 ad ogni test case.

maxTimeToOutputMs Long : il timeout massimo che 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.

Getta
DeviceNotAvailableException

runDeviceTests

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. Usa 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 ad ogni test case.

maxTimeToOutputMs Long : il timeout massimo che 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 gli 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 o meno disabilitare 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.

Getta
DeviceNotAvailableException

runDeviceTests

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

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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 ad ogni test case.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Getta
DeviceNotAvailableException

runDeviceTests

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. Usa 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 ad ogni test case.

maxTimeToOutputMs Long : il timeout massimo che 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 gli 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.

Getta
DeviceNotAvailableException

runDeviceTests

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

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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.

Getta
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (DeviceTestRunOptions options)

Esegue la strumentazione basata sulle informazioni in DeviceTestRunOptions .

Parametri
options DeviceTestRunOptions : le DeviceTestRunOptions che guidano la configurazione della strumentazione.

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

Getta
com.android.tradefed.device.DeviceNotAvailableException
DeviceNotAvailableException

runDeviceTests

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. Usa 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 ad ogni test case.

maxTimeToOutputMs Long : il timeout massimo che 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 gli 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 o meno disabilitare 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.

Getta
DeviceNotAvailableException

runDeviceTests

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

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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.

Getta
DeviceNotAvailableException

runDeviceTests

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

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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 ad ogni test case.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Getta
DeviceNotAvailableException

runDeviceTests

public final boolean runDeviceTests (String pkgName, 
                String testClassName)

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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.

Getta
DeviceNotAvailableException

runDeviceTests

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

Metodo per eseguire un pacchetto di strumentazione installato. Usa 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 ad ogni test case.

ritorna
boolean Vero se riesce senza fallire. Falso altrimenti.

Getta
DeviceNotAvailableException

runDeviceTests

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. Usa 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 ad ogni test case.

maxTimeToOutputMs Long : il timeout massimo che 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 gli 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 o meno disabilitare l'archiviazione isolata.

instrumentationArgs : argomenti da passare alla strumentazione.

extraListeners

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

Getta
DeviceNotAvailableException

runDeviceTests

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

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

Parametri
runner String : il corridore di 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.

Getta
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

Getta
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

Getta
DeviceNotAvailableException