ResultDBReporter
public
class
ResultDBReporter
extends Object
implements
IConfigurationReceiver,
ILogSaverListener,
ISupportGranularResults,
ITestSummaryListener
java.lang.Object | |
↳ | com.android.tradefed.result.resultdb.ResultDBReporter |
테스트 결과를 ResultDB에 업로드하는 결과 보고자입니다.
요약
공개 생성자 | |
---|---|
ResultDBReporter()
|
공개 메서드 | |
---|---|
TestSummary
|
getSummary()
InvocationListener가 요약을 반환하도록 허용합니다. |
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)
경우에 따라 로그를 테스트 사례와 밀접하게 연결해야 하지만 직접 |
void
|
setConfiguration(IConfiguration configuration)
사용 중인 |
void
|
setLogSaver(ILogSaver logSaver)
구현자가 파일을 저장할 수 있도록 |
boolean
|
supportGranularResults()
보고 도구가 세부적인 결과를 지원하면 True를, 그렇지 않으면 False를 반환합니다. |
void
|
testAssumptionFailure(TestDescription test, String trace)
원자 테스트에서 거짓인 조건을 가정한다고 플래그를 지정할 때 호출됩니다. |
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
원자 테스트에서 거짓인 조건을 가정한다고 플래그를 지정할 때 호출됩니다. |
void
|
testEnded(TestDescription test, long endTime,
종료 시간을 직접 지정할 수 있는 |
void
|
testEnded(TestDescription test,
개별 테스트 사례의 실행 종료를 보고합니다. |
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
|
testModuleEnded()
모듈 실행 종료를 보고합니다. |
void
|
testModuleStarted(IInvocationContext moduleContext)
모듈 실행 시작을 보고합니다. |
void
|
testRunEnded(long elapsedTimeMillis,
테스트 실행 종료를 보고합니다. |
void
|
testRunFailed(FailureDescription failure)
|
void
|
testRunFailed(String errorMessage)
심각한 오류로 인해 보고서 테스트 실행을 완료하지 못했습니다. |
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 elapsedTime)
사용자 요청으로 인해 보고서 테스트 실행이 완료되기 전에 중지되었습니다. |
void
|
testSkipped(TestDescription test, SkipReason reason)
테스트가 건너뛰어졌으며 일반적으로 예상되지 않는 이유로 실행되지 않았을 때 호출됩니다. |
void
|
testStarted(TestDescription test, long startTime)
테스트가 시작된 시점도 지정하는 |
void
|
testStarted(TestDescription test)
개별 테스트 사례의 시작을 보고합니다. |
공개 생성자
ResultDBReporter
public ResultDBReporter ()
공개 메서드
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 원인입니다. |
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, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)
콜백에서는 이를 실행할 수 없습니다. 따라서 이 콜백을 사용하면 강력한 연결을 명시적으로 제공할 수 있습니다.
매개변수 | |
---|---|
dataName |
String : 데이터의 이름 |
logFile |
LogFile : 이전에 로깅되었으며 테스트 사례와 연결되어야 하는 LogFile 입니다. |
setConfiguration
public void setConfiguration (IConfiguration configuration)
사용 중인 IConfiguration
를 삽입합니다.
매개변수 | |
---|---|
configuration |
IConfiguration |
setLogSaver
public void setLogSaver (ILogSaver logSaver)
구현자가 파일을 저장할 수 있도록 ILogSaver
를 설정합니다.
매개변수 | |
---|---|
logSaver |
ILogSaver : ILogSaver |
supportGranularResults
public boolean supportGranularResults ()
보고 도구가 세부적인 결과를 지원하면 True를, 그렇지 않으면 False를 반환합니다.
반환 값 | |
---|---|
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,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) 입니다. |
testEnded
public void testEnded (TestDescription test,testMetrics)
개별 테스트 사례의 실행 종료를 보고합니다.
testFailed(TestDescription, FailureDescription)
이 호출되지 않았다면 이 테스트는 통과한 것입니다. 또한 테스트 사례 실행 중에 내보냈을 수 있는 모든 키-값 측정항목도 반환합니다.
매개변수 | |
---|---|
test |
TestDescription : 테스트를 식별합니다. |
testMetrics |
: 내보낸 측정항목의 ERROR(/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)
테스트 호출에서 연결된 로그 또는 디버그 데이터를 제공합니다.
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 elapsedTimeMillis,runMetrics)
테스트 실행 종료를 보고합니다.
매개변수 | |
---|---|
elapsedTimeMillis |
long : 기기에서 보고한 경과 시간(밀리초) |
runMetrics |
: 테스트 실행이 끝날 때 보고되는 키-값 쌍 |
testRunFailed
public void testRunFailed (FailureDescription failure)
FailureDescription
에 설명된 실패로 인해 보고서 테스트 실행을 완료하지 못했습니다.
매개변수 | |
---|---|
failure |
FailureDescription : 오류 및 컨텍스트를 설명하는 FailureDescription 입니다. |
testRunFailed
public void testRunFailed (String errorMessage)
심각한 오류로 인해 보고서 테스트 실행을 완료하지 못했습니다.
매개변수 | |
---|---|
errorMessage |
String : 실행 실패 이유를 설명하는 String 입니다. |
testRunStarted
public void testRunStarted (String runName, int testCount, int attemptNumber)
테스트 실행 시작을 보고합니다.
매개변수 | |
---|---|
runName |
String : 테스트 실행 이름 |
testCount |
int : 테스트 실행의 총 테스트 수 |
attemptNumber |
int : 순서 번호로, 여러 번 실행되는 동일한 runName의 여러 시도를 식별합니다. attemptNumber는 0으로 시작하며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트가 세부적으로 세 번 재시도되면 동일한 runName 아래에 총 4개의 실행이 있어야 하며 attemptNumber는 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으로 시작하며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트가 세부적으로 세 번 재시도되면 동일한 runName 아래에 총 4개의 실행이 있어야 하며 attemptNumber는 0~3입니다. |
startTime |
long : System.currentTimeMillis() 를 통해 측정된 실행 시작 시간입니다. |
testRunStopped
public void testRunStopped (long elapsedTime)
사용자 요청으로 인해 보고서 테스트 실행이 완료되기 전에 중지되었습니다.
TODO: 현재 사용되지 않으며 삭제 고려
매개변수 | |
---|---|
elapsedTime |
long : 기기에서 보고한 경과 시간(밀리초) |
testSkipped
public void testSkipped (TestDescription test, SkipReason reason)
테스트가 건너뛰어졌으며 일반적으로 예상되지 않는 이유로 실행되지 않았을 때 호출됩니다. 이러한 테스트는 적절한 실행을 위해 다시 시도됩니다.
매개변수 | |
---|---|
test |
TestDescription : 테스트를 식별합니다. |
reason |
SkipReason : SkipReason |
testStarted
public void testStarted (TestDescription test, long startTime)
테스트가 시작된 시점도 지정하는 testStarted(com.android.tradefed.result.TestDescription)
의 대안으로, 정확한 측정을 위해 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map))
와 함께 사용합니다.
매개변수 | |
---|---|
test |
TestDescription : 테스트를 식별합니다. |
startTime |
long : System.currentTimeMillis() 를 통해 측정된 테스트 시작 시간입니다. |
testStarted
public void testStarted (TestDescription test)
개별 테스트 사례의 시작을 보고합니다. 이전 인터페이스이며 가능하면 testStarted(com.android.tradefed.result.TestDescription)
을 사용해야 합니다.
매개변수 | |
---|---|
test |
TestDescription : 테스트를 식별합니다. |