테스트 결과 리스너
public abstract class TestResultListener
extends Object
implements ITestLifeCycleReceiver
java.lang.객체 | |
↳ | com.android.tradefed.result.TestResultListener |
개별 테스트 결과에만 관심이 있는 구현자를 위한 ITestLifecycleListener 단순화.
다양한 수명 주기 이벤트를 testResult 메서드로 필터링합니다.
스레드로부터 안전하지 않으며 특히 ITestLifecycleListener 이벤트가 순서대로 수신된다고 가정합니다.
요약
공개 생성자 | |
---|---|
TestResultListener () |
공개 방법 | |
---|---|
final void | testAssumptionFailure ( TestDescription test, String trace) false인 조건을 가정한다고 원자성 테스트 플래그가 표시될 때 호출됩니다. |
final void | testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, testMetrics) 개별 테스트 사례의 실행 종료를 보고합니다. |
final void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) |
final void | testFailed ( TestDescription test, String trace) 개별 테스트 사례의 실패를 보고합니다. |
final void | testIgnored ( TestDescription test) 일반적으로 테스트 메서드가 org.junit.Ignore로 주석 처리되기 때문에 테스트가 실행되지 않을 때 호출됩니다. |
abstract void | testResult ( TestDescription test, TestResult result) |
void | testRunEnded (long elapsedTimeMillis, runMetrics) testRunEnded (long elapsedTimeMillis, runMetrics) 테스트 실행 종료를 보고합니다. |
final void | testStarted ( TestDescription test, long startTime) 정확한 측정을 위해 |
final void | testStarted ( TestDescription test) 개별 테스트 사례의 시작을 보고합니다. |
공개 생성자
테스트 결과 리스너
public TestResultListener ()
공개 방법
테스트 가정 실패
public final void testAssumptionFailure (TestDescription test, String trace)
false인 조건을 가정한다고 원자성 테스트 플래그가 표시될 때 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
trace | String : 실패 스택 추적 |
테스트 종료됨
public final void testEnded (TestDescription test,testMetrics)
개별 테스트 사례의 실행 종료를 보고합니다.
testFailed(TestDescription, FailureDescription)
호출되지 않은 경우 이 테스트는 통과되었습니다. 또한 테스트 사례 실행 중에 방출되었을 수 있는 모든 키/값 메트릭을 반환합니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
testMetrics | ERROR(/Map) |
테스트 종료됨
public final 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 final void testFailed (TestDescription test, String trace)
개별 테스트 사례의 실패를 보고합니다.
testStarted와 testEnded 사이에 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
trace | String : 실패 스택 추적 |
테스트무시됨
public final void testIgnored (TestDescription test)
일반적으로 테스트 메서드가 org.junit.Ignore로 주석 처리되기 때문에 테스트가 실행되지 않을 때 호출됩니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |
검사 결과
public abstract void testResult (TestDescription test, TestResult result)
매개변수 | |
---|---|
test | TestDescription |
result | TestResult |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,runMetrics)
테스트 실행 종료를 보고합니다. FIXME: 유형이 다른 두 개의 Map<> 인터페이스를 가질 수 없으므로 여기에서 HashMap을 사용해야 합니다.
매개변수 | |
---|---|
elapsedTimeMillis | long : 장치에서 보고된 경과 시간(밀리초) |
runMetrics | Metric 사용한 테스트 실행 종료 시 보고된 키-값 쌍입니다. |
테스트 시작됨
public final 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() 통해 측정된 테스트가 시작된 시간 |
테스트 시작됨
public final void testStarted (TestDescription test)
개별 테스트 사례의 시작을 보고합니다. 이전 인터페이스는 가능할 때마다 testStarted(com.android.tradefed.result.TestDescription)
사용해야 합니다.
매개변수 | |
---|---|
test | TestDescription : 테스트를 식별합니다. |