결과 수집자
public class ResultAggregator
extends CollectingTestListener
java.lang.Object | ||
↳ | com.android.tradefed.result.CollectingTestListener | |
↳ | com.android.tradefed.retry.ResultAggregator |
수행된 재시도 전략에 따라 필요할 때 결과를 집계하는 특수 전달자입니다.
요약
공개 생성자 | |
---|---|
ResultAggregator ( listeners, RetryStrategy strategy) ResultAggregator ( listeners, RetryStrategy strategy) |
공개 메소드 | |
---|---|
void | cleanEventsFiles () |
final void | forwardAggregatedInvocationLogs () 세부적인 결과를 지원하지 않는 결과 보고자에게 모든 호출 수준 로그를 전달합니다. |
void | invocationEnded (long elapsedTime) 성공적으로 또는 일부 오류 조건으로 인해 호출이 종료되었음을 보고합니다. |
void | invocationFailed ( FailureDescription failure) |
void | invocationFailed (Throwable cause) 일부 오류 조건으로 인해 불완전한 호출을 보고합니다. |
void | invocationStarted ( IInvocationContext context) 테스트 호출의 시작을 보고합니다. |
void | logAssociation (String dataName, LogFile logFile) 어떤 경우에는 로그가 테스트 케이스와 강력하게 연관되어야 하지만 직접 |
void | setLogSaver ( ILogSaver logSaver) |
void | setUpdatedReporting (boolean updatedReporting) 새로운 보고를 설정합니다. |
void | testAssumptionFailure ( TestDescription test, String trace) 원자 테스트에서 거짓 조건을 가정한다고 플래그를 지정할 때 호출됩니다. |
void | testAssumptionFailure ( TestDescription test, FailureDescription failure) 원자 테스트에서 거짓 조건을 가정한다고 플래그를 지정할 때 호출됩니다. |
void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) 종료 시간을 직접 지정할 수 |
void | testFailed ( TestDescription test, FailureDescription failure) 개별 테스트 사례의 실패를 보고합니다. |
void | testFailed ( TestDescription test, String trace) 개별 테스트 사례의 실패를 보고합니다. |
void | testIgnored ( TestDescription test) 일반적으로 테스트 메서드에 org.junit.Ignore라는 주석이 달려 있기 때문에 테스트가 실행되지 않을 때 호출됩니다. |
void | testLog (String dataName, LogDataType dataType, InputStreamSource dataStream) |
void | testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile) |
void | testModuleEnded () 모듈 실행 종료를 보고합니다. |
void | testModuleStarted ( IInvocationContext moduleContext) 실행 중인 모듈의 시작을 보고합니다. |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) 테스트 실행 종료를 보고합니다. |
void | testRunFailed ( FailureDescription failure) |
void | testRunFailed (String errorMessage) 치명적인 오류로 인해 테스트 실행을 완료하지 못했습니다. |
void | testRunStarted (String name, int testCount, int attemptNumber, long startTime) 테스트 실행의 시작을 보고합니다. |
void | testStarted ( TestDescription test, long startTime) 정확한 측정을 위해 |
보호된 방법 | |
---|---|
File[] | getEventsLogs () |
공개 생성자
결과 수집자
public ResultAggregator (listeners, RetryStrategy strategy)
매개변수 | |
---|---|
listeners | |
strategy | RetryStrategy |
공개 메소드
cleanEvents파일
public void cleanEventsFiles ()
앞으로 AggregatedInvocationLogs
public final void forwardAggregatedInvocationLogs ()
세부적인 결과를 지원하지 않는 결과 보고자에게 모든 호출 수준 로그를 전달합니다.
호출종료됨
public void invocationEnded (long elapsedTime)
성공적으로 또는 일부 오류 조건으로 인해 호출이 종료되었음을 보고합니다.
TradeFederation 프레임워크에 의해 자동으로 호출됩니다.매개변수 | |
---|---|
elapsedTime | long : 호출 경과 시간(ms) |
호출 실패
public void invocationFailed (Throwable cause)
일부 오류 조건으로 인해 불완전한 호출을 보고합니다.
TradeFederation 프레임워크에 의해 자동으로 호출됩니다.매개변수 | |
---|---|
cause | Throwable : Throwable 실패 원인 |
호출시작됨
public void invocationStarted (IInvocationContext context)
테스트 호출의 시작을 보고합니다.
TradeFederation 프레임워크에 의해 자동으로 호출됩니다. 보고자는 여러 장치 보고를 지원하기 위해 이 방법을 재정의해야 합니다.
매개변수 | |
---|---|
context | IInvocationContext : 호출에 대한 정보 |
로그 연관
public void logAssociation (String dataName, LogFile logFile)
어떤 경우에는 로그가 테스트 케이스와 강력하게 연관되어야 하지만 직접 testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)
에서 그렇게 할 수 있는 기회가 있습니다. testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)
콜백이 불가능합니다. 따라서 이 콜백을 사용하면 명시적으로 강력한 연관을 제공할 수 있습니다.
매개변수 | |
---|---|
dataName | String : 데이터의 이름 |
logFile | LogFile : 이전에 기록되었으며 테스트 사례와 연결되어야 하는 LogFile 입니다. |
setUpdated보고
public void setUpdatedReporting (boolean updatedReporting)
새로운 보고를 설정합니다.
매개변수 | |
---|---|
updatedReporting | boolean |
테스트가정실패
public void testAssumptionFailure (TestDescription test, String trace)
원자 테스트에서 거짓 조건을 가정한다고 플래그를 지정할 때 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
trace | String : 실패 스택 추적 |
테스트가정실패
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
원자 테스트에서 거짓 조건을 가정한다고 플래그를 지정할 때 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
failure | FailureDescription : 실패와 해당 컨텍스트를 설명하는 FailureDescription . |
테스트 종료됨
public void testEnded (TestDescription test, long endTime,testMetrics)
종료 시간을 직접 지정할 수 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))
의 대안입니다. 정확한 측정을 위해 testStarted(com.android.tradefed.result.TestDescription, long)
와 결합하세요.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
endTime | long : System.currentTimeMillis() 통해 측정된 테스트 종료 시간 |
testMetrics | ERROR(/Map) |
테스트 실패
public void testFailed (TestDescription test, FailureDescription failure)
개별 테스트 사례의 실패를 보고합니다.
testStarted와 testEnded 사이에 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
failure | FailureDescription : 실패와 해당 컨텍스트를 설명하는 FailureDescription . |
테스트 실패
public void testFailed (TestDescription test, String trace)
개별 테스트 사례의 실패를 보고합니다.
testStarted와 testEnded 사이에 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
trace | String : 실패 스택 추적 |
테스트는 무시됨
public void testIgnored (TestDescription test)
일반적으로 테스트 메서드에 org.junit.Ignore라는 주석이 달려 있기 때문에 테스트가 실행되지 않을 때 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
테스트로그
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
매개변수 | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
테스트로그저장됨
public void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
매개변수 | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
logFile | LogFile |
테스트모듈종료됨
public void testModuleEnded ()
모듈 실행 종료를 보고합니다.
테스트모듈시작됨
public void testModuleStarted (IInvocationContext moduleContext)
실행 중인 모듈의 시작을 보고합니다. 이 콜백은 testModuleEnded()
와 연결되어 있으며 시퀀스에서 선택 사항입니다. 모듈 기반 실행기 등을 사용하는 실행 중에만 사용됩니다.
매개변수 | |
---|---|
moduleContext | IInvocationContext : 모듈의 IInvocationContext . |
테스트실행이 종료됨
public void testRunEnded (long elapsedTime,runMetrics)
테스트 실행 종료를 보고합니다. FIXME: 서로 다른 유형의 두 개의 Map<> 인터페이스를 가질 수 없으므로 여기서는 HashMap을 사용해야 합니다.
매개변수 | |
---|---|
elapsedTime | long : 장치가 보고한 경과 시간(밀리초) |
runMetrics | Metric 사용한 테스트 실행이 끝나면 보고된 키-값 쌍입니다. |
테스트실행실패
public void testRunFailed (FailureDescription failure)
FailureDescription
에 설명된 오류로 인해 보고서 테스트 실행을 완료하지 못했습니다.
매개변수 | |
---|---|
failure | FailureDescription : 실패와 해당 컨텍스트를 설명하는 FailureDescription . |
테스트실행실패
public void testRunFailed (String errorMessage)
치명적인 오류로 인해 테스트 실행을 완료하지 못했습니다.
매개변수 | |
---|---|
errorMessage | String : 실행 실패 이유를 설명하는 String 입니다. |
테스트실행시작됨
public void testRunStarted (String name, int testCount, int attemptNumber, long startTime)
테스트 실행의 시작을 보고합니다.
매개변수 | |
---|---|
name | String : 테스트 실행 이름 |
testCount | int : 테스트 실행의 총 테스트 수 |
attemptNumber | int : 여러 번 실행되는 동일한 runName의 다양한 시도를 식별하는 주문 번호입니다. tryNumber는 0부터 인덱스가 지정되며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트는 세 번 세분화되어 재시도됩니다. 동일한 runName에서 총 4번의 실행이 있어야 하며, tryNumber는 0에서 3 사이입니다. |
startTime | long : System.currentTimeMillis() 통해 측정된 실행이 시작된 시간 |
테스트시작됨
public void testStarted (TestDescription test, long startTime)
정확한 측정을 위해 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))
와 결합하여 테스트 시작 시기도 지정하는 testStarted(com.android.tradefed.result.TestDescription)
의 대안입니다. .
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
startTime | long : System.currentTimeMillis() 통해 측정된 테스트가 시작된 시간입니다. |
보호된 방법
getEventsLogs
protected File[] getEventsLogs ()
보고 | |
---|---|
File[] |