ResultAggregator

public class ResultAggregator
extends CollectingTestListener

java.lang.Object
   ↳ com.android.tradefed.result.CollectingTestListener
     ↳ com.android.tradefed.retry.ResultAggregator


필요한 경우 시도 전략에 따라 결과를 집계하는 특수 포워더입니다.

요약

공개 생성자

ResultAggregator(List<ITestInvocationListener> listeners, RetryStrategy strategy)

공개 메서드

void cleanEventsFiles()
final void forwardAggregatedInvocationLogs()

세부 결과를 지원하지 않는 결과 보고자에게 모든 호출 수준 로그를 전달합니다.

void invocationEnded(long elapsedTime)

호출이 성공적으로 종료되었는지 아니면 오류 조건으로 인해 종료되었는지 보고합니다.

void invocationFailed(FailureDescription failure)

void invocationFailed(Throwable cause)

오류 조건으로 인해 불완전한 호출을 보고합니다.

void invocationSkipped(SkipReason reason)

호출을 건너뛴 것으로 보고합니다.

void invocationStarted(IInvocationContext context)

테스트 호출의 시작을 보고합니다.

void logAssociation(String dataName, LogFile logFile)

경우에 따라 로그가 테스트 사례와 강력하게 연결되어야 하지만 직접 testLogSaved(String,LogDataType,InputStreamSource,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, HashMap<String, MetricMeasurement.Metric> testMetrics)

종료 시간을 직접 지정할 수 있는 testEnded(TestDescription,Map)의 대안입니다.

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, HashMap<String, MetricMeasurement.Metric> runMetrics)

테스트 실행의 종료를 보고합니다.

void testRunFailed(FailureDescription failure)

FailureDescription에 설명된 실패로 인해 테스트 실행이 완료되지 않았다고 보고합니다.

void testRunFailed(String errorMessage)

심각한 오류로 인해 보고서 테스트 실행을 완료하지 못했습니다.

void testRunStarted(String name, int testCount, int attemptNumber, long startTime)

테스트 실행 시작을 보고합니다.

void testSkipped(TestDescription test, SkipReason reason)

테스트가 건너뛰고 일반적으로 예상되지 않는 이유로 실행되지 않은 경우 호출됩니다.

void testStarted(TestDescription test, long startTime)

테스트가 시작된 시점도 지정하는 testStarted(TestDescription)의 대안으로, 정확한 측정을 위해 testEnded(TestDescription,long,Map)와 결합됩니다.

보호된 메서드

File[] getEventsLogs()

공개 생성자

ResultAggregator

public ResultAggregator (List<ITestInvocationListener> listeners, 
                RetryStrategy strategy)

매개변수
listeners List

strategy RetryStrategy

공개 메서드

cleanEventsFiles

public void cleanEventsFiles ()

forwardAggregatedInvocationLogs

public final void forwardAggregatedInvocationLogs ()

세부 결과를 지원하지 않는 결과 보고자에게 모든 호출 수준 로그를 전달합니다.

invocationEnded

public void invocationEnded (long elapsedTime)

호출이 성공적으로 종료되었는지 아니면 오류 조건으로 인해 종료되었는지 보고합니다.

TradeFederation 프레임워크에 의해 자동으로 호출됩니다.

매개변수
elapsedTime long: 호출의 경과 시간(밀리초)

invocationFailed

public void invocationFailed (FailureDescription failure)

매개변수
failure FailureDescription

invocationFailed

public void invocationFailed (Throwable cause)

오류 조건으로 인해 불완전한 호출을 보고합니다.

TradeFederation 프레임워크에 의해 자동으로 호출됩니다.

매개변수
cause Throwable: 실패의 Throwable 원인

invocationSkipped

public void invocationSkipped (SkipReason reason)

호출을 건너뛴 것으로 보고합니다.

매개변수
reason SkipReason

invocationStarted

public void invocationStarted (IInvocationContext context)

테스트 호출의 시작을 보고합니다.

TradeFederation 프레임워크에 의해 자동으로 호출됩니다. 리포터는 여러 기기 보고를 지원하기 위해 이 메서드를 재정의해야 합니다.

매개변수
context IInvocationContext: 호출에 관한 정보

logAssociation

public void logAssociation (String dataName, 
                LogFile logFile)

경우에 따라 로그가 테스트 사례와 강력하게 연결되어야 하지만 직접 testLogSaved(String,LogDataType,InputStreamSource,LogFile) 콜백에서 이렇게 할 수는 없습니다. 따라서 이 콜백을 사용하면 강력한 연결을 명시적으로 제공할 수 있습니다.

매개변수
dataName String: 데이터의 이름

