SubprocessResultsReporter

public class SubprocessResultsReporter
extends Object implements ILogSaverListener, ISupportGranularResults, ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.result.SubprocessResultsReporter


ITestInvocationListener를 구현하여 result_reporter로 지정하고 테스트, 테스트 실행, 테스트 호출의 결과를 하위 프로세스에서 전달합니다.

요약

공개 생성자

SubprocessResultsReporter()

공개 메서드

void close()

TestSummary getSummary()

InvocationListener가 요약을 반환하도록 허용합니다.

void invocationEnded(long elapsedTime)

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

void invocationFailed(FailureDescription failure)

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

void invocationFailed(Throwable cause)

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

void invocationStarted(IInvocationContext context)

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

void logAssociation(String dataName, LogFile logFile)

경우에 따라 로그를 테스트 사례와 밀접하게 연결해야 하지만 직접 testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile) 콜백에서는 이를 실행할 수 없습니다.

void printEvent(String key, Object event)

이벤트 키와 JSON 객체를 차례로 출력하는 도우미입니다.

void setOutputTestLog(boolean outputTestLog)

로깅된 테스트를 출력할지 여부를 설정합니다.

boolean supportGranularResults()

보고 도구가 세부적인 결과를 지원하면 true를, 그렇지 않으면 false를 반환합니다.

void testAssumptionFailure(TestDescription testId, String trace)

원자 테스트에서 거짓인 조건을 가정한다고 플래그를 지정할 때 호출됩니다.

void testAssumptionFailure(TestDescription testId, FailureDescription failure)

원자 테스트에서 거짓인 조건을 가정한다고 플래그를 지정할 때 호출됩니다.

void testEnded(TestDescription testId, long endTime, metrics)

종료 시간을 직접 지정할 수 있는 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))의 대안입니다.

void testEnded(TestDescription testId, metrics)

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

void testFailed(TestDescription testId, FailureDescription failure)

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

void testFailed(TestDescription testId, String reason)

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

void testIgnored(TestDescription testId)

테스트가 실행되지 않을 때 호출됩니다(일반적으로 테스트 메서드에 org.junit.Ignore 주석이 추가되어 있기 때문).

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

테스트 호출에서 연결된 로그 또는 디버그 데이터를 제공합니다.

void testModuleEnded()

모듈 실행 종료를 보고합니다.

void testModuleStarted(IInvocationContext moduleContext)

모듈 실행 시작을 보고합니다.

void testRunEnded(long time, runMetrics)

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

void testRunFailed(FailureDescription failure)

FailureDescription에 설명된 실패로 인해 보고서 테스트 실행을 완료하지 못했습니다.

void testRunFailed(String reason)

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

void testRunStarted(String runName, int testCount, int attemptNumber)

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

void testRunStarted(String runName, int testCount)

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

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

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

void testRunStopped(long arg0)

사용자 요청으로 인해 보고서 테스트 실행이 완료되기 전에 중지되었습니다.

void testSkipped(TestDescription testId, SkipReason reason)

테스트가 건너뛰어졌으며 일반적으로 예상되지 않는 이유로 실행되지 않았을 때 호출됩니다.

void testStarted(TestDescription testId, long startTime)

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

void testStarted(TestDescription testId)

개별 테스트 사례의 시작을 보고합니다.

공개 생성자

SubprocessResultsReporter

public SubprocessResultsReporter ()

공개 메서드

닫기

public void close ()

getSummary

public TestSummary getSummary ()

InvocationListener가 요약을 반환하도록 허용합니다.

반환 값
TestSummary 실행을 요약하는 TestSummary 또는 null

invocationEnded

public void invocationEnded (long elapsedTime)

호출이 성공적 또는 일부 오류 조건으로 인해 종료되었음을 보고합니다.

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

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

invocationFailed

public void invocationFailed (FailureDescription failure)

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

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

매개변수
failure FailureDescription: 실패 원인을 설명하는 FailureDescription

invocationFailed

public void invocationFailed (Throwable cause)

일부 오류 상태로 인해 불완전한 호출을 보고합니다.

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

매개변수
cause Throwable: 실패의 Throwable 원인입니다.

invocationStarted

public void invocationStarted (IInvocationContext context)

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

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

매개변수
context IInvocationContext: 호출에 관한 정보입니다.

logAssociation

public void logAssociation (String dataName, 
                LogFile logFile)

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

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

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

printEvent

public void printEvent (String key, 
                Object event)

이벤트 키를 출력한 다음 json 객체를 출력하는 도우미

매개변수
key String

event Object

setOutputTestLog

public void setOutputTestLog (boolean outputTestLog)

로깅된 테스트를 출력할지 여부를 설정합니다.

매개변수
outputTestLog boolean

supportGranularResults

public boolean supportGranularResults ()

보고 도구가 세부적인 결과를 지원하면 true를, 그렇지 않으면 false를 반환합니다.

반환 값
boolean

testAssumptionFailure

public void testAssumptionFailure (TestDescription testId, 
                String trace)

원자 테스트에서 거짓인 조건을 가정한다고 플래그를 지정할 때 호출됩니다.

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

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

testAssumptionFailure

public void testAssumptionFailure (TestDescription testId, 
                FailureDescription failure)

원자 테스트에서 거짓인 조건을 가정한다고 플래그를 지정할 때 호출됩니다.

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

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

testEnded

