ProtoResultReporter

public abstract class ProtoResultReporter
extends Object implements ITestInvocationListener, ILogSaverListener, ISupportGranularResults

java.lang.Object
   ↳ com.android.tradefed.result.proto.ProtoResultReporter


结果报告程序会构建一个包含所有结果的 TestRecord protobuf。应扩展以处理如何处理 processFinalProto(com.android.tradefed.result.proto.TestRecordProto.TestRecord) 中的最终 proto。

摘要

公共构造函数

ProtoResultReporter()

公共方法

final void invocationEnded(long elapsedTime)
void invocationFailed(FailureDescription failure)
void invocationFailed(Throwable cause)
final void invocationStarted(IInvocationContext context)
final void logAssociation(String dataName, LogFile logFile)
void processFinalProto(TestRecordProto.TestRecord finalRecord)

处理包含所有结果的最终 proto。

void processStartInvocation(TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext)

在发生 invocationStarted(com.android.tradefed.invoker.IInvocationContext) 后处理部分调用测试记录 proto。

void processTestCaseEnded(TestRecordProto.TestRecord testCaseRecord)

发生 ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, long, HashMap) 后处理最终测试用例记录 proto。

void processTestCaseStarted(TestRecordProto.TestRecord testCaseStartedRecord)

发生 testStarted(com.android.tradefed.result.TestDescription, long) 后处理部分测试用例记录 proto。

void processTestModuleEnd(TestRecordProto.TestRecord moduleRecord)

发生 testModuleEnded() 后处理已完成的模块记录 proto。

void processTestModuleStarted(TestRecordProto.TestRecord moduleStartRecord)

发生 testModuleStarted(com.android.tradefed.invoker.IInvocationContext) 后处理部分模块记录 proto。

void processTestRunEnded(TestRecordProto.TestRecord runRecord, boolean moduleInProgress)

在发生 ITestLifeCycleReceiver.testRunEnded(long, HashMap) 后处理最终确定的运行记录 proto。

void processTestRunStarted(TestRecordProto.TestRecord runStartedRecord)

处理了发生 testRunStarted(String, int) 后部分测试运行记录 proto。

boolean supportGranularResults()
final void testAssumptionFailure(TestDescription test, String trace)
final void testAssumptionFailure(TestDescription test, FailureDescription failure)
final void testEnded(TestDescription test, long endTime, testMetrics)
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 testModuleEnded()
final void testModuleStarted(IInvocationContext moduleContext)
final void testRunEnded(long elapsedTimeMillis, runMetrics)
final void testRunFailed(FailureDescription failure)
final void testRunFailed(String errorMessage)
void testRunStarted(String runName, int testCount, int attemptNumber)
final void testRunStarted(String runName, int testCount)
void testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
final void testStarted(TestDescription test, long startTime)
final void testStarted(TestDescription test)

受保护的方法

TestRecordProto.ChildReference createModuleChildReference(TestRecordProto.TestRecord record)

为模块创建子引用。

公共构造函数

ProtoResultReporter

public ProtoResultReporter ()

公共方法

invocationEnded

public final void invocationEnded (long elapsedTime)

参数
elapsedTime long

invocationFailed

public void invocationFailed (FailureDescription failure)

参数
failure FailureDescription

invocationFailed

public void invocationFailed (Throwable cause)

参数
cause Throwable

invocationStarted

public final void invocationStarted (IInvocationContext context)

参数
context IInvocationContext

logAssociation

public final void logAssociation (String dataName, 
                LogFile logFile)

参数
dataName String

logFile LogFile

processFinalProto

public void processFinalProto (TestRecordProto.TestRecord finalRecord)

处理包含所有结果的最终 proto。

参数
finalRecord TestRecordProto.TestRecord:包含所有调用结果的最终 proto。

processStartInvocation

public void processStartInvocation (TestRecordProto.TestRecord invocationStartRecord, 
                IInvocationContext invocationContext)

发生 invocationStarted(com.android.tradefed.invoker.IInvocationContext) 后处理部分调用测试记录 proto。

参数
invocationStartRecord TestRecordProto.TestRecord:在 invocationStart 之后填充的部分 proto。

invocationContext IInvocationContext:调用 IInvocationContext

processTestCaseEnded

public void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)

发生 ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, long, HashMap) 后处理已完成的测试用例记录 proto。

参数
testCaseRecord TestRecordProto.TestRecord:表示测试用例的最终 proto。

processTestCaseStarted

public void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)

在发生 testStarted(com.android.tradefed.result.TestDescription, long) 后处理部分测试用例记录 proto。

参数
testCaseStartedRecord TestRecordProto.TestRecord:表示测试用例的部分 proto。

processTestModuleEnd

public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)

发生 testModuleEnded() 后处理已完成的模块记录 proto。

参数
moduleRecord TestRecordProto.TestRecord:表示模块的最终确定的 proto。

processTestModuleStarted

public void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)

发生 testModuleStarted(com.android.tradefed.invoker.IInvocationContext) 后处理部分模块记录 proto。

参数
moduleStartRecord TestRecordProto.TestRecord:表示模块的部分 proto。

processTestRunEnded

public void processTestRunEnded (TestRecordProto.TestRecord runRecord, 
                boolean moduleInProgress)

在发生 ITestLifeCycleReceiver.testRunEnded(long, HashMap) 后处理最终确定的运行记录 proto。

参数
runRecord TestRecordProto.TestRecord:表示运行的最终化 proto。

moduleInProgress boolean:模块是否正在处理中。

processTestRunStarted

public void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)

处理了发生 testRunStarted(String, int) 后部分测试运行记录 proto。

参数
runStartedRecord TestRecordProto.TestRecord:表示运行的部分 proto。

supportGranularResults

public boolean supportGranularResults ()

返回
boolean

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 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

testModuleEnded

public final void testModuleEnded ()

testModuleStarted

public final void testModuleStarted (IInvocationContext moduleContext)

参数
moduleContext IInvocationContext

testRunEnded

public final void testRunEnded (long elapsedTimeMillis, 
                 runMetrics)

参数
elapsedTimeMillis long

runMetrics

testRunFailed

public final void testRunFailed (FailureDescription failure)

参数
failure FailureDescription

testRunFailed

public final void testRunFailed (String errorMessage)

参数
errorMessage String

testRunStarted

public 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 void testRunStarted (String runName, 
                int testCount, 
                int attemptNumber, 
                long startTime)

参数
runName String

testCount int

attemptNumber int

startTime long

testStarted

public final void testStarted (TestDescription test, 
                long startTime)

参数
test TestDescription

startTime long

testStarted

public final void testStarted (TestDescription test)

参数
test TestDescription

受保护的方法

createModuleChildReference

protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)

为模块创建子引用。

参数
record TestRecordProto.TestRecord

返回
TestRecordProto.ChildReference