BasePostProcessor

public abstract class BasePostProcessor
extends Object implements IPostProcessor

java.lang.Object
   ↳ com.android.tradefed.postprocessor.BasePostProcessor


모든 구현에서 확장해야 하는 기본 IPostProcessor입니다. 후처리 메서드가 최종 결과 보고자보다 먼저 호출되는지 확인합니다.

요약

공개 생성자

BasePostProcessor()

공개 메서드

final ITestInvocationListener init(ITestInvocationListener listener)

후처리기의 초기화 단계입니다.

final void invocationEnded(long elapsedTime)
final void invocationFailed(FailureDescription failure)
final void invocationFailed(Throwable cause)
final void invocationStarted(IInvocationContext context)

전달을 위한 호출 리스너

final boolean isDisabled()

전체 객체가 사용 중지된 경우 true를 반환합니다 (설정 및 해체 모두 건너뜁).

final void logAssociation(String dataName, LogFile logFile)

로그-테스트 연결을 업데이트합니다.

processAllTestMetricsAndLogs(ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, allTestLogs)

이 메서드를 구현하여 모든 테스트에서 측정항목과 로그를 집계합니다.

abstract processRunMetricsAndLogs( rawMetrics, runLogs)

기존 측정항목 및 로그에서 새 측정항목 집합을 생성하려면 이 메서드를 구현합니다.

processTestMetricsAndLogs(TestDescription testDescription, testMetrics, testLogs)

이 메서드를 구현하여 각 테스트의 측정항목과 로그를 후처리합니다.

final void setLogSaver(ILogSaver logSaver)
final void testAssumptionFailure(TestDescription test, String trace)
final void testAssumptionFailure(TestDescription test, FailureDescription failure)
final void testEnded(TestDescription test, long endTime, testMetrics)
final void testEnded(TestDescription test, testMetrics)
final void testFailed(TestDescription test, FailureDescription failure)
final void testFailed(TestDescription test, String trace)
final void testIgnored(TestDescription test)
final void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

이 메서드를 사용하여 PostProcessor 구현에서 파일을 로깅합니다.

final void testLogSaved(String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile)
final void testModuleEnded()
final void testModuleStarted(IInvocationContext moduleContext)
final void testRunEnded(long elapsedTime, runMetrics)
final void testRunFailed(FailureDescription failure)
final void testRunFailed(String errorMessage)
final void testRunStarted(String runName, int testCount, int attemptNumber)
final void testRunStarted(String runName, int testCount)

테스트 실행 콜백

final void testRunStopped(long elapsedTime)
final void testStarted(TestDescription test, long startTime)
final void testStarted(TestDescription test)

테스트 사례 콜백

보호된 메서드

MetricMeasurement.DataType getMetricType()

필요한 경우 이 메서드를 재정의하여 측정항목 유형을 변경합니다.

String getRunName()

공개 생성자

BasePostProcessor

public BasePostProcessor ()

공개 메서드

init

public final ITestInvocationListener init (ITestInvocationListener listener)

후처리기의 초기화 단계입니다. 테스트 콜백 전에 호출됩니다.

매개변수
listener ITestInvocationListener

반환 값
ITestInvocationListener

invocationEnded

public final void invocationEnded (long elapsedTime)

매개변수
elapsedTime long

invocationFailed

public final void invocationFailed (FailureDescription failure)

매개변수
failure FailureDescription

invocationFailed

public final void invocationFailed (Throwable cause)

매개변수
cause Throwable

invocationStarted

public final void invocationStarted (IInvocationContext context)

전달을 위한 호출 리스너

매개변수
context IInvocationContext

isDisabled

public final boolean isDisabled ()

전체 객체가 사용 중지된 경우 true를 반환합니다 (설정 및 해체 모두 건너뜁). 그렇지 않으면 false입니다.

반환 값
boolean

logAssociation

public final void logAssociation (String dataName, 
                LogFile logFile)

로그-테스트 연결을 업데이트합니다. 테스트 중에 이 메서드가 호출되면 로그가 테스트에 속하고 그렇지 않으면 실행 로그가 됩니다.

매개변수
dataName String

logFile LogFile

processAllTestMetricsAndLogs

public  processAllTestMetricsAndLogs (ListMultimap<String, MetricMeasurement.Metric> allTestMetrics, 
                 allTestLogs)

이 메서드를 구현하여 모든 테스트에서 측정항목과 로그를 집계합니다. 이 메서드에서 나오는 측정항목은 실행 측정항목으로 보고됩니다. 새로 생성된 측정항목만 고유한 키 이름으로 반환해야 합니다 (기존 키와의 충돌은 허용되지 않음).

