ProtoResultReporter

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

java.lang.Objek
com.android.tradefed.result.proto.ProtoResultReporter


Reporter hasil membuat protobuf TestRecord dengan semua hasil di dalamnya. Harus diperluas untuk menangani apa yang harus dilakukan dengan proto terakhir di processFinalProto(com.android.tradefed.result.proto.TestRecordProto.TestRecord) .

Ringkasan

Konstruktor publik

ProtoResultReporter ()

Metode publik

final void invocationEnded (long elapsedTime)

Melaporkan bahwa pemanggilan telah dihentikan, baik berhasil atau karena beberapa kondisi kesalahan.

void invocationFailed ( FailureDescription failure)

Melaporkan pemanggilan yang tidak lengkap karena beberapa kondisi kesalahan.

void invocationFailed (Throwable cause)

Melaporkan pemanggilan yang tidak lengkap karena beberapa kondisi kesalahan.

final void invocationStarted ( IInvocationContext context)

Melaporkan awal pemanggilan pengujian.

final void logAssociation (String dataName, LogFile logFile)

Dalam beberapa kasus, log harus sangat terkait dengan kasus pengujian, tetapi kesempatan untuk melakukannya langsung testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile) panggilan balik tidak dimungkinkan.

void processFinalInvocationLogs (TestRecordProto.TestRecord invocationLogs)

Gunakan catatan doa untuk mengirim satu per satu semua log terakhir dari doa tersebut.

void processFinalProto (TestRecordProto.TestRecord finalRecord)

Penanganan proto akhir dengan semua hasil.

void processStartInvocation (TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext)

Penanganan proto rekaman uji pemanggilan parsial setelah invocationStarted(com.android.tradefed.invoker.IInvocationContext) terjadi.

void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)

Penanganan proto catatan kasus pengujian yang diselesaikan setelah ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,HashMap)) terjadi.

void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)

Penanganan proto rekaman kasus uji parsial setelah testStarted(com.android.tradefed.result.TestDescription, long) terjadi.

void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)

Penanganan proto rekaman modul yang diselesaikan setelah testModuleEnded() terjadi.

void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)

Penanganan proto rekaman modul parsial setelah testModuleStarted(com.android.tradefed.invoker.IInvocationContext) terjadi.

void processTestRunEnded (TestRecordProto.TestRecord runRecord, boolean moduleInProgress)

Penanganan proto run record yang diselesaikan setelah ERROR(/#testRunEnded(long,HashMap)) terjadi.

void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)

Penanganan proto rekaman uji coba parsial setelah testRunStarted(String, int) terjadi.

void setGranularResults (boolean granularResults)
void setInlineRecordOfChildren (boolean inline)
boolean supportGranularResults ()

Mengembalikan Benar jika pelapor mendukung hasil granular, salah jika sebaliknya.

final void testAssumptionFailure ( TestDescription test, String trace)

Dipanggil saat tes atom menandai bahwa kondisi tersebut dianggap salah

final void testAssumptionFailure ( TestDescription test, FailureDescription failure)

Dipanggil saat tes atom menandai bahwa kondisi tersebut dianggap salah

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

Alternatif untuk ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) tempat kita dapat menentukan waktu berakhir secara langsung.

void testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, testMetrics)

Melaporkan akhir eksekusi dari kasus uji individual.

final void testFailed ( TestDescription test, FailureDescription failure)

Melaporkan kegagalan kasus uji individu.

final void testFailed ( TestDescription test, String trace)

Melaporkan kegagalan kasus uji individu.

final void testIgnored ( TestDescription test)

Dipanggil saat pengujian tidak akan dijalankan, umumnya karena metode pengujian dianotasi dengan org.junit.Ignore.

final void testModuleEnded ()

Melaporkan akhir dari sebuah modul yang dijalankan.

final void testModuleStarted ( IInvocationContext moduleContext)

Melaporkan awal dari modul yang sedang berjalan.

final void testRunEnded (long elapsedTimeMillis, runMetrics) testRunEnded (long elapsedTimeMillis, runMetrics)

