自 2026 年起,为了与我们的主干稳定开发模型保持一致,并确保生态系统的平台稳定性,我们将在第 2 季度和第 4 季度将源代码发布到 AOSP。对于构建 AOSP 和向 AOSP 贡献代码,我们建议使用 android-latest-release 而不是 aosp-main。android-latest-release 清单分支将始终引用推送到 AOSP 的最新版本。如需了解详情,请参阅 AOSP 变更。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
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。
摘要
公共方法 |
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)
|
公共构造函数
ProtoResultReporter
public ProtoResultReporter ()
公共方法
invocationEnded
public final void invocationEnded (long elapsedTime)
invocationFailed
public void invocationFailed (FailureDescription failure)
| 参数 |
failure |
FailureDescription |
invocationFailed
public void invocationFailed (Throwable cause)
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。 |
processTestModuleEnd
public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)
发生 testModuleEnded() 后处理已完成的模块记录 proto。
| 参数 |
moduleRecord |
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 ()
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)
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)
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)
受保护的方法
createModuleChildReference
protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)
为模块创建子引用。
| 参数 |
record |
TestRecordProto.TestRecord |
| 返回 |
TestRecordProto.ChildReference |
|
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-27。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-27。"],[],[]]