모듈리스너

public class ModuleListener
extends CollectingTestListener

java.lang.Object
com.android.tradefed.result.CollectingTestListener
com.android.tradefed.testtype.suite.ModuleListener


결과 목록을 수집하기 위해 각 모듈의 각 IRemoteTest 에 연결된 리스너입니다.

요약

공개 생성자

ModuleListener ( ITestInvocationListener listener, IInvocationContext moduleContext)

건설자.

공개 메소드

boolean hasLastAttemptFailed ()

리스너 마지막 재시도 세션이 실패했는지 여부를 반환합니다.

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) 콜백이 불가능합니다.

void setAttemptIsolation ( CurrentInvocation.IsolationGrade isolation)

시도를 격리된 것으로 보고할지 여부를 설정합니다.

void setCollectTestsOnly (boolean collectTestsOnly)

테스트만 수집할지 여부를 설정합니다.

void setMarkTestsSkipped (boolean skip)

모든 테스트 사례를 건너뛴 것으로 표시할지 여부입니다.

void setTestMappingSources ( testMappingSources) setTestMappingSources ( testMappingSources)

메트릭에 삽입될 테스트 매핑 소스를 설정합니다.

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)

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

void testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, 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 testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics)

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

void testRunFailed ( FailureDescription failure)

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

void testRunFailed (String errorMessage)

치명적인 오류로 인해 테스트 실행을 완료하지 못했습니다.

void testRunStarted (String name, int numTests, int attemptNumber)

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

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

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

void testSkipped ( TestDescription test, SkipReason reason)

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

void testStarted ( TestDescription test, long startTime)

정확한 측정을 위해 ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) 와 결합하여 테스트 시작 시기도 지정하는 testStarted(com.android.tradefed.result.TestDescription) 의 대안입니다. .

공개 생성자

모듈리스너

public ModuleListener (ITestInvocationListener listener, 
                IInvocationContext moduleContext)

건설자.

매개변수
listener ITestInvocationListener

moduleContext IInvocationContext

공개 메소드

최근 시도가 실패했습니다.

public boolean hasLastAttemptFailed ()

리스너 마지막 재시도 세션이 실패했는지 여부를 반환합니다.

보고
boolean

로그 연관

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 입니다.

격리 시도 설정

public void setAttemptIsolation (CurrentInvocation.IsolationGrade isolation)

시도를 격리된 것으로 보고할지 여부를 설정합니다.

매개변수
isolation CurrentInvocation.IsolationGrade

setCollectTestsOnly

public void setCollectTestsOnly (boolean collectTestsOnly)

테스트만 수집할지 여부를 설정합니다.

매개변수
collectTestsOnly boolean

setMarkTests를 건너뛰었습니다.

public void setMarkTestsSkipped (boolean skip)

모든 테스트 사례를 건너뛴 것으로 표시할지 여부입니다.

매개변수
skip boolean

setTestMappingSources

public void setTestMappingSources ( testMappingSources)

메트릭에 삽입될 테스트 매핑 소스를 설정합니다.

매개변수
testMappingSources

테스트가정실패

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 testEnded (TestDescription test, 
                 testMetrics)

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

testFailed(TestDescription, FailureDescription) 호출되지 않은 경우 이 테스트는 통과된 것입니다. 또한 테스트 사례 실행 중에 방출되었을 수 있는 모든 키/값 측정항목을 반환합니다.

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

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 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 numTests, 
                int attemptNumber)

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

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

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

attemptNumber int : 여러 번 실행되는 동일한 runName의 다양한 시도를 식별하는 주문 번호입니다. tryNumber는 0부터 인덱스가 지정되며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트는 세 번 세분화되어 재시도됩니다. 동일한 runName에서 총 4번의 실행이 있어야 하며, tryNumber는 0에서 3 사이입니다.

테스트실행시작됨

public void testRunStarted (String name, 
                int numTests, 
                int attemptNumber, 
                long startTime)

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

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

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

attemptNumber int : 여러 번 실행되는 동일한 runName의 다양한 시도를 식별하는 주문 번호입니다. tryNumber는 0부터 인덱스가 지정되며 새 실행이 발생할 때마다 증가해야 합니다. 예를 들어 테스트는 세 번 세분화되어 재시도됩니다. 동일한 runName에서 총 4번의 실행이 있어야 하며, tryNumber는 0에서 3 사이입니다.

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

테스트를 건너뛰었습니다.

public void testSkipped (TestDescription test, 
                SkipReason reason)

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

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

reason SkipReason : SkipReason

테스트시작됨

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() 통해 측정된 테스트가 시작된 시간입니다.