Melaporkan akhir uji coba.

final void testRunFailed ( FailureDescription failure)

Uji coba laporan gagal diselesaikan karena kegagalan yang dijelaskan oleh FailureDescription .

final void testRunFailed (String errorMessage)

Uji coba laporan gagal diselesaikan karena kesalahan fatal.

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

Melaporkan awal uji coba.

final void testRunStarted (String runName, int testCount)

Melaporkan awal uji coba.

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

Melaporkan awal uji coba.

final void testStarted ( TestDescription test, long startTime)

Alternatif untuk testStarted(com.android.tradefed.result.TestDescription) tempat kami juga menentukan kapan pengujian dimulai, dikombinasikan dengan ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) untuk pengukuran yang akurat .

final void testStarted ( TestDescription test)

Melaporkan awal kasus uji individual.

Metode yang dilindungi

TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)

Membuat referensi anak untuk modul.

Konstruktor publik

ProtoResultReporter

public ProtoResultReporter ()

Metode publik

doaBerakhir

public final void invocationEnded (long elapsedTime)

Melaporkan bahwa pemanggilan telah dihentikan, baik berhasil atau karena beberapa kondisi kesalahan.

Akan dipanggil secara otomatis oleh kerangka kerja TradeFederation.

Parameter
elapsedTime long : waktu berlalu dari doa dalam ms

doa Gagal

public void invocationFailed (FailureDescription failure)

Melaporkan pemanggilan yang tidak lengkap karena beberapa kondisi kesalahan.

Akan dipanggil secara otomatis oleh kerangka kerja TradeFederation.

Parameter
failure FailureDescription : FailureDescription menjelaskan penyebab kegagalan

doa Gagal

public void invocationFailed (Throwable cause)

Melaporkan pemanggilan yang tidak lengkap karena beberapa kondisi kesalahan.

Akan dipanggil secara otomatis oleh kerangka kerja TradeFederation.

Parameter
cause Throwable : Penyebab kegagalan Throwable

invocationStarted

public final void invocationStarted (IInvocationContext context)

Melaporkan awal pemanggilan pengujian.

Akan dipanggil secara otomatis oleh kerangka kerja TradeFederation. Pelapor perlu mengganti metode ini untuk mendukung pelaporan beberapa perangkat.

Parameter
context IInvocationContext : informasi tentang doa

logAssociation

public final void logAssociation (String dataName, 
                LogFile logFile)

Dalam beberapa kasus, log harus sangat terkait dengan kasus pengujian, tetapi kesempatan untuk melakukannya langsung testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile) panggilan balik tidak dimungkinkan. Dengan demikian, panggilan balik ini memungkinkan untuk memberikan asosiasi yang kuat secara eksplisit.

Parameter
dataName String : Nama data

logFile LogFile : LogFile yang telah dicatat sebelumnya dan harus dikaitkan dengan kasus uji.

processFinalInvocationLogs

public void processFinalInvocationLogs (TestRecordProto.TestRecord invocationLogs)

Gunakan catatan doa untuk mengirim satu per satu semua log terakhir dari doa tersebut.

Parameter
invocationLogs TestRecordProto.TestRecord : Proto final yang mewakili pemanggilan.

processFinalProto

public void processFinalProto (TestRecordProto.TestRecord finalRecord)

Penanganan proto akhir dengan semua hasil.

Parameter
finalRecord TestRecordProto.TestRecord : Proto yang difinalisasi dengan semua hasil pemanggilan.

processStartInvokasi

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

Penanganan proto rekaman uji pemanggilan parsial setelah invocationStarted(com.android.tradefed.invoker.IInvocationContext) terjadi.

Parameter
invocationStartRecord TestRecordProto.TestRecord : Proto parsial diisi setelah pemanggilan Mulai.

invocationContext IInvocationContext : Doa IInvocationContext .

processTestCaseEnded

public void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)

Penanganan proto catatan kasus pengujian yang diselesaikan setelah ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,HashMap)) terjadi.

