ITargetPreparer

public interface ITargetPreparer
implements IDisableable

com.android.tradefed.targetprep.ITargetPreparer


테스트 실행을 위한 테스트 환경을 준비합니다.

예를 들어 소프트웨어 설치, 테스트를 위한 환경 설정 조정, 대상 실행 등입니다.

구성에서 여러 ITargetPreparer 를 지정할 수 있습니다. 각 ITargetPreparer는 예상 환경 사전 설정 및 사후 설정을 명확하게 문서화하는 것이 좋습니다. 예를 들어 테스트를 위해 장치를 구성하는 ITargetPreparer는 소프트웨어를 설치하는 ITargetPreparer 다음에 실행되어야 합니다.

요약

공개 방법

default void setUp ( ITestDevice device, IBuildInfo buildInfo)

이 방법은 더 이상 사용되지 않습니다. 대신 setUp(com.android.tradefed.invoker.TestInformation) 사용하세요.

default void setUp ( TestInformation testInformation)

테스트를 위해 대상 설정을 수행합니다.

default void tearDown ( TestInformation testInformation, Throwable e)

테스트 후 대상 정리/해제를 수행합니다.

default void tearDown ( ITestDevice device, IBuildInfo buildInfo, Throwable e)

이 방법은 더 이상 사용되지 않습니다. 대신 tearDown(com.android.tradefed.invoker.TestInformation, Throwable) 사용하세요.

공개 방법

설정

public void setUp (ITestDevice device, 
                IBuildInfo buildInfo)

이 방법은 더 이상 사용되지 않습니다.
대신 setUp(com.android.tradefed.invoker.TestInformation) 사용하세요.

테스트를 위해 대상 설정을 수행합니다.

매개변수
device ITestDevice : 준비할 ITestDevice .

buildInfo IBuildInfo : 테스트 중인 빌드에 대한 데이터입니다.

던지기
TargetSetupError 치명적인 오류가 발생한 경우 환경 설정
BuildError BuildInfo 관련 오류가 발생한 경우
DeviceNotAvailableException 장치가 응답하지 않는 경우

설정

public void setUp (TestInformation testInformation)

테스트를 위해 대상 설정을 수행합니다.

매개변수
testInformation TestInformation : 호출의 TestInformation .

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

tearDown

public void tearDown (TestInformation testInformation, 
                Throwable e)

테스트 후 대상 정리/해제를 수행합니다.

매개변수
testInformation TestInformation : 호출의 TestInformation .

e Throwable : 호출이 예외로 종료된 경우 호출 수준에서 포착된 예외입니다. 그렇지 않으면 null 됩니다.

던지기
DeviceNotAvailableException 장치가 응답하지 않는 경우

tearDown

public void tearDown (ITestDevice device, 
                IBuildInfo buildInfo, 
                Throwable e)

이 방법은 더 이상 사용되지 않습니다.
대신 tearDown(com.android.tradefed.invoker.TestInformation, Throwable) 사용하세요.

테스트 후 대상 정리/해제를 수행합니다.

매개변수
device ITestDevice : 준비할 ITestDevice .

buildInfo IBuildInfo : 테스트 중인 빌드에 대한 데이터입니다.

e Throwable : 호출이 예외로 종료된 경우 호출 수준에서 포착된 예외입니다. 그렇지 않으면 null 됩니다.

던지기
DeviceNotAvailableException 장치가 응답하지 않는 경우