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:在呼叫開始後填入的部分 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