ModuleOemTargetPreparer

public class ModuleOemTargetPreparer
extends InstallApexModuleTargetPreparer

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


概要

ネストされたクラス

class ModuleOemTargetPreparer.ModuleInfo

モジュールに関する情報を保存するシンプルな構造体クラス

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

ModuleOemTargetPreparer()

パブリック メソッド

void checkModuleAfterPush(ITestDevice device, pushedModules)

push 後にモジュール名とバージョン コードを確認します。

void setUp(TestInformation testInfo)

テスト用のターゲット設定を行い、モジュールを push してプリロード モジュールを置き換えます。

保護されたメソッド

void checkPreloadModules(TestInformation testInfo, DeviceDescriptor deviceDescriptor)

プリロード モジュールの情報を確認します。

String[] getApkDirectory(ITestDevice device, String packageName)

システム ディレクトリの APK ファイルパスを取得します。

String getPackageVersioncode(ITestDevice device, String packageName, boolean isAPK)

指定されたパッケージ名のモジュールを push した後のパッケージ バージョンを確認します。

ModuleOemTargetPreparer.ModuleInfo pushFile(File moduleFile, TestInformation testInfo)

apex の場合は /system/apex/、apk の場合は /system/** にファイルを push します。

String renameFile(ITestDevice device, File moduleFile, String packageName)

更新するファイル名を /system の同じファイル名に変更します。

void setupDevice(TestInformation testInfo)

/system にファイルを push する前に、adb root でデバイスを再マウントします。

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

ModuleOemTargetPreparer

public ModuleOemTargetPreparer ()

パブリック メソッド

checkModuleAfterPush

public void checkModuleAfterPush (ITestDevice device, 
                 pushedModules)

push 後にモジュール名とバージョン コードを確認する

パラメータ
device ITestDevice

pushedModules : push されたモジュールのリスト

例外
TargetSetupError モジュールが push されていない場合は例外をスロー
DeviceNotAvailableException 利用可能なデバイスがない場合は例外をスローします

setUp

public void setUp (TestInformation testInfo)

テスト用のターゲット設定を行い、プリロード モジュールに置き換えるモジュールを push する

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

例外
TargetSetupError 環境の設定中に致命的なエラーが発生した場合
BuildError ビルドの準備中にエラーが発生した場合
DeviceNotAvailableException デバイスが応答しなくなった場合

保護されたメソッド

checkPreloadModules

protected void checkPreloadModules (TestInformation testInfo, 
                DeviceDescriptor deviceDescriptor)

プリロード モジュールの情報をチェックする

パラメータ
testInfo TestInformation: テスト情報

deviceDescriptor DeviceDescriptor

例外
DeviceNotAvailableException デバイスが使用できない場合は例外をスローします。
TargetSetupError モジュールがプリロードされていない場合は例外をスローします

getApkDirectory

protected String[] getApkDirectory (ITestDevice device, 
                String packageName)

システム ディレクトリの APK ファイルパスを取得する

パラメータ
device ITestDevice

packageName String: モジュール パッケージ名

戻り値
String[] APK 名とパスを含む文字列配列

例外
DeviceNotAvailableException デバイスが利用できない場合
TargetSetupError パッケージのパスが見つからない場合

getPackageVersioncode

protected String getPackageVersioncode (ITestDevice device, 
                String packageName, 
                boolean isAPK)

指定されたパッケージ名のモジュールを push した後のパッケージ バージョンを確認します。

パラメータ
packageName String: push されたパッケージ名

isAPK boolean

戻り値
String

例外
DeviceNotAvailableException デバイスが見つからない場合は例外をスローします。

pushFile

protected ModuleOemTargetPreparer.ModuleInfo pushFile (File moduleFile, 
                TestInformation testInfo)

apex の場合は /system/apex/、apk の場合は /system/** にファイルを push します。

パラメータ
moduleFile File: モジュール ファイル

testInfo TestInformation: 呼び出しの TestInformation

戻り値
ModuleOemTargetPreparer.ModuleInfo

例外
TargetSetupError adb 経由でファイルを push できない場合
DeviceNotAvailableException デバイスが利用できない場合

renameFile

protected String renameFile (ITestDevice device, 
                File moduleFile, 
                String packageName)

更新するファイル名を /system の同じファイル名に変更します。

パラメータ
device ITestDevice: テストデバイス

moduleFile File: インストールするモジュール ファイル

packageName String: /system/* の下の名前

戻り値
String 名前変更後の新しいファイル名

例外
TargetSetupError ファイル名を変更できない場合
DeviceNotAvailableException

setupDevice

protected void setupDevice (TestInformation testInfo)

/system にファイルを push する前に、adb root でデバイスを再マウント

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

例外
TargetSetupError デバイスを再マウントできない場合。
DeviceNotAvailableException