ResultAggregator
public class ResultAggregator
extends CollectingTestListener
java.lang.객체 | ||
↳ | 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) false인 조건을 가정한다고 원자성 테스트 플래그가 표시될 때 호출됩니다. |
void | testAssumptionFailure ( TestDescription test, FailureDescription failure) false인 조건을 가정한다고 원자성 테스트 플래그가 표시될 때 호출됩니다. |
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 () |
공개 생성자
ResultAggregator
public ResultAggregator (listeners, RetryStrategy strategy)
매개변수 | |
---|---|
listeners | |
strategy | RetryStrategy |
공개 방법
cleanEvents파일
public void cleanEventsFiles ()
forwardAggregatedInvocationLogs
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 입니다. |
setUpdatedReporting
public void setUpdatedReporting (boolean updatedReporting)
새 보고를 설정합니다.
매개변수 | |
---|---|
updatedReporting | boolean |
테스트 가정 실패
public void testAssumptionFailure (TestDescription test, String trace)
false인 조건을 가정한다고 원자성 테스트 플래그가 표시될 때 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
trace | String : 실패 스택 추적 |
테스트 가정 실패
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
false인 조건을 가정한다고 원자성 테스트 플래그가 표시될 때 호출됩니다.
매개변수 | |
---|---|
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 : 테스트를 식별합니다. |
testLog
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
매개변수 | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
testLog저장됨
public void testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
매개변수 | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
logFile | LogFile |
testModuleEnded
public void testModuleEnded ()
모듈 실행의 끝을 보고합니다.
testModule시작됨
public void testModuleStarted (IInvocationContext moduleContext)
실행 중인 모듈의 시작을 보고합니다. 이 콜백은 testModuleEnded()
와 연결되며 시퀀스에서 선택 사항입니다. 모듈 기반 러너를 사용하는 실행 중에만 사용됩니다.
매개변수 | |
---|---|
moduleContext | IInvocationContext : 모듈의 IInvocationContext . |
testRunEnded
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 입니다. |
testRunStarted
public void testRunStarted (String name, int testCount, int attemptNumber, long startTime)
테스트 실행의 시작을 보고합니다.
매개변수 | |
---|---|
name | String : 테스트 실행 이름 |
testCount | int : 테스트 실행의 총 테스트 수 |
attemptNumber | int : 여러 번 실행되는 동일한 runName의 다른 시도를 식별하는 순서 번호입니다. tryNumber는 인덱스가 0이며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트가 3번 세부적으로 재시도되고 동일한 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[] |