호출 실행
public class InvocationExecution
extends Object
implements IInvocationExecution
java.lang.객체 | |
↳ | com.android.tradefed.invoker.InvocationExecution |
모든 호출 단계를 설명하는 클래스: 빌드 다운로드, target_prep, 테스트 실행, 정리. 일부 단계의 기본 동작을 재정의하도록 확장할 수 있습니다. 단계의 순서는 TestInvocation
에 의해 결정됩니다.
요약
필드 | |
---|---|
public static final String | ADB_VERSION_KEY |
public static final String | JAVA_CLASSPATH_KEY |
public static final String | JAVA_VERSION_KEY
|
공개 생성자 | |
---|---|
InvocationExecution () |
공개 방법 | |
---|---|
void | cleanUpBuilds ( IInvocationContext context, IConfiguration config) build_provider 정리 단계를 실행합니다. |
void | doCleanUp ( IInvocationContext context, IConfiguration config, Throwable exception) target_preparer 및 multi_target_preparer 정리 단계를 실행합니다. |
void | doSetup ( TestInformation testInfo, IConfiguration config, ITestLogger listener) target_preparer 및 multi_target_preparer 설정 단계를 실행합니다. |
void | doTeardown ( TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception) target_preparer 및 multi_target_preparer 분해 단계를 실행합니다. |
boolean | fetchBuild ( TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener) 호출의 build_provider 단계를 실행합니다. |
void | reportLogs ( ITestDevice device, ITestLogger listener, TestInvocation.Stage stage) 호출의 다른 단계에서 일부 장치 로그를 보고합니다. |
void | runDevicePostInvocationTearDown ( IInvocationContext context, IConfiguration config, Throwable exception) 호출의 각 장치 부분에 대해 |
void | runDevicePreInvocationSetup ( IInvocationContext context, IConfiguration config, ITestLogger logger) 호출의 각 장치 부분에 대해 |
void | runTests ( TestInformation info, IConfiguration config, ITestInvocationListener listener) 테스트를 실행합니다. |
boolean | shardConfig ( IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger) 여러 리소스에서 병렬로 실행되도록 다시 예약하기 위해 구성을 하위 구성으로 샤딩하려고 시도합니다. |
보호된 메서드 | |
---|---|
void | collectAutoInfo ( IConfiguration config, TestInformation info) 테스트 중인 기본 장치에 대한 일부 정보를 자동으로 수집합니다. |
IShardHelper | createShardHelper () 사용할 |
void | customizeDevicePreInvocation ( IConfiguration config, IInvocationContext context) preInvocationSetup 전에 일부 장치를 사용자 정의할 수 있는 기회를 제공하십시오. |
String | getAdbVersion () 호출에 사용 중인 adb 버전을 반환합니다. |
getLabPreparersToRun ( IConfiguration config, String deviceName) 이 장치에서 실행할 랩 준비자 목록을 검색합니다. | |
getTargetPreparersToRun ( IConfiguration config, String deviceName) 이 장치에서 실행할 대상 준비자 목록을 검색합니다. | |
void | logHostAdb ( IConfiguration config, ITestLogger logger) $TMPDIR/adb.$UID.log에서 로그를 수집합니다. |
Throwable | runPreparersTearDown ( TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap) runPreparersTearDown ( TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap) runPreparersTearDown ( TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception, preparersToRun, trackPreparersMap) |
void | setTestTag ( IBuildInfo info, IConfiguration config) 빌드 정보에서 테스트 태그 설정을 처리합니다. |
필드
ADB_VERSION_KEY
public static final String ADB_VERSION_KEY
JAVA_CLASSPATH_KEY
public static final String JAVA_CLASSPATH_KEY
자바_버전_키
public static final String JAVA_VERSION_KEY
공개 생성자
호출 실행
public InvocationExecution ()
공개 방법
cleanUpBuilds
public void cleanUpBuilds (IInvocationContext context, IConfiguration config)
build_provider 정리 단계를 실행합니다. 빌드 가져오기와 연결됩니다.
매개변수 | |
---|---|
context | IInvocationContext : 호출의 IInvocationContext . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
클린업을 하다
public void doCleanUp (IInvocationContext context, IConfiguration config, Throwable exception)
target_preparer 및 multi_target_preparer 정리 단계를 실행합니다. 장치가 정리됩니까?
매개변수 | |
---|---|
context | IInvocationContext : 호출의 IInvocationContext . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
exception | Throwable : 테스트 실행으로 발생한 원래 예외입니다. |
doSetup
public void doSetup (TestInformation testInfo, IConfiguration config, ITestLogger listener)
target_preparer 및 multi_target_preparer 설정 단계를 실행합니다. 테스트 실행에 필요한 모든 장치 설정을 수행합니다.
매개변수 | |
---|---|
testInfo | TestInformation : 호출의 TestInformation . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
listener | ITestLogger : 설정 실패 로그를 보고하는 ITestLogger . |
던지기 | |
---|---|
BuildError | |
DeviceNotAvailableException | |
TargetSetupError |
doTeardown
public void doTeardown (TestInformation testInfo, IConfiguration config, ITestLogger logger, Throwable exception)
target_preparer 및 multi_target_preparer 분해 단계를 실행합니다. 설정과 관련된 장치가 분해됩니까?
매개변수 | |
---|---|
testInfo | TestInformation : 호출의 TestInformation . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
logger | ITestLogger : 로그를 보고하는 ITestLogger . |
exception | Throwable : 테스트 실행으로 발생한 원래 예외입니다. |
가져오기 빌드
public boolean fetchBuild (TestInformation testInfo, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener listener)
호출의 build_provider 단계를 실행합니다.
매개변수 | |
---|---|
testInfo | TestInformation : 호출의 TestInformation . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
rescheduler | IRescheduler : IRescheduler , 다른 리소스에서 실행하기 위해 호출 부분을 다시 예약하기 위한 것입니다. |
listener | ITestInvocationListener : 빌드 다운로드 실패를 보고하기 위한 ITestInvocation . |
보고 | |
---|---|
boolean | 빌드를 성공적으로 다운로드한 경우 True, 그렇지 않은 경우 False입니다. |
던지기 | |
---|---|
BuildRetrievalError | |
DeviceNotAvailableException |
reportLogs
public void reportLogs (ITestDevice device, ITestLogger listener, TestInvocation.Stage stage)
호출의 다른 단계에서 일부 장치 로그를 보고합니다. 예를 들면 다음과 같습니다.
매개변수 | |
---|---|
device | ITestDevice : 로그를 보고할 장치입니다. |
listener | ITestLogger : 로그에 대한 로거입니다. |
stage | TestInvocation.Stage : 현재 호출 단계입니다. |
runDevicePostInvocationTearDown
public void runDevicePostInvocationTearDown (IInvocationContext context, IConfiguration config, Throwable exception)
호출의 각 장치 부분에 대해 ITestDevice#postInvocationTearDown(Throwable)
호출하십시오.
매개변수 | |
---|---|
context | IInvocationContext : 호출의 IInvocationContext . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
exception | Throwable : 실행 중인 테스트에서 발생한 원래 예외입니다. |
runDevicePreInvocationSetup
public void runDevicePreInvocationSetup (IInvocationContext context, IConfiguration config, ITestLogger logger)
호출의 각 장치 부분에 대해 ERROR(ITestDevice#preInvocationSetup(IBuildInfo)/com.android.tradefed.device.ITestDevice#preInvocationSetup(com.android.tradefed.build.IBuildInfo) ITestDevice#preInvocationSetup(IBuildInfo))
호출합니다.
매개변수 | |
---|---|
context | IInvocationContext : 호출의 IInvocationContext . |
config | IConfiguration : 이 테스트 실행의 IConfiguration . |
logger | ITestLogger : 로그를 보고하는 ITestLogger . |
던지기 | |
---|---|
DeviceNotAvailableException | |
TargetSetupError |
runTests
public void runTests (TestInformation info, IConfiguration config, ITestInvocationListener listener)
테스트를 실행합니다.
매개변수 | |
---|---|
info | TestInformation : 테스트를 실행할 TestInformation 입니다. |
config | IConfiguration : 실행할 IConfiguration |
listener | ITestInvocationListener : 테스트 결과의 ITestInvocationListener |
shardConfig
public boolean shardConfig (IConfiguration config, TestInformation testInfo, IRescheduler rescheduler, ITestLogger logger)
여러 리소스에서 병렬로 실행되도록 다시 예약하기 위해 구성을 하위 구성으로 샤딩하려고 시도합니다.
샤드 수가 1보다 크면 샤드 인덱스를 설정하고 다시 예약하여 각 샤드에 대한 구성을 생성합니다. 샤드 수가 설정되지 않은 경우 IShardHelper#shardConfig
로 대체됩니다.
매개변수 | |
---|---|
config | IConfiguration : 현재 IConfiguration . |
testInfo | TestInformation : 테스트 정보를 담고 있는 TestInformation . |
rescheduler | IRescheduler : IRescheduler . |
logger | ITestLogger : 샤딩 중에 파일을 기록하는 데 사용되는 ITestLogger . |
보고 | |
---|---|
boolean | 테스트가 샤딩된 경우 true입니다. 그렇지 않으면 false 반환 |
보호된 메서드
자동 정보 수집
protected void collectAutoInfo (IConfiguration config, TestInformation info)
테스트 중인 기본 장치에 대한 일부 정보를 자동으로 수집합니다.
매개변수 | |
---|---|
config | IConfiguration |
info | TestInformation |
던지기 | |
---|---|
DeviceNotAvailableException |
createShardHelper
protected IShardHelper createShardHelper ()
사용할 IShardHelper
반환을 만듭니다.
보고 | |
---|---|
IShardHelper |
customizeDevicePreInvocation
protected void customizeDevicePreInvocation (IConfiguration config, IInvocationContext context)
preInvocationSetup 전에 일부 장치를 사용자 정의할 수 있는 기회를 제공하십시오.
매개변수 | |
---|---|
config | IConfiguration : 호출 구성입니다. |
context | IInvocationContext : 현재 호출 컨텍스트입니다. |
getAdbVersion
protected String getAdbVersion ()
호출에 사용 중인 adb 버전을 반환합니다.
보고 | |
---|---|
String |
getLabPreparersToRun
protectedgetLabPreparersToRun (IConfiguration config, String deviceName)
이 장치에서 실행할 랩 준비자 목록을 검색합니다.
랩 준비자가 샌드박스 하위 내부에서 실행되는 것을 제한하기 위해 샌드박스 클래스에서 재정의됨
매개변수 | |
---|---|
config | IConfiguration |
deviceName | String |
보고 | |
---|---|
getTargetPreparersToRun
protectedgetTargetPreparersToRun (IConfiguration config, String deviceName)
이 장치에서 실행할 대상 준비자 목록을 검색합니다.
랩 준비자가 샌드박스 하위 내부에서 실행되는 것을 제한하기 위해 샌드박스 클래스에서 재정의됨
매개변수 | |
---|---|
config | IConfiguration |
deviceName | String |
보고 | |
---|---|
logHostAdb
protected void logHostAdb (IConfiguration config, ITestLogger logger)
$TMPDIR/adb.$UID.log에서 로그를 수집합니다.
매개변수 | |
---|---|
config | IConfiguration |
logger | ITestLogger |
runPreparersTearDown
protected Throwable runPreparersTearDown (TestInformation testInfo, ITestDevice device, String deviceName, int deviceIndex, ITestLogger logger, Throwable exception,preparersToRun, trackPreparersMap)
매개변수 | |
---|---|
testInfo | TestInformation |
device | ITestDevice |
deviceName | String |
deviceIndex | int |
logger | ITestLogger |
exception | Throwable |
preparersToRun | |
trackPreparersMap |
보고 | |
---|---|
Throwable |
setTestTag
protected void setTestTag (IBuildInfo info, IConfiguration config)
빌드 정보에서 테스트 태그 설정을 처리합니다.
매개변수 | |
---|---|
info | IBuildInfo |
config | IConfiguration |