Parameter
testCaseRecord TestRecordProto.TestRecord : Proto final yang mewakili kasus uji.

processTestCaseStarted

public void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)

Penanganan proto rekaman kasus uji parsial setelah testStarted(com.android.tradefed.result.TestDescription, long) terjadi.

Parameter
testCaseStartedRecord TestRecordProto.TestRecord : Proto parsial yang mewakili kasus uji.

processTestModuleEnd

public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)

Penanganan proto rekaman modul yang diselesaikan setelah testModuleEnded() terjadi.

Parameter
moduleRecord TestRecordProto.TestRecord : Proto final yang mewakili modul.

processTestModuleStarted

public void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)

Penanganan proto rekaman modul parsial setelah testModuleStarted(com.android.tradefed.invoker.IInvocationContext) terjadi.

Parameter
moduleStartRecord TestRecordProto.TestRecord : Proto parsial yang mewakili modul.

processTestRunEnded

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

Penanganan proto run record yang diselesaikan setelah ERROR(/#testRunEnded(long,HashMap)) terjadi.

Parameter
runRecord TestRecordProto.TestRecord : Proto final yang mewakili proses.

moduleInProgress boolean : apakah modul sedang berjalan atau tidak.

processTestRunStarted

public void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)

Penanganan proto rekaman uji coba parsial setelah testRunStarted(String, int) terjadi.

Parameter
runStartedRecord TestRecordProto.TestRecord : Proto parsial yang mewakili proses.

setGranularResults

public void setGranularResults (boolean granularResults)

Parameter
granularResults boolean

setInlineRecordOfChildren

public void setInlineRecordOfChildren (boolean inline)

Parameter
inline boolean

supportGranularResults

public boolean supportGranularResults ()

Mengembalikan Benar jika pelapor mendukung hasil granular, salah jika sebaliknya.

Pengembalian
boolean

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                String trace)

Dipanggil saat tes atom menandai bahwa kondisi tersebut dianggap salah

Parameter
test TestDescription : mengidentifikasi tes

trace String : tumpukan jejak kegagalan

testAssumptionFailure

public final void testAssumptionFailure (TestDescription test, 
                FailureDescription failure)

Dipanggil saat tes atom menandai bahwa kondisi tersebut dianggap salah

Parameter
test TestDescription : mengidentifikasi tes

failure FailureDescription : FailureDescription menjelaskan kegagalan dan konteksnya.

testEnded

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

Alternatif untuk ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map)) tempat kita dapat menentukan waktu berakhir secara langsung. Kombinasikan dengan testStarted(com.android.tradefed.result.TestDescription, long) untuk pengukuran yang akurat.

Parameter
test TestDescription : mengidentifikasi tes

endTime long : waktu pengujian berakhir, diukur melalui System.currentTimeMillis()

testMetrics : ERROR(/Map) dari metrik yang dipancarkan

testEnded

public void testEnded (TestDescription test, 
                 testMetrics)

Melaporkan akhir eksekusi dari kasus uji individual.

Jika testFailed(TestDescription, FailureDescription) tidak dipanggil, tes ini lulus. Juga menampilkan metrik kunci/nilai apa pun yang mungkin telah dikeluarkan selama eksekusi kasus pengujian.

Parameter
test TestDescription : mengidentifikasi tes

testMetrics : ERROR(/Map) dari metrik yang dipancarkan

testFailed

public final void testFailed (TestDescription test, 
                FailureDescription failure)

Melaporkan kegagalan kasus uji individu.

Akan dipanggil antara testStarted dan testEnded.

Parameter
test TestDescription : mengidentifikasi tes

failure FailureDescription : FailureDescription menjelaskan kegagalan dan konteksnya.

testFailed

public final void testFailed (TestDescription test, 
                String trace)

Melaporkan kegagalan kasus uji individu.

Akan dipanggil antara testStarted dan testEnded.

Parameter
test TestDescription : mengidentifikasi tes

trace String : tumpukan jejak kegagalan

testIgnored

public final void testIgnored (TestDescription test)

