InstallApexModuleTargetPreparer

public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller

java.lang.Object
   ↳ com.android.tradefed.targetprep.BaseTargetPreparer
     ↳ com.android.tradefed.targetprep.TestAppInstallSetup
       ↳ com.android.tradefed.targetprep.suite.SuiteApkInstaller
         ↳ com.android.tradefed.targetprep.InstallApexModuleTargetPreparer


Podsumowanie

Stałe

String APEX_OPTION

String APEX_SUFFIX

String APK_SUFFIX

String APK_ZIP_OPTION

String CHILD_SESSION_CREATION_CMD

String PARENT_SESSION_CREATION_CMD

String ROLLBACK_STATE_COMMITTED

String ROLLBACK_STATE_UNKNOWN

String SPLIT_APKS_SUFFIX

Pola

protected File mTrainFolderPath

Konstruktory publiczne

InstallApexModuleTargetPreparer()

Metody publiczne

List<File> getModulesToInstall(TestInformation testInfo)

Pobiera moduły, które powinny być zainstalowane w pociągu, na podstawie modułów wstępnie załadowanych na urządzeniu.

void setIgnoreIfNotPreloaded(boolean skip)
void setSkipApexTearDown(boolean skip)
void setUp(TestInformation testInfo)

void tearDown(TestInformation testInfo, Throwable e)

Metody chronione

void addApksToTestFiles()
void addStagedReadyTimeoutForAdb(List<String> cmd)
void addTimeoutMillisForBundletool(List<String> extraArgs)
void checkApexActivation(ITestDevice device)

Sprawdź, czy wszystkie wierzchołki są aktywne.

List<ITestDevice.ApexInfo> collectApexInfoFromApexModules(Map<File, String> testAppFileNames, TestInformation testInfo)

Zbiera informacje o modułach APEX na potrzeby sprawdzania aktywacji.

List<String> getApkInstalled()
String getBundletoolFileName()
BundletoolUtil getBundletoolUtil()
String getModuleKeywordFromApexPackageName(String packageName)

Pobiera słowo kluczowe (np. „tzdata” w przypadku com.android.tzdata.apex) z nazwy pakietu APEX.

List<ITestDevice.ApexInfo> getModulesFailToActivate(Set<ITestDevice.ApexInfo> activatedApexes)

Pobieranie modułów, których nie udało się aktywować.

List<File> getSplitsForApks(TestInformation testInfo, File moduleFile)

Wyodrębnia i zwraca podziały dla określonych plików APK.

void initBundletoolUtil(TestInformation testInfo)

Inicjuje narzędzie bundletool dla tej klasy.

void installTrain(TestInformation testInfo, List<File> moduleFilenames)

Próbuje zainstalować na urządzeniu główną wersję APEX.

void installUsingBundleTool(TestInformation testInfo, List<File> testAppFileNames)

Próbuje zainstalować moduły główne za pomocą narzędzia bundletool.

void installer(TestInformation testInfo, Map<File, String> testAppFileNames)

Próba zainstalowania pakietu lub pakietu podzielonego na urządzeniu.

ITestDevice.ApexInfo retrieveApexInfo(File testApexFile, DeviceDescriptor deviceDescriptor)

Pobiera informacje ApexInfo, które zawierają packageName i versionCode z podanego pliku APEX.

Stałe

APEX_OPTION

protected static final String APEX_OPTION

Wartość stała: "--apex"

APEX_SUFFIX

protected static final String APEX_SUFFIX

Wartość stała: ".apex"

APK_SUFFIX

protected static final String APK_SUFFIX

Wartość stała: ".apk"

APK_ZIP_OPTION

protected static final String APK_ZIP_OPTION

Wartość stała: "--apks-zip"

CHILD_SESSION_CREATION_CMD

protected static final String CHILD_SESSION_CREATION_CMD

Wartość stała: "pm install-create"

PARENT_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

Wartość stała: "pm install-create --multi-package"

ROLLBACK_STATE_COMMITTED

public static final String ROLLBACK_STATE_COMMITTED

Wartość stała: "committed"

ROLLBACK_STATE_UNKNOWN

public static final String ROLLBACK_STATE_UNKNOWN

Wartość stała: "unknown"

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

Wartość stała: ".apks"

Pola

mTrainFolderPath

protected File mTrainFolderPath

Konstruktory publiczne

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

Metody publiczne

getModulesToInstall

public List<File> getModulesToInstall (TestInformation testInfo)

Pobiera moduły, które powinny być zainstalowane w pociągu, na podstawie modułów wstępnie załadowanych na urządzeniu. Moduły, które nie są wstępnie załadowane, nie zostaną zainstalowane.

Parametry
testInfo TestInformation: TestInformation

Zwraca
List<File> Listę modułów, które powinny być zainstalowane na urządzeniu.

Zgłasza
DeviceNotAvailableException gdy urządzenie jest niedostępne.
TargetSetupError gdy obowiązkowe moduły nie są zainstalowane lub nie można ich zainstalować.

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

Parametry
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

Parametry
skip boolean

setUp

public void setUp (TestInformation testInfo)

Parametry
testInfo TestInformation

Zgłasza
BuildError
DeviceNotAvailableException
TargetSetupError

tearDown

public void tearDown (TestInformation testInfo, 
                Throwable e)

Parametry
testInfo TestInformation

e Throwable

Zgłasza
DeviceNotAvailableException
DeviceRuntimeException

Metody chronione

addApksToTestFiles

protected void addApksToTestFiles ()

addStagedReadyTimeoutForAdb

protected void addStagedReadyTimeoutForAdb (List<String> cmd)

Parametry
cmd List

addTimeoutMillisForBundletool

protected void addTimeoutMillisForBundletool (List<String> extraArgs)

Parametry
extraArgs List

checkApexActivation

protected void checkApexActivation (ITestDevice device)

Sprawdź, czy wszystkie wierzchołki są aktywne.

Parametry
device ITestDevice: w trakcie testowania.

Zgłasza
TargetSetupError jeśli aktywacja się nie powiodła.
DeviceNotAvailableException

collectApexInfoFromApexModules

protected List<ITestDevice.ApexInfo> collectApexInfoFromApexModules (Map<File, String> testAppFileNames, 
                TestInformation testInfo)

Zbiera informacje o modułach APEX na potrzeby sprawdzania aktywacji.

Parametry
testAppFileNames Map: lista nazw plików modułów do zainstalowania.

testInfo TestInformation: TestInformation

Zwraca
List<ITestDevice.ApexInfo> lista zawierająca informacje apexinfo o modułach APEX na listach plików wejściowych;

Zgłasza
TargetSetupError

getApkInstalled

protected List<String> getApkInstalled ()

Zwraca
List<String>

getBundletoolFileName

protected String getBundletoolFileName ()

Zwraca
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

Zwraca
BundletoolUtil

getModuleKeywordFromApexPackageName

protected String getModuleKeywordFromApexPackageName (String packageName)

Pobiera słowo kluczowe (np. „tzdata” w przypadku com.android.tzdata.apex) z nazwy pakietu APEX.

Parametry
packageName String: Nazwa pakietu pliku APEX.

Zwraca
String ciąg tekstowy Słowo kluczowe nazwy pakietu Apex.

getModulesFailToActivate

protected List<ITestDevice.ApexInfo> getModulesFailToActivate (Set<ITestDevice.ApexInfo> activatedApexes)

Pobieranie modułów, których nie udało się aktywować.

Parametry
activatedApexes Set: zestaw aktywnych wierzchołków na urządzeniu.

Zwraca
List<ITestDevice.ApexInfo> lista zawierająca informacje apexinfo o modułach apex wejściowych, których nie udało się aktywować.

Zgłasza
DeviceNotAvailableException
TargetSetupError

getSplitsForApks

protected List<File> getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

Wyodrębnia i zwraca podziały dla określonych plików APK.

Parametry
testInfo TestInformation: TestInformation

moduleFile File: Plik modułu, z którego mają zostać wyodrębnione podziały.

Zwraca
List<File> tablicę File[] zawierającą podziały.

Zgłasza
TargetSetupError jeśli nie można znaleźć narzędzia bundletool lub nie udało się wygenerować pliku specyfikacji urządzenia.

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

Inicjuje narzędzie bundletool dla tej klasy.

Parametry
testInfo TestInformation: TestInformation wywołania.

Zgłasza
TargetSetupError jeśli nie można znaleźć narzędzia bundletool.

installTrain

protected void installTrain (TestInformation testInfo, 
                List<File> moduleFilenames)

Próbuje zainstalować na urządzeniu główną wersję APEX.

Parametry
testInfo TestInformation: TestInformation

moduleFilenames List: lista ciągów znaków. Lista nazw plików modułów głównych do zainstalowania.

Zgłasza
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

protected void installUsingBundleTool (TestInformation testInfo, 
                List<File> testAppFileNames)

Próbuje zainstalować moduły główne za pomocą narzędzia bundletool.

Parametry
testInfo TestInformation: TestInformation

testAppFileNames List: nazwy plików wstępnie załadowanych modułów do zainstalowania.

Zgłasza
DeviceNotAvailableException
TargetSetupError

instalator

protected void installer (TestInformation testInfo, 
                Map<File, String> testAppFileNames)

Próba zainstalowania pakietu lub pakietu podzielonego na urządzeniu.

Parametry
testInfo TestInformation: TestInformation wywołania

testAppFileNames Map: pliki APK i ich pakiet do zainstalowania.

Zgłasza
DeviceNotAvailableException
TargetSetupError

retrieveApexInfo

protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, 
                DeviceDescriptor deviceDescriptor)

Pobiera informacje ApexInfo, które zawierają packageName i versionCode z podanego pliku APEX.

Parametry
testApexFile File: plik wierzchołkowy, z którego pobieramy informacje.

deviceDescriptor DeviceDescriptor

Zwraca
ITestDevice.ApexInfo plik ApexInfo zawierający packageName i versionCode danego pliku;

Zgłasza
TargetSetupError jeśli parser aapt nie zdołał przeanalizować pliku.