logFile LogFile: 이전에 로깅되었으며 테스트 사례와 연결되어야 하는 LogFile입니다.

setLogSaver

public void setLogSaver (ILogSaver logSaver)

매개변수
logSaver ILogSaver

setUpdatedReporting

public void setUpdatedReporting (boolean updatedReporting)

새 보고서를 설정합니다.

매개변수
updatedReporting boolean

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

원자 테스트에서 거짓인 조건을 가정한다고 표시할 때 호출됩니다.

매개변수
test TestDescription: 테스트를 식별합니다.

trace String: 실패의 스택 트레이스

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

원자 테스트에서 거짓인 조건을 가정한다고 표시할 때 호출됩니다.

매개변수
test TestDescription: 테스트를 식별합니다.

failure FailureDescription: 실패 및 컨텍스트를 설명하는 FailureDescription입니다.

testEnded

public void testEnded (TestDescription test, 
                long endTime, 
                HashMap<String, MetricMeasurement.Metric> testMetrics)

종료 시간을 직접 지정할 수 있는 testEnded(TestDescription,Map)의 대안입니다. 정확한 측정을 위해 testStarted(TestDescription,long)와 결합하세요.

매개변수
test TestDescription: 테스트를 식별합니다.

endTime long: 테스트가 종료된 시간입니다(System.currentTimeMillis()을 통해 측정됨).

testMetrics HashMap: 내보낸 측정항목의 Map

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

개별 테스트 사례의 실패를 보고합니다.

testStarted와 testEnded 사이에 호출됩니다.

매개변수
test TestDescription: 테스트를 식별합니다.

failure FailureDescription: 실패 및 컨텍스트를 설명하는 FailureDescription입니다.

testFailed

public void testFailed (TestDescription test, 
                String trace)

개별 테스트 사례의 실패를 보고합니다.

testStarted와 testEnded 사이에 호출됩니다.

매개변수
test TestDescription: 테스트를 식별합니다.

trace String: 실패의 스택 트레이스

testIgnored

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

testLogSaved

public void testLogSaved (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream, 
                LogFile logFile)

매개변수
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

testModuleEnded

public void testModuleEnded ()

모듈 실행의 끝을 보고합니다.

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

실행 중인 모듈의 시작을 보고합니다. 이 콜백은 testModuleEnded()와 연결되어 있으며 시퀀스에서 선택사항입니다. 모듈을 사용하는 실행(스위트 기반 러너) 중에만 사용됩니다.

매개변수
moduleContext IInvocationContext: 모듈의 IInvocationContext입니다.

testRunEnded

public void testRunEnded (long elapsedTime, 
                HashMap<String, MetricMeasurement.Metric> runMetrics)

테스트 실행의 종료를 보고합니다. FIXME: 유형이 다른 Map<> 인터페이스 두 개를 사용할 수 없으므로 여기서는 HashMap을 사용해야 합니다.

매개변수
elapsedTime long: 기기에서 보고한 경과 시간(밀리초)

runMetrics HashMap: Metric로 테스트 실행이 끝날 때 보고되는 키-값 쌍입니다.

testRunFailed

public void testRunFailed (FailureDescription failure)

FailureDescription에 설명된 실패로 인해 테스트 실행이 완료되지 않았다고 보고합니다.

매개변수
failure FailureDescription: 실패 및 컨텍스트를 설명하는 FailureDescription입니다.

testRunFailed

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의 여러 시도를 식별하는 주문 번호입니다. attemptNumber는 0부터 시작하며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트가 상세하게 3번 재시도되면 동일한 runName 아래에 총 4번의 실행이 있어야 하며 attemptNumber는 0~3입니다.

startTime long: System.currentTimeMillis()을 통해 측정된 실행 시작 시간

testSkipped

public void testSkipped (TestDescription test, 
                SkipReason reason)

테스트가 건너뛰고 일반적으로 예상되지 않는 이유로 실행되지 않은 경우 호출됩니다. 이러한 테스트는 적절한 실행을 위해 다시 시도됩니다.

매개변수
test TestDescription: 테스트를 식별합니다.

reason SkipReason: SkipReason

testStarted

public void testStarted (TestDescription test, 
                long startTime)

테스트가 시작된 시점도 지정하는 testStarted(TestDescription)의 대안으로, 정확한 측정을 위해 testEnded(TestDescription,long,Map)와 결합됩니다.

매개변수
test TestDescription: 테스트를 식별합니다.

startTime long: 테스트가 시작된 시간입니다(System.currentTimeMillis()을 통해 측정됨).

보호된 메서드

getEventsLogs

protected File[] getEventsLogs ()

반환
File[]