Dipanggil saat pengujian tidak akan dijalankan, umumnya karena metode pengujian dianotasi dengan org.junit.Ignore.

Parameter
test TestDescription : mengidentifikasi tes

testModuleEnded

public final void testModuleEnded ()

Melaporkan akhir dari sebuah modul yang dijalankan.

testModuleStarted

public final void testModuleStarted (IInvocationContext moduleContext)

Melaporkan awal dari modul yang sedang berjalan. Callback ini dikaitkan dengan testModuleEnded() dan opsional dalam urutannya. Ini hanya digunakan selama menjalankan yang menggunakan modul: pelari berbasis suite.

Parameter
moduleContext IInvocationContext : IInvocationContext dari modul.

testRunEnded

public final void testRunEnded (long elapsedTimeMillis, 
                 runMetrics)

Melaporkan akhir uji coba. FIXME: Kami tidak dapat memiliki dua antarmuka Map<> dengan tipe yang berbeda, jadi kami harus menggunakan HashMap di sini.

Parameter
elapsedTimeMillis long : perangkat melaporkan waktu berlalu, dalam milidetik

runMetrics : key-value pair dilaporkan di akhir uji coba dengan Metric .

testRunFailed

public final void testRunFailed (FailureDescription failure)

Uji coba laporan gagal diselesaikan karena kegagalan yang dijelaskan oleh FailureDescription .

Parameter
failure FailureDescription : FailureDescription menjelaskan kegagalan dan konteksnya.

testRunFailed

public final void testRunFailed (String errorMessage)

Uji coba laporan gagal diselesaikan karena kesalahan fatal.

Parameter
errorMessage String : String yang menjelaskan alasan kegagalan proses.

testRunStarted

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

Melaporkan awal uji coba.

Parameter
runName String : nama uji coba

testCount int : jumlah total pengujian dalam uji coba

attemptNumber int : nomor urut, mengidentifikasi upaya berbeda dari runName yang sama yang berjalan berkali-kali. tryNumber adalah 0-diindeks dan harus bertambah setiap kali proses baru terjadi. misalnya, pengujian diulang ulang sebanyak 3 kali, harus memiliki total 4 proses di bawah runName yang sama dan nomor percobaan dari 0 hingga 3.

testRunStarted

public final void testRunStarted (String runName, 
                int testCount)

Melaporkan awal uji coba.

Parameter
runName String : nama uji coba

testCount int : jumlah total pengujian dalam uji coba

testRunStarted

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

Melaporkan awal uji coba.

Parameter
runName String : nama uji coba

testCount int : jumlah total pengujian dalam uji coba

attemptNumber int : nomor urut, mengidentifikasi upaya berbeda dari runName yang sama yang berjalan berkali-kali. tryNumber adalah 0-diindeks dan harus bertambah setiap kali proses baru terjadi. misalnya, pengujian diulang ulang sebanyak 3 kali, harus memiliki total 4 proses di bawah runName yang sama dan nomor percobaan dari 0 hingga 3.

startTime long : waktu proses dimulai, diukur melalui System.currentTimeMillis()

testStarted

public final void testStarted (TestDescription test, 
                long startTime)

Alternatif untuk testStarted(com.android.tradefed.result.TestDescription) tempat kami juga menentukan kapan pengujian dimulai, dikombinasikan dengan ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,Map)) untuk pengukuran yang akurat .

Parameter
test TestDescription : mengidentifikasi tes

startTime long : waktu pengujian dimulai, diukur melalui System.currentTimeMillis()

testStarted

public final void testStarted (TestDescription test)

Melaporkan awal kasus uji individu. Antarmuka yang lebih lama, harus menggunakan testStarted(com.android.tradefed.result.TestDescription) jika memungkinkan.

Parameter
test TestDescription : mengidentifikasi tes

Metode yang dilindungi

createModuleChildReference

protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)

Membuat referensi anak untuk modul.

Parameter
record TestRecordProto.TestRecord

Pengembalian
TestRecordProto.ChildReference