BaseDeviceMetricCollector

public class BaseDeviceMetricCollector
extends Object implements IMetricCollector

java.lang.Object
   ↳ com.android.tradefed.device.metric.BaseDeviceMetricCollector


onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData)ERROR(/#onTestRunEnd(com.android.tradefed.device.metric.DeviceMetricData,Map))에서 수집을 시작하고 중지할 수 있는 IMetricCollector의 기본 구현입니다.

요약

필드

public static final String TEST_CASE_EXCLUDE_GROUP_OPTION

public static final String TEST_CASE_INCLUDE_GROUP_OPTION

공개 생성자

BaseDeviceMetricCollector()

공개 메서드

final getBuildInfos()

호출에서 사용할 수 있는 빌드 정보 목록을 반환합니다.

final getDevices()

호출에서 사용할 수 있는 기기 목록을 반환합니다.

File getFileFromTestArtifacts(String fileName)

테스트 아티팩트 또는 모듈 아티팩트에서 파일을 가져와 후속 호출을 위해 맵에 캐시합니다.

final ITestInvocationListener getInvocationListener()

결과를 전달하는 원래 ITestInvocationListener를 반환합니다.

final getRealDevices()

getDevices() 목록에서 스텁이 아닌 모든 기기를 반환합니다.

String getRunName()

수집기를 트리거하는 테스트 실행 mRunName의 이름을 반환합니다.

ITestInvocationListener init(IInvocationContext context, 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)

측정항목 수집기 구현 내부에서 사용하지 마세요.

void onTestAssumptionFailure(DeviceMetricData testData, TestDescription test)

가정 실패로 테스트 사례가 실패할 때의 콜백입니다.

void onTestEnd(DeviceMetricData testData, currentTestCaseMetrics, TestDescription test)

테스트 사례가 종료될 때 콜백

void onTestEnd(DeviceMetricData testData, currentTestCaseMetrics)

테스트 사례가 종료될 때 콜백

void onTestFail(DeviceMetricData testData, TestDescription test)

테스트 사례가 실패할 때의 콜백입니다.

void onTestRunEnd(DeviceMetricData runData, currentRunMetrics)

테스트 실행이 종료될 때의 콜백입니다.

void onTestRunFailed(DeviceMetricData testData, FailureDescription failure)
void onTestRunStart(DeviceMetricData runData)

테스트 실행이 시작될 때의 콜백입니다.

void onTestStart(DeviceMetricData testData)

테스트 사례가 시작될 때의 콜백입니다.

final void setDisable(boolean isDisabled)

객체를 사용 중지할지 여부를 설정합니다.

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)
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 testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
final void testRunStopped(long elapsedTime)
final void testStarted(TestDescription test, long startTime)
final void testStarted(TestDescription test)

테스트 사례 콜백

필드

TEST_CASE_EXCLUDE_GROUP_OPTION

public static final String TEST_CASE_EXCLUDE_GROUP_OPTION

TEST_CASE_INCLUDE_GROUP_OPTION

public static final String TEST_CASE_INCLUDE_GROUP_OPTION

공개 생성자

BaseDeviceMetricCollector

public BaseDeviceMetricCollector ()

공개 메서드

getBuildInfos

public final  getBuildInfos ()

호출에서 사용할 수 있는 빌드 정보 목록을 반환합니다.

반환 값

getDevices

public final  getDevices ()

호출에서 사용할 수 있는 기기 목록을 반환합니다.

반환 값

getFileFromTestArtifacts

public File getFileFromTestArtifacts (String fileName)

테스트 아티팩트 또는 모듈 아티팩트에서 파일을 가져와 후속 호출을 위해 맵에 캐시합니다.

매개변수
fileName String: 아티팩트에서 조회할 파일의 이름입니다.

반환 값
File 테스트 아티팩트 또는 모듈 아티팩트의 파일입니다. 파일을 찾을 수 없는 경우 null을 반환합니다.

getInvocationListener

public final ITestInvocationListener getInvocationListener ()

결과를 전달하는 원래 ITestInvocationListener를 반환합니다.

반환 값
ITestInvocationListener

getRealDevices

public final  getRealDevices ()

getDevices() 목록에서 스텁이 아닌 모든 기기를 반환합니다.

반환 값

getRunName

public String getRunName ()

수집기를 트리거하는 테스트 실행 mRunName의 이름을 반환합니다.

반환 값
String mRunName: 현재 테스트 실행 이름입니다.

init

public ITestInvocationListener init (IInvocationContext context, 
                ITestInvocationListener listener)

현재 컨텍스트와 결과를 전달할 위치를 사용하여 수집기를 초기화합니다. 인스턴스당 한 번만 호출되며 수집기에서 내부 컨텍스트와 리스너를 업데이트해야 합니다. Init은 테스트 실행 중에 호출되지 않으며 항상 전에 호출됩니다.

어떤 작업을 하는지 잘 알고 있지 않으면 재정의하지 마세요.

매개변수
context IInvocationContext: 진행 중인 호출의 IInvocationContext입니다.

listener ITestInvocationListener: 결과를 배치할 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

onTestAssumptionFailure

public void onTestAssumptionFailure (DeviceMetricData testData, 
                TestDescription test)

가정 실패로 테스트 사례가 실패할 때의 콜백입니다.

매개변수
testData DeviceMetricData: 테스트 사례의 데이터를 보유하는 DeviceMetricData입니다.

test TestDescription: 진행 중인 테스트 사례의 TestDescription입니다.

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                 currentTestCaseMetrics, 
                TestDescription test)

테스트 사례가 종료될 때 콜백 이제 정리할 시간입니다.

매개변수
testData DeviceMetricData: 테스트 사례의 데이터를 보유하는 DeviceMetricData입니다. onTestStart(com.android.tradefed.device.metric.DeviceMetricData)와 동일한 객체입니다.

currentTestCaseMetrics : ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, Map)에 전달된 현재 측정항목 맵입니다.

test TestDescription: 진행 중인 테스트 사례의 TestDescription입니다.

onTestEnd

public void onTestEnd (DeviceMetricData testData, 
                 currentTestCaseMetrics)

테스트 사례가 종료될 때 콜백 이제 정리할 시간입니다.

매개변수
testData DeviceMetricData: 테스트 사례의 데이터를 보유하는 DeviceMetricData입니다. onTestStart(com.android.tradefed.device.metric.DeviceMetricData)와 동일한 객체입니다.

currentTestCaseMetrics : ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, Map)에 전달된 현재 측정항목 맵입니다.

onTestFail

public void onTestFail (DeviceMetricData testData, 
                TestDescription test)

테스트 사례가 실패할 때의 콜백입니다.

매개변수
testData DeviceMetricData: 테스트 사례의 데이터를 보유하는 DeviceMetricData입니다.

test TestDescription: 진행 중인 테스트 사례의 TestDescription입니다.

onTestRunEnd

public void onTestRunEnd (DeviceMetricData runData, 
                 currentRunMetrics)

테스트 실행이 종료될 때의 콜백입니다. 이제 정리할 시간입니다.

매개변수
runData DeviceMetricData: 실행에 관한 데이터를 보유한 DeviceMetricData입니다. onTestRunStart(com.android.tradefed.device.metric.DeviceMetricData)와 동일한 객체입니다.

currentRunMetrics : ITestLifeCycleReceiver.testRunEnded(long, Map)에 전달된 현재 측정항목 맵입니다.

onTestRunFailed

public void onTestRunFailed (DeviceMetricData testData, 
                FailureDescription failure)

매개변수
testData DeviceMetricData

failure FailureDescription

onTestRunStart

public void onTestRunStart (DeviceMetricData runData)

테스트 실행이 시작될 때의 콜백입니다.

매개변수
runData DeviceMetricData: 실행에 관한 데이터를 보유한 DeviceMetricData입니다.

onTestStart

public void onTestStart (DeviceMetricData testData)

테스트 사례가 시작될 때의 콜백입니다.

매개변수
testData DeviceMetricData: 테스트 사례의 데이터를 보유하는 DeviceMetricData입니다.

setDisable

public final void setDisable (boolean isDisabled)

객체를 사용 중지할지 여부를 설정합니다. 사용 중지됨은 설정 단계와 해체 단계를 모두 건너뛰어야 함을 의미합니다. 기본 생성자에서 기본적으로 객체를 사용 중지하는 데 사용할 수 있습니다.

매개변수
isDisabled boolean: 객체를 배치해야 하는 상태입니다.

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)

매개변수
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

testRunStarted

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

매개변수
runName String

testCount int

attemptNumber int

startTime long

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