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


まとめ

田畑

protected static final String APEX_OPTION

protected static final String APEX_SUFFIX

protected static final String APK_SUFFIX

protected static final String CHILD_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

protected static final String SPLIT_APKS_SUFFIX

protected File mTrainFolderPath

パブリック コンストラクター

InstallApexModuleTargetPreparer ()

公開メソッド

getModulesToInstall ( TestInformation testInfo)

デバイスにプリロードされたモジュールに基づいて、トレインにインストールする必要があるモジュールを取得します。

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

void tearDown ( TestInformation testInfo, Throwable e)

保護されたメソッド

void addApksToTestFiles ()
void checkApexActivation ( ITestDevice device)

すべての頂点がアクティブになっているかどうかを確認します。

collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo) collectApexInfoFromApexModules ( testAppFileNames, TestInformation testInfo)

アクティベーション チェックのために頂点モジュールから頂点情報を収集します。

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)

このクラスの bundletool ユーティリティを初期化します。

void installTrain ( TestInformation testInfo, moduleFilenames) installTrain ( TestInformation testInfo, moduleFilenames)

apex を含むメインライン トレインをデバイスにインストールしようとします。

void installUsingBundleTool ( TestInformation testInfo, testAppFileNames) installUsingBundleTool ( TestInformation testInfo, testAppFileNames)

bundletool を使用してメインライン モジュールのインストールを試みます。

void installer ( TestInformation testInfo, testAppFileNames) installer ( TestInformation testInfo, testAppFileNames)

パッケージまたは分割パッケージをデバイスにインストールしようとします。

ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, DeviceDescriptor deviceDescriptor)

指定された apex ファイルから packageName と versionCode を含む ApexInfo を取得します。

田畑

APEX_OPTION

protected static final String APEX_OPTION

APEX_SUFFIX

protected static final String APEX_SUFFIX

APK_SUFFIX

protected static final String APK_SUFFIX

CHILD_SESSION_CREATION_CMD

protected static final String CHILD_SESSION_CREATION_CMD

PARENT_SESSION_CREATION_CMD

protected static final String PARENT_SESSION_CREATION_CMD

SPLIT_APKS_SUFFIX

protected static final String SPLIT_APKS_SUFFIX

mTrainFolderPath

protected File mTrainFolderPath

パブリック コンストラクター

InstallApexModuleTargetPreparer

public InstallApexModuleTargetPreparer ()

公開メソッド

getModulesToInstall

public  getModulesToInstall (TestInformation testInfo)

デバイスにプリロードされたモジュールに基づいて、トレインにインストールする必要があるモジュールを取得します。プリロードされていないモジュールはインストールされません。

パラメーター
testInfo TestInformation : TestInformation

戻り値
リストデバイスにインストールする必要があるモジュールの。

スロー
DeviceNotAvailableExceptionデバイスが使用できない場合。
TargetSetupError必須モジュールがインストールされていない場合、またはモジュールをインストールできない場合。

setIgnoreIfNotPreloaded

public void setIgnoreIfNotPreloaded (boolean skip)

パラメーター
skip boolean

setSkipApexTearDown

public void setSkipApexTearDown (boolean skip)

パラメーター
skip boolean

設定

public void setUp (TestInformation testInfo)

パラメーター
testInfo TestInformation

スロー
BuildError
DeviceNotAvailableException
TargetSetupError

取り壊す

public void tearDown (TestInformation testInfo, 
                Throwable e)

パラメーター
testInfo TestInformation

e Throwable

スロー
DeviceNotAvailableException

保護されたメソッド

addApksToTestFiles

protected void addApksToTestFiles ()

checkApexアクティベーション

protected void checkApexActivation (ITestDevice device)

すべての頂点がアクティブになっているかどうかを確認します。

パラメーター
device ITestDevice : テスト中。

スロー
TargetSetupErrorアクティベーションに失敗した場合。
DeviceNotAvailableException

collectApexInfoFromApexModules

protected  collectApexInfoFromApexModules ( testAppFileNames, 
                TestInformation testInfo)

アクティベーション チェックのために頂点モジュールから頂点情報を収集します。

パラメーター
testAppFileNames : インストールするモジュールのファイル名のリスト

testInfo TestInformation : TestInformation

戻り値
入力ファイル リスト内の apex モジュールの apexinfo を含むリスト

スロー
TargetSetupError

getApkInstalled

protected  getApkInstalled ()

戻り値

getBundletoolFileName

protected String getBundletoolFileName ()

戻り値
String

getBundletoolUtil

protected BundletoolUtil getBundletoolUtil ()

戻り値
BundletoolUtil

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

getSplitsForApks

protected  getSplitsForApks (TestInformation testInfo, 
                File moduleFile)

指定された apk の分割を抽出して返します。

パラメーター
testInfo TestInformation : TestInformation

moduleFile File : 分割を抽出するモジュール ファイル。

戻り値
分割を含む File[]。

スロー
TargetSetupError bundletool が見つからないか、デバイス スペック ファイルの生成に失敗した場合。

initBundletoolUtil

protected void initBundletoolUtil (TestInformation testInfo)

このクラスの bundletool ユーティリティを初期化します。

パラメーター
testInfo TestInformation : 呼び出しのTestInformation

スロー
TargetSetupError bundletool が見つからない場合。

インストールトレイン

protected void installTrain (TestInformation testInfo, 
                 moduleFilenames)

apex を含むメインライン トレインをデバイスにインストールしようとします。

パラメーター
testInfo TestInformation : TestInformation

moduleFilenames : 文字列のリスト。インストールするメインライン モジュールのファイル名のリスト。

スロー
DeviceNotAvailableException
TargetSetupError

installUsingBundleTool

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 ITestDevice.ApexInfo retrieveApexInfo (File testApexFile, 
                DeviceDescriptor deviceDescriptor)

指定された apex ファイルから packageName と versionCode を含む ApexInfo を取得します。

パラメーター
testApexFile File : 情報を取得する頂点ファイル。

deviceDescriptor DeviceDescriptor

戻り値
ITestDevice.ApexInfo指定されたファイルの packageName と versionCode を含むApexInfo

スロー
TargetSetupError aapt パーサーがファイルの解析に失敗した場合。