매개변수
allTestMetrics ListMultimap: 측정항목 이름별로 그룹화된 각 테스트의 측정항목을 저장하는 HashMultimap입니다.

allTestLogs : 각 테스트의 TestDescription를 키로 사용하여 데이터 이름으로 키가 지정된 각 테스트의 로그 파일 매핑을 저장하는 매핑입니다.

반환 값
모든 테스트 측정항목에서 새로 생성된 측정항목 집합입니다.

processRunMetricsAndLogs

public abstract  processRunMetricsAndLogs ( rawMetrics, 
                 runLogs)

기존 측정항목 및 로그에서 새 측정항목 집합을 생성하려면 이 메서드를 구현합니다. 새로 생성된 측정항목만 고유한 키 이름으로 반환해야 합니다 (기존 키와의 충돌은 허용되지 않음).

매개변수
rawMetrics : 실행에 사용할 수 있는 원시 측정항목 집합입니다.

runLogs : 테스트 실행의 로그 파일 집합입니다.

반환 값
실행 측정항목에서 새로 생성된 측정항목 집합입니다.

processTestMetricsAndLogs

public  processTestMetricsAndLogs (TestDescription testDescription, 
                 testMetrics, 
                 testLogs)

이 메서드를 구현하여 각 테스트의 측정항목과 로그를 후처리합니다. 새로 생성된 측정항목만 고유한 키 이름으로 반환해야 합니다 (기존 키와 충돌해서는 안 됨).

매개변수
testDescription TestDescription: 테스트를 설명하는 TestDescription 객체입니다.

testMetrics : 테스트의 측정항목 집합입니다.

testLogs : 테스트 중에 로깅된 파일 집합입니다.

반환 값
테스트 측정항목에서 새로 생성된 측정항목 집합입니다.

setLogSaver

public final void setLogSaver (ILogSaver logSaver)

매개변수
logSaver ILogSaver

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                String trace)

매개변수
test TestDescription

trace String

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

매개변수
test TestDescription

failure FailureDescription

testEnded

public final void testEnded (TestDescription test, 
                long endTime, 
                 testMetrics)

매개변수
test TestDescription

endTime long

testMetrics

testEnded

public final void testEnded (TestDescription test, 
                 testMetrics)

매개변수
test TestDescription

testMetrics

testFailed

public final void testFailed (TestDescription test, 
                FailureDescription failure)

매개변수
test TestDescription

failure FailureDescription

testFailed

public final void testFailed (TestDescription test, 
                String trace)

매개변수
test TestDescription

trace String

testIgnored

public final void testIgnored (TestDescription test)

매개변수
test TestDescription

testLog

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

이 메서드를 사용하여 PostProcessor 구현에서 파일을 로깅합니다.

매개변수
dataName String

dataType LogDataType

dataStream InputStreamSource

testLogSaved

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

매개변수
dataName String

dataType LogDataType

dataStream InputStreamSource

logFile LogFile

testModuleEnded

public final void testModuleEnded ()

testModuleStarted

public final void testModuleStarted (IInvocationContext moduleContext)

매개변수
moduleContext IInvocationContext

testRunEnded

public final void testRunEnded (long elapsedTime, 
                 runMetrics)

매개변수
elapsedTime long

runMetrics

testRunFailed

public final void testRunFailed (FailureDescription failure)

매개변수
failure FailureDescription

testRunFailed

public final void testRunFailed (String errorMessage)

매개변수
errorMessage String

testRunStarted

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

매개변수
runName String

testCount int

attemptNumber int

testRunStarted

public final void testRunStarted (String runName, 
                int testCount)

테스트 실행 콜백

매개변수
runName String

testCount int

testRunStopped

public final void testRunStopped (long elapsedTime)

매개변수
elapsedTime long

testStarted

public final void testStarted (TestDescription test, 
                long startTime)

매개변수
test TestDescription

startTime long

testStarted

public final void testStarted (TestDescription test)

테스트 사례 콜백

매개변수
test TestDescription

보호된 메서드

getMetricType

protected MetricMeasurement.DataType getMetricType ()

필요한 경우 이 메서드를 재정의하여 측정항목 유형을 변경합니다. 기본적으로 측정항목은 처리된 유형으로 설정됩니다.

반환 값
MetricMeasurement.DataType

getRunName

protected String getRunName ()

반환 값
String