InstallareApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
Sottoclassi dirette conosciute |
Riepilogo
Metodi protetti |
---|
void | addApksToTestFiles () |
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) Raccoglie informazioni sull'apex dai moduli apex per il controllo dell'attivazione. |
boolean | containsPersistentApk ( testAppFileNames, TestInformation testInfo) containsPersistentApk ( testAppFileNames, TestInformation testInfo) Controlla se i file di input contengono apk persistenti. |
| getApkInstalled () |
String | getBundletoolFileName () |
BundletoolUtil | getBundletoolUtil () |
String | getModuleKeywordFromApexPackageName (String packageName) Ottiene la parola chiave (ad esempio, 'tzdata' per com.android.tzdata.apex) dal nome del pacchetto apex. |
| getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes) Ottieni i moduli la cui attivazione non è riuscita. |
| getSplitsForApks (TestInformation testInfo, File moduleFile) Estrae e restituisce le suddivisioni per gli apk specificati. |
void | initBundletoolUtil (TestInformation testInfo) Inizializza l'utilità bundletool per questa classe. |
void | installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) Tenta di installare un treno della linea principale contenente l'apice sul dispositivo. |
void | installUsingBundleTool (TestInformation testInfo, testAppFileNames) installUsingBundleTool (TestInformation testInfo, testAppFileNames) Tenta di installare i moduli della linea principale utilizzando bundletool. |
void | installer (TestInformation testInfo, testAppFileNames) installer (TestInformation testInfo, testAppFileNames) Tentare di installare un pacchetto o un pacchetto suddiviso sul dispositivo. |
boolean | isPersistentApk (File filename, TestInformation testInfo) Controlla se un apk è un apk persistente. |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) Recupera ApexInfo che contiene packageName e versionCode dal file apex specificato. |
Campi
APEX_SUFFISSO
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
Costruttori pubblici
InstallareApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
Metodi pubblici
public getModulesToInstall (TestInformation testInfo)
Ottiene i moduli da installare sul treno, in base ai moduli precaricati sul dispositivo. I moduli non precaricati non verranno installati.
ritorna |
---|
| Elenco dei moduli che dovranno essere installati sul dispositivo. |
Lancia |
---|
DeviceNotAvailableException | quando il dispositivo non è disponibile. |
TargetSetupError | quando i moduli obbligatori non sono installati o il modulo non può essere installato. |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void setUp (TestInformation testInfo)
Parametri |
---|
testInfo | TestInformation |
Lancia |
---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError | |
public void tearDown (TestInformation testInfo,
Throwable e)
Parametri |
---|
testInfo | TestInformation |
e | Throwable |
Lancia |
---|
DeviceNotAvailableException | |
Metodi protetti
aggiungiApksToTestFiles
protected void addApksToTestFiles ()
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
Raccoglie informazioni sull'apex dai moduli apex per il controllo dell'attivazione.
Parametri |
---|
testAppFileNames | : L'elenco dei nomi dei file dei moduli da installare |
testInfo | TestInformation : TestInformation |
ritorna |
---|
| un elenco contenente l'apexinfo dei moduli apex negli elenchi dei file di input |
protected boolean containsPersistentApk ( testAppFileNames,
TestInformation testInfo)
Controlla se i file di input contengono apk persistenti.
Parametri |
---|
testAppFileNames | : L'elenco dei nomi dei file dei moduli da installare |
testInfo | TestInformation : TestInformation |
ritorna |
---|
boolean | true se i file di input contengono un modulo apk persistente. |
Lancia |
---|
DeviceNotAvailableException | |
TargetSetupError | |
getApkInstallato
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
Ottiene la parola chiave (ad esempio, 'tzdata' per com.android.tzdata.apex) dal nome del pacchetto apex.
Parametri |
---|
packageName | String : il nome del pacchetto del file apex. |
ritorna |
---|
String | una stringa La parola chiave del nome del pacchetto apex. |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
Ottieni i moduli la cui attivazione non è riuscita.
Parametri |
---|
activatedApexes | : L'insieme degli apici attivi sul dispositivo |
ritorna |
---|
| un elenco contenente l'apexinfo dei moduli apex di input che non sono stati attivati. |
Lancia |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
Estrae e restituisce le suddivisioni per gli apk specificati.
Parametri |
---|
testInfo | TestInformation : TestInformation |
moduleFile | File : il file del modulo da cui estrarre le divisioni. |
ritorna |
---|
| un File[] contenente le divisioni. |
Lancia |
---|
TargetSetupError | se bundletool non viene trovato o il file delle specifiche del dispositivo non viene generato. |
protected void initBundletoolUtil (TestInformation testInfo)
Inizializza l'utilità bundletool per questa classe.
Lancia |
---|
TargetSetupError | se bundletool non può essere trovato. |
protected void installTrain (TestInformation testInfo,
moduleFilenames,
String[] extraArgs)
Tenta di installare un treno della linea principale contenente l'apice sul dispositivo.
Parametri |
---|
testInfo | TestInformation : TestInformation |
moduleFilenames | : Elenco di stringhe. L'elenco dei nomi di file dei moduli della linea principale da installare. |
extraArgs | String |
Lancia |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
Tenta di installare i moduli della linea principale utilizzando bundletool.
Parametri |
---|
testInfo | TestInformation : TestInformation |
testAppFileNames | : i nomi dei file dei moduli precaricati da installare. |
Lancia |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installer (TestInformation testInfo,
testAppFileNames)
Tentare di installare un pacchetto o un pacchetto suddiviso sul dispositivo.
Parametri |
---|
testInfo | TestInformation : TestInformation per l'invocazione |
testAppFileNames | : gli apk e il relativo pacchetto da installare. |
Lancia |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected boolean isPersistentApk (File filename,
TestInformation testInfo)
Controlla se un apk è un apk persistente.
Parametri |
---|
filename | File : il file del modulo apk da controllare |
testInfo | TestInformation : TestInformation |
ritorna |
---|
boolean | true se si tratta di un modulo apk persistente. |
Lancia |
---|
DeviceNotAvailableException | |
TargetSetupError | |
recuperareApexInfo
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
Recupera ApexInfo che contiene packageName e versionCode dal file apex specificato.
Parametri |
---|
testApexFile | File : il file apex da cui recuperiamo le informazioni. |
deviceDescriptor | DeviceDescriptor |
ritorna |
---|
ITestDevice.ApexInfo | un ApexInfo contenente il packageName e il versionCode del file specificato |
Lancia |
---|
TargetSetupError | se il parser aapt non è riuscito ad analizzare il file. |