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)

푸시 후 모듈 이름 및 버전 코드 확인

void setUp(TestInformation testInfo)

테스트를 위한 타겟 설정을 실행하고 미리 로드된 모듈을 대체하도록 모듈을 푸시합니다.

보호된 메서드

void checkPreloadModules(TestInformation testInfo, DeviceDescriptor deviceDescriptor)

미리 로드 모듈 정보 확인

String[] getApkDirectory(ITestDevice device, String packageName)

시스템 디렉터리 아래의 APK 파일 경로 가져오기

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

지정된 패키지 이름의 모듈을 푸시한 후 패키지 버전을 확인합니다.

ModuleOemTargetPreparer.ModuleInfo pushFile(File moduleFile, TestInformation testInfo)

apex의 경우 /system/apex/ 에, apk의 경우 /system/** 에 파일을 푸시합니다.

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

업데이트할 파일 이름을 /system 아래의 동일한 이름으로 바꿉니다.

void setupDevice(TestInformation testInfo)

/system 아래에 파일을 푸시하기 전에 adb root 및 기기 재마운트

공개 생성자

ModuleOemTargetPreparer

public ModuleOemTargetPreparer ()

공개 메서드

checkModuleAfterPush

public void checkModuleAfterPush (ITestDevice device, 
                 pushedModules)

푸시 후 모듈 이름 및 버전 코드 확인

매개변수
device ITestDevice

pushedModules : 푸시된 모듈 목록

생성 값
TargetSetupError 푸시된 모듈이 없으면 예외 발생
DeviceNotAvailableException 사용 가능한 기기가 없는 경우 예외 발생

setUp

public void setUp (TestInformation testInfo)

테스트를 위한 타겟 설정을 실행하고 미리 로드된 모듈을 대체하도록 모듈을 푸시합니다.

매개변수
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)

지정된 패키지 이름의 모듈을 푸시한 후 패키지 버전을 확인합니다.

매개변수
packageName String: 푸시된 패키지 이름

isAPK boolean

반환 값
String

생성 값
DeviceNotAvailableException 기기를 찾을 수 없는 경우 예외가 발생합니다.

pushFile

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

apex의 경우 /system/apex/ 에, apk의 경우 /system/** 에 파일을 푸시합니다.

매개변수
moduleFile File: 모듈 파일

testInfo TestInformation: 호출의 TestInformation입니다.

반환 값
ModuleOemTargetPreparer.ModuleInfo

생성 값
TargetSetupError adb를 통해 파일을 푸시할 수 없는 경우
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 아래에 파일을 푸시하기 전에 adb root 및 기기 재마운트

매개변수
testInfo TestInformation: 호출의 TestInformation입니다.

생성 값
TargetSetupError 기기를 다시 마운트할 수 없는 경우
DeviceNotAvailableException