컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.

ModuleOemTargetPreparer

public class ModuleOemTargetPreparer
extends InstallApexModuleTargetPreparer

java.lang.객체
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) 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 루트 및 장치 다시 마운트

공개 생성자

ModuleOemTargetPreparer

public ModuleOemTargetPreparer ()

공개 메서드

checkModuleAfterPush

public void checkModuleAfterPush (ITestDevice device, 
                 pushedModules)

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

매개변수
device ITestDevice

pushedModules : 푸시된 모듈 목록

던지다
TargetSetupError 푸시된 모듈이 없으면 예외 발생
DeviceNotAvailableException 사용 가능한 장치가 없으면 예외를 던집니다.

설정

public void setUp (TestInformation testInfo)

테스트를 위한 대상 설정을 수행하고 모듈을 푸시하여 사전 로드된 모듈을 교체합니다.

매개변수
testInfo TestInformation 다음 TestInformation 호출의.

던지다
TargetSetupError 환경 설정에 치명적인 오류가 발생한 경우
BuildError 빌드 준비 중 오류가 발생한 경우
DeviceNotAvailableException 장치가 응답하지 않는 경우

보호된 방법

checkPreload모듈

protected void checkPreloadModules (TestInformation testInfo, 
                DeviceDescriptor deviceDescriptor)

사전 로드 모듈 정보 확인

매개변수
testInfo TestInformation : 시험 정보

deviceDescriptor DeviceDescriptor

던지다
DeviceNotAvailableException 사용할 수 있는 장치가 없으면 예외가 발생합니다.
TargetSetupError 모듈이 미리 로드되지 않은 경우 예외가 발생합니다.

getApk디렉토리

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 장치를 찾을 수 없으면 예외가 발생합니다.

푸시파일

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

apex의 경우 /system/apex/ 또는 apk의 경우 /system/**으로 파일을 푸시합니다.

매개변수
moduleFile File : 모듈 파일

testInfo TestInformation 다음 TestInformation 호출합니다.

보고
ModuleOemTargetPreparer.ModuleInfo

던지다
TargetSetupError adb를 통해 파일을 푸시할 수 없는 경우
DeviceNotAvailableException 장치를 사용할 수 없는 경우

파일명 변경

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

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

매개변수
device ITestDevice : 테스트 장치

moduleFile File : 모듈 파일이 설치된다

packageName String : 이름으로 / 시스템 / *

보고
String 이름 변경 후 새 파일 이름

던지다
TargetSetupError 파일 이름을 변경할 수 없는 경우
DeviceNotAvailableException

설정장치

protected void setupDevice (TestInformation testInfo)

/system에서 파일을 푸시하기 전에 adb 루트 및 장치 다시 마운트

매개변수
testInfo TestInformation 다음 TestInformation 호출합니다.

던지다
TargetSetupError 장치를 다시 마운트할 수 없는 경우.
DeviceNotAvailableException