public void testEnded (TestDescription testId, 
                long endTime, 
                 metrics)

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

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

endTime long: 테스트가 종료된 시간으로, System.currentTimeMillis()를 통해 측정됩니다.

metrics : 내보낸 측정항목의 ERROR(/Map)

testEnded

public void testEnded (TestDescription testId, 
                 metrics)

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

testFailed(TestDescription, FailureDescription)이 호출되지 않았다면 이 테스트는 통과한 것입니다. 또한 테스트 사례 실행 중에 내보냈을 수 있는 모든 키-값 측정항목도 반환합니다.

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

metrics : 내보낸 측정항목의 ERROR(/Map)입니다.

testFailed

public void testFailed (TestDescription testId, 
                FailureDescription failure)

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

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

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

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

testFailed

public void testFailed (TestDescription testId, 
                String reason)

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

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

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

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

testIgnored

public void testIgnored (TestDescription testId)

테스트가 실행되지 않을 때 호출됩니다(일반적으로 테스트 메서드에 org.junit.Ignore 주석이 추가되어 있기 때문).

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

testLog

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

테스트 호출에서 연결된 로그 또는 디버그 데이터를 제공합니다.

ERROR(/ITestInvocationListener#invocationFailed(Throwable)) 또는 ERROR(/ITestInvocationListener#invocationEnded(long)) 전에 호출해야 합니다.

TradeFederation 프레임워크는 이 메서드를 자동으로 호출하여 호스트 로그와 해당하는 경우 기기 logcat을 제공합니다.

매개변수
dataName String: 데이터의 String설명 이름입니다(예: 'device_logcat'). 참고: dataName은 호출마다 고유하지 않을 수 있습니다. 즉, 구현자는 동일한 dataName으로 여러 호출을 처리할 수 있어야 합니다.

dataType LogDataType: 데이터의 LogDataType

dataStream InputStreamSource: 데이터의 InputStreamSource입니다. 구현자는 createInputStream을 호출하여 데이터 읽기를 시작하고 완료되면 생성된 InputStream을 닫아야 합니다. 호출자는 testLog 메서드가 완료될 때까지 데이터 소스가 계속 존재하고 액세스할 수 있는지 확인해야 합니다.

testModuleEnded

public void testModuleEnded ()

모듈 실행 종료를 보고합니다.

testModuleStarted

public void testModuleStarted (IInvocationContext moduleContext)

모듈 실행 시작을 보고합니다. 이 콜백은 testModuleEnded()와 연결되며 시퀀스에서 선택사항입니다. 모듈 모음 기반 실행기를 사용하는 실행 중에만 사용됩니다.

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

testRunEnded

public void testRunEnded (long time, 
                 runMetrics)

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

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

runMetrics : 테스트 실행이 끝날 때 보고되는 키-값 쌍

testRunFailed

public void testRunFailed (FailureDescription failure)

FailureDescription에 설명된 실패로 인해 보고서 테스트 실행을 완료하지 못했습니다.

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

testRunFailed

public void testRunFailed (String reason)

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

매개변수
reason String: 실행 실패 이유를 설명하는 String입니다.

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber)

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

매개변수
runName String: 테스트 실행 이름

testCount int: 테스트 실행의 총 테스트 수

attemptNumber int: 주문 번호로, 여러 번 실행되는 동일한 runName의 여러 시도를 식별합니다. tryNumber는 0부터 시작되며 새로운 실행이 발생할 때마다 증가합니다. 예를 들어 테스트는 3번 세분화되어 재시도되며, 같은 runName에 총 4회의 실행이 허용되고, tryNumber 값이 0에서 3 사이이어야 합니다.

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

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

매개변수
runName String: 테스트 실행 이름

testCount int: 테스트 실행의 총 테스트 수

testRunStarted

public void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

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

매개변수
runName String: 테스트 실행 이름

testCount int: 테스트 실행의 총 테스트 수

attemptNumber int: 주문 번호로, 여러 번 실행되는 동일한 runName의 여러 시도를 식별합니다. attemptNumber는 0으로 시작하며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트가 세부적으로 3번 재시도되면 동일한 runName 아래에 총 4개의 실행이 있어야 하며 attemptNumber는 0~3입니다.

startTime long: 실행이 시작된 시간으로, System.currentTimeMillis()를 통해 측정됩니다.

testRunStop

public void testRunStopped (long arg0)

사용자 요청으로 인해 보고서 테스트 실행이 완료되기 전에 중지되었습니다.

TODO: 현재 사용되지 않습니다. 삭제하는 것이 좋습니다.

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

testSkipped

public void testSkipped (TestDescription testId, 
                SkipReason reason)

테스트를 건너뛰고 일반적으로 예상치 못한 이유로 실행되지 않은 경우 호출됩니다. 이러한 테스트는 제대로 실행하기 위해 재시도됩니다.

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

reason SkipReason: SkipReason

testStarted

public void testStarted (TestDescription testId, 
                long startTime)

테스트가 시작된 시점도 지정하는 testStarted(com.android.tradefed.result.TestDescription)의 대안으로, 정확한 측정을 위해 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))와 함께 사용합니다.

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

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

testStarted

public void testStarted (TestDescription testId)

개별 테스트 사례의 시작을 보고합니다. 이전 인터페이스이며 가능하면 testStarted(com.android.tradefed.result.TestDescription)을 사용해야 합니다.

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