InstallApexModuleTargetPreparer
public class InstallApexModuleTargetPreparer
extends SuiteApkInstaller
まとめ
保護されたメソッド |
---|
void | addApksToTestFiles () |
| collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) アクティベーションチェックのために apex モジュールから apex 情報を収集します。 |
boolean | containsPersistentApk ( testAppFileNames, TestInformation testInfo) containsPersistentApk ( testAppFileNames, TestInformation testInfo) 入力ファイルに永続的な APK が含まれているかどうかを確認します。 |
| getApkInstalled () |
String | getBundletoolFileName () |
BundletoolUtil | getBundletoolUtil () |
String | getModuleKeywordFromApexPackageName (String packageName) apex パッケージ名からキーワード (例: com.android.tzdata.apex の場合は「tzdata」) を取得します。 |
| getModulesFailToActivate ( activatedApexes) getModulesFailToActivate ( activatedApexes) アクティブ化に失敗したモジュールを取得します。 |
| getSplitsForApks (TestInformation testInfo, File moduleFile) 指定された apk の分割を抽出して返します。 |
void | initBundletoolUtil (TestInformation testInfo) このクラスのバンドルツールユーティリティを初期化します。 |
void | installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) installTrain (TestInformation testInfo, moduleFilenames, String[] extraArgs) apex を含む幹線トレインをデバイスにインストールしようとします。 |
void | installUsingBundleTool (TestInformation testInfo, testAppFileNames) installUsingBundleTool (TestInformation testInfo, testAppFileNames) Bundletool を使用してメインライン モジュールをインストールしようとします。 |
void | installer (TestInformation testInfo, testAppFileNames) installer (TestInformation testInfo, testAppFileNames) デバイスにパッケージまたは分割パッケージをインストールしようとします。 |
boolean | isPersistentApk (File filename, TestInformation testInfo) APK が永続 APK であるかどうかを確認します。 |
ITestDevice.ApexInfo | retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor) 指定された apex ファイルから packageName と versionCode を含む ApexInfo を取得します。 |
田畑
APEX_SUFFIX
protected static final String APEX_SUFFIX
APK_SUFFIX
protected static final String APK_SUFFIX
SPLIT_APKS_SUFFIX
protected static final String SPLIT_APKS_SUFFIX
パブリックコンストラクター
InstallApexModuleTargetPreparer
public InstallApexModuleTargetPreparer ()
パブリックメソッド
public getModulesToInstall (TestInformation testInfo)
デバイスにプリロードされているモジュールに基づいて、トレインにインストールする必要があるモジュールを取得します。プリロードされていないモジュールはインストールされません。
戻り値 |
---|
| リストデバイスにインストールする必要があるモジュールの数。 |
投げる |
---|
DeviceNotAvailableException | デバイスが利用できない場合。 |
TargetSetupError | 必須モジュールがインストールされていない場合、またはモジュールをインストールできない場合。 |
setIgnoreIfNotPreloaded
public void setIgnoreIfNotPreloaded (boolean skip)
setSkipApexTearDown
public void setSkipApexTearDown (boolean skip)
public void setUp (TestInformation testInfo)
パラメーター |
---|
testInfo | TestInformation |
投げる |
---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError | |
public void tearDown (TestInformation testInfo,
Throwable e)
パラメーター |
---|
testInfo | TestInformation |
e | Throwable |
投げる |
---|
DeviceNotAvailableException | |
保護されたメソッド
ApksToTestFiles を追加
protected void addApksToTestFiles ()
protected collectApexInfoFromApexModules ( testAppFileNames,
TestInformation testInfo)
アクティベーションチェックのために apex モジュールから apex 情報を収集します。
パラメーター |
---|
testAppFileNames | : インストールするモジュールのファイル名のリスト |
testInfo | TestInformation : TestInformation |
戻り値 |
---|
| 入力ファイルリスト内の apex モジュールの apexinfo を含むリスト |
protected boolean containsPersistentApk ( testAppFileNames,
TestInformation testInfo)
入力ファイルに永続的な APK が含まれているかどうかを確認します。
パラメーター |
---|
testAppFileNames | : インストールするモジュールのファイル名のリスト |
testInfo | TestInformation : TestInformation |
戻り値 |
---|
boolean | 入力ファイルに永続的な APK モジュールが含まれている場合はtrue 。 |
投げる |
---|
DeviceNotAvailableException | |
TargetSetupError | |
getApkInstalled
protected getApkInstalled ()
protected String getBundletoolFileName ()
getModuleKeywordFromApexPackageName
protected String getModuleKeywordFromApexPackageName (String packageName)
apex パッケージ名からキーワード (例: com.android.tzdata.apex の場合は「tzdata」) を取得します。
パラメーター |
---|
packageName | String : apex ファイルのパッケージ名。 |
戻り値 |
---|
String | 文字列 apex パッケージ名のキーワード。 |
getModulesFailToActivate
protected getModulesFailToActivate ( activatedApexes)
アクティブ化に失敗したモジュールを取得します。
パラメーター |
---|
activatedApexes | : デバイス上のアクティブな頂点のセット |
戻り値 |
---|
| アクティブ化に失敗した入力 apex モジュールの apexinfo を含むリスト。 |
投げる |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected getSplitsForApks (TestInformation testInfo,
File moduleFile)
指定された apk の分割を抽出して返します。
パラメーター |
---|
testInfo | TestInformation : TestInformation |
moduleFile | File : スプリットを抽出するモジュール ファイル。 |
投げる |
---|
TargetSetupError | Bundletool が見つからない場合、またはデバイス仕様ファイルの生成に失敗した場合。 |
protected void initBundletoolUtil (TestInformation testInfo)
このクラスのバンドルツールユーティリティを初期化します。
投げる |
---|
TargetSetupError | Bundletool が見つからない場合。 |
protected void installTrain (TestInformation testInfo,
moduleFilenames,
String[] extraArgs)
apex を含む幹線トレインをデバイスにインストールしようとします。
パラメーター |
---|
testInfo | TestInformation : TestInformation |
moduleFilenames | : 文字列のリスト。インストールされるメインライン モジュールのファイル名のリスト。 |
extraArgs | String |
投げる |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installUsingBundleTool (TestInformation testInfo,
testAppFileNames)
Bundletool を使用してメインライン モジュールをインストールしようとします。
パラメーター |
---|
testInfo | TestInformation : TestInformation |
testAppFileNames | : インストールするプリロードされたモジュールのファイル名。 |
投げる |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected void installer (TestInformation testInfo,
testAppFileNames)
デバイスにパッケージまたは分割パッケージをインストールしようとします。
パラメーター |
---|
testInfo | TestInformation : 呼び出しのTestInformation |
testAppFileNames | : インストールされる apk とそのパッケージ。 |
投げる |
---|
DeviceNotAvailableException | |
TargetSetupError | |
protected boolean isPersistentApk (File filename,
TestInformation testInfo)
APK が永続 APK であるかどうかを確認します。
パラメーター |
---|
filename | File : 確認するapkモジュールファイル |
testInfo | TestInformation : TestInformation |
戻り値 |
---|
boolean | これが永続的な APK モジュールの場合はtrue 。 |
投げる |
---|
DeviceNotAvailableException | |
TargetSetupError | |
Apex情報の取得
protected ITestDevice.ApexInfo retrieveApexInfo (File testApexFile,
DeviceDescriptor deviceDescriptor)
指定された apex ファイルから packageName と versionCode を含む ApexInfo を取得します。
パラメーター |
---|
testApexFile | File : 情報を取得する apex ファイル。 |
deviceDescriptor | DeviceDescriptor |
戻り値 |
---|
ITestDevice.ApexInfo | 指定されたファイルの packageName と versionCode を含むApexInfo |
投げる |
---|
TargetSetupError | aapt パーサーがファイルの解析に失敗した場合。 |