原型结果报告器

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)中的最终原型的处理方式。

概括

公共构造函数

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)

处理带有所有结果的最终原型。

void processStartInvocation (TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext)

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

void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)

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

void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)

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

void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)

testModuleEnded()发生后处理最终的模块记录原型。

void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)

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

void processTestRunEnded (TestRecordProto.TestRecord runRecord, boolean moduleInProgress)

ITestLifeCycleReceiver.testRunEnded(long, HashMap)发生后处理最终的运行记录原型。

void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)

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

boolean supportGranularResults ()
final void testAssumptionFailure (TestDescription test, String trace)
final void testAssumptionFailure (TestDescription test, FailureDescription failure)
final void testEnded (TestDescription test, long endTime, testMetrics) testEnded (TestDescription test, long endTime, testMetrics)
void testEnded (TestDescription test, testMetrics) 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) 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)

为模块创建子引用。

公共构造函数

原型结果报告器

public ProtoResultReporter ()

公共方法

调用结束

public final void invocationEnded (long elapsedTime)

参数
elapsedTime long

调用失败

public void invocationFailed (FailureDescription failure)

参数
failure FailureDescription

调用失败

public void invocationFailed (Throwable cause)

参数
cause Throwable

调用开始

public final void invocationStarted (IInvocationContext context)

参数
context IInvocationContext

日志关联

public final void logAssociation (String dataName, 
                LogFile logFile)

参数
dataName String

logFile LogFile

流程最终原型

public void processFinalProto (TestRecordProto.TestRecord finalRecord)

处理带有所有结果的最终原型。

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

进程开始调用

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

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

参数
invocationStartRecord TestRecordProto.TestRecord :调用开始后填充的部分原型。

invocationContext IInvocationContext :调用IInvocationContext

流程测试用例结束

public void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)

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

参数
testCaseRecord TestRecordProto.TestRecord :代表测试用例的最终原型。

流程测试用例开始

public void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)

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

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

进程测试模块结束

public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)

testModuleEnded()发生后处理最终的模块记录原型。

参数
moduleRecord TestRecordProto.TestRecord :表示模块的最终原型。

进程测试模块已启动

public void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)

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

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

进程测试运行结束

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

ITestLifeCycleReceiver.testRunEnded(long, HashMap)发生后处理最终的运行记录原型。

参数
runRecord TestRecordProto.TestRecord :代表运行的最终原型。

moduleInProgress boolean :模块是否正在进行中。

进程测试运行开始

public void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)

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

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

支持粒度结果

public boolean supportGranularResults ()

退货
boolean

测试假设失败

public final void testAssumptionFailure (TestDescription test, 
                String trace)

参数
test TestDescription

trace String

测试假设失败

public final void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

参数
test TestDescription

failure FailureDescription

测试结束

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

参数
test TestDescription

endTime long

testMetrics

测试结束

public void testEnded (TestDescription test, 
                 testMetrics)

参数
test TestDescription

testMetrics

测试失败

public final void testFailed (TestDescription test, 
                FailureDescription failure)

参数
test TestDescription

failure FailureDescription

测试失败

public final void testFailed (TestDescription test, 
                String trace)

参数
test TestDescription

trace String

测试被忽略

public final void testIgnored (TestDescription test)

参数
test TestDescription

测试模块结束

public final void testModuleEnded ()

测试模块启动

public final void testModuleStarted (IInvocationContext moduleContext)

参数
moduleContext IInvocationContext

测试运行结束

public final void testRunEnded (long elapsedTimeMillis, 
                 runMetrics)

参数
elapsedTimeMillis long

runMetrics

测试运行失败

public final void testRunFailed (FailureDescription failure)

参数
failure FailureDescription

测试运行失败

public final void testRunFailed (String errorMessage)

参数
errorMessage String

测试运行开始

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

参数
runName String

testCount int

attemptNumber int

测试运行开始

public final void testRunStarted (String runName, 
                int testCount)

参数
runName String

testCount int

测试运行开始

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

参数
runName String

testCount int

attemptNumber int

startTime long

测试开始

public final void testStarted (TestDescription test, 
                long startTime)

参数
test TestDescription

startTime long

测试开始

public final void testStarted (TestDescription test)

参数
test TestDescription

受保护的方法

创建模块子引用

protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)

为模块创建子引用。

参数
record TestRecordProto.TestRecord

退货
TestRecordProto.ChildReference