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 permintaan yang tidak lengkap karena beberapa kondisi kesalahan. |
void | invocationFailed (Throwable cause) Melaporkan permintaan yang tidak lengkap karena beberapa kondisi kesalahan. |
final void | invocationStarted ( IInvocationContext context) Melaporkan awal pemanggilan tes. |
final void | logAssociation (String dataName, LogFile logFile) Dalam beberapa kasus, log harus sangat terkait dengan kasus uji, tetapi kesempatan untuk melakukannya pada |
void | processFinalInvocationLogs (TestRecordProto.TestRecord invocationLogs) Gunakan catatan doa untuk mengirim satu per satu semua log terakhir dari permintaan. |
void | processFinalProto (TestRecordProto.TestRecord finalRecord) Penanganan proto akhir dengan semua hasil. |
void | processStartInvocation (TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext) Penanganan proto catatan uji pemanggilan parsial setelah |
void | processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord) Penanganan proto catatan kasus uji yang diselesaikan setelah |
void | processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord) Penanganan proto catatan kasus uji parsial setelah |
void | processTestModuleEnd (TestRecordProto.TestRecord moduleRecord) Penanganan proto rekaman modul yang diselesaikan setelah |
void | processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord) Penanganan proto rekaman modul parsial setelah |
void | processTestRunEnded (TestRecordProto.TestRecord runRecord, boolean moduleInProgress) Penanganan proto record run yang diselesaikan setelah |
void | processTestRunStarted (TestRecordProto.TestRecord runStartedRecord) Penanganan proto rekaman uji coba parsial setelah |
void | setGranularResults (boolean granularResults) |
void | setInlineRecordOfChildren (boolean inline) |
boolean | supportGranularResults () Mengembalikan True jika pelapor mendukung hasil granular, salah jika sebaliknya. |
final void | testAssumptionFailure ( TestDescription test, String trace) Dipanggil ketika uji atom menandai bahwa ia mengasumsikan kondisi yang salah |
final void | testAssumptionFailure ( TestDescription test, FailureDescription failure) Dipanggil ketika uji atom menandai bahwa ia mengasumsikan kondisi yang salah |
final void | testEnded ( TestDescription test, long endTime, testMetrics) testEnded ( TestDescription test, long endTime, testMetrics) Alternatif untuk |
void | testEnded ( TestDescription test, testMetrics) testEnded ( TestDescription test, testMetrics) Melaporkan akhir eksekusi kasus uji individu. |
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 dijelaskan dengan org.junit.Ignore. |
final void | testModuleEnded () Melaporkan akhir dari modul yang dijalankan. |
final void | testModuleStarted ( IInvocationContext moduleContext) Melaporkan awal modul berjalan. |
final void | testRunEnded (long elapsedTimeMillis, runMetrics) testRunEnded (long elapsedTimeMillis, runMetrics) Laporan akhir uji coba. |
final void | testRunFailed ( FailureDescription failure) Laporan uji coba gagal diselesaikan karena kegagalan yang dijelaskan oleh |
final void | testRunFailed (String errorMessage) Laporan uji coba gagal diselesaikan karena kesalahan fatal. |
void | testRunStarted (String runName, int testCount, int attemptNumber) Melaporkan dimulainya uji coba. |
final void | testRunStarted (String runName, int testCount) Melaporkan dimulainya uji coba. |
void | testRunStarted (String runName, int testCount, int attemptNumber, long startTime) Melaporkan dimulainya uji coba. |
final void | testStarted ( TestDescription test, long startTime) Alternatif untuk |
final void | testStarted ( TestDescription test) Melaporkan awal kasus uji individu. |
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 secara otomatis dipanggil oleh kerangka TradeFederation.Parameter | |
---|---|
elapsedTime | long : waktu yang telah berlalu dari pemanggilan dalam ms |
doa gagal
public void invocationFailed (FailureDescription failure)
Melaporkan permintaan yang tidak lengkap karena beberapa kondisi kesalahan.
Akan secara otomatis dipanggil oleh kerangka TradeFederation.
Parameter | |
---|---|
failure | FailureDescription : FailureDescription yang menjelaskan penyebab kegagalan |
doa gagal
public void invocationFailed (Throwable cause)
Melaporkan permintaan yang tidak lengkap karena beberapa kondisi kesalahan.
Akan secara otomatis dipanggil oleh kerangka TradeFederation.Parameter | |
---|---|
cause | Throwable : penyebab kegagalan Throwable |
doaDimulai
public final void invocationStarted (IInvocationContext context)
Melaporkan awal pemanggilan tes.
Akan secara otomatis dipanggil oleh kerangka TradeFederation. Reporter perlu mengganti metode ini untuk mendukung pelaporan beberapa perangkat.
Parameter | |
---|---|
context | IInvocationContext : informasi tentang pemanggilan |
logAsosiasi
public final void logAssociation (String dataName, LogFile logFile)
Dalam beberapa kasus, log harus sangat terkait dengan kasus uji, tetapi kesempatan untuk melakukannya pada testLogSaved(String, com.android.tradefed.result.LogDataType, com.android.tradefed.result.InputStreamSource, com.android.tradefed.result.LogFile)
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 datanya |
logFile | LogFile : LogFile yang telah dicatat sebelumnya dan harus dikaitkan dengan kasus uji. |
prosesFinalInvocationLogs
public void processFinalInvocationLogs (TestRecordProto.TestRecord invocationLogs)
Gunakan catatan doa untuk mengirim satu per satu semua log terakhir dari permintaan.
Parameter | |
---|---|
invocationLogs | TestRecordProto.TestRecord : Proto final yang mewakili pemanggilan. |
prosesFinalProto
public void processFinalProto (TestRecordProto.TestRecord finalRecord)
Penanganan proto akhir dengan semua hasil.
Parameter | |
---|---|
finalRecord | TestRecordProto.TestRecord : Proto final dengan semua hasil pemanggilan. |
prosesMulaiInvokasi
public void processStartInvocation (TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext)
Penanganan proto catatan uji pemanggilan parsial setelah invocationStarted(com.android.tradefed.invoker.IInvocationContext)
terjadi.
Parameter | |
---|---|
invocationStartRecord | TestRecordProto.TestRecord : Proto parsial diisi setelah invocationStart. |
invocationContext | IInvocationContext : Doa IInvocationContext . |
prosesTestCaseEnded
public void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)
Penanganan proto catatan kasus uji yang diselesaikan setelah ERROR(/#testEnded(com.android.tradefed.result.TestDescription,long,HashMap))
terjadi.
Parameter | |
---|---|
testCaseRecord | TestRecordProto.TestRecord : Proto final yang mewakili kasus uji. |
prosesTestCaseDimulai
public void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)
Penanganan proto catatan kasus uji parsial setelah testStarted(com.android.tradefed.result.TestDescription, long)
terjadi.
Parameter | |
---|---|
testCaseStartedRecord | TestRecordProto.TestRecord : Proto parsial yang mewakili kasus uji. |
prosesTestModuleEnd
public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)
Penanganan proto rekaman modul yang diselesaikan setelah testModuleEnded()
terjadi.
Parameter | |
---|---|
moduleRecord | TestRecordProto.TestRecord : Proto final yang mewakili modul. |
processTestModuleDimulai
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. |
prosesTestRunEnded
public void processTestRunEnded (TestRecordProto.TestRecord runRecord, boolean moduleInProgress)
Penanganan proto record run yang diselesaikan setelah ERROR(/#testRunEnded(long,HashMap))
terjadi.
Parameter | |
---|---|
runRecord | TestRecordProto.TestRecord : Proto final yang mewakili proses. |
moduleInProgress | boolean : apakah modul sedang berlangsung atau tidak. |
prosesTestRunDimulai
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 |
dukunganGranularResults
public boolean supportGranularResults ()
Mengembalikan True jika pelapor mendukung hasil granular, salah jika sebaliknya.
Kembali | |
---|---|
boolean |
tesAsumsiKegagalan
public final void testAssumptionFailure (TestDescription test, String trace)
Dipanggil ketika uji atom menandai bahwa ia mengasumsikan kondisi yang salah
Parameter | |
---|---|
test | TestDescription : mengidentifikasi tes |
trace | String : tumpukan jejak kegagalan |
tesAsumsiKegagalan
public final void testAssumptionFailure (TestDescription test, FailureDescription failure)
Dipanggil ketika uji atom menandai bahwa ia mengasumsikan kondisi yang salah
Parameter | |
---|---|
test | TestDescription : mengidentifikasi tes |
failure | FailureDescription : FailureDescription menggambarkan kegagalan dan konteksnya. |
tesBerakhir
public final void testEnded (TestDescription test, long endTime,testMetrics)
Alternatif untuk ERROR(/#testEnded(com.android.tradefed.result.TestDescription,Map))
di mana kita dapat menentukan waktu akhir secara langsung. Kombinasikan dengan testStarted(com.android.tradefed.result.TestDescription, long)
untuk pengukuran yang akurat.
Parameter | |
---|---|
test | TestDescription : mengidentifikasi tes |
endTime | long : waktu tes berakhir, diukur melalui System.currentTimeMillis() |
testMetrics | ERROR(/Map) dari metrik yang dipancarkan |
tesBerakhir
public void testEnded (TestDescription test,testMetrics)
Melaporkan akhir eksekusi kasus uji individu.
Jika testFailed(TestDescription, FailureDescription)
tidak dipanggil, tes ini lulus. Juga mengembalikan metrik kunci/nilai apa pun yang mungkin telah dipancarkan selama eksekusi kasus uji.
Parameter | |
---|---|
test | TestDescription : mengidentifikasi tes |
testMetrics | ERROR(/Map) dari metrik yang dipancarkan |
tesGagal
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 menggambarkan kegagalan dan konteksnya. |
tesGagal
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 |
tesDiabaikan
public final void testIgnored (TestDescription test)
Dipanggil saat pengujian tidak akan dijalankan, umumnya karena metode pengujian dijelaskan dengan org.junit.Ignore.
Parameter | |
---|---|
test | TestDescription : mengidentifikasi tes |
testModuledEnd
public final void testModuleEnded ()
Melaporkan akhir dari modul yang dijalankan.
testModuleDimulai
public final void testModuleStarted (IInvocationContext moduleContext)
Melaporkan awal modul berjalan. Callback ini dikaitkan dengan testModuleEnded()
dan bersifat opsional dalam urutannya. Ini hanya digunakan selama menjalankan yang menggunakan modul: pelari berbasis suite.
Parameter | |
---|---|
moduleContext | IInvocationContext : IInvocationContext dari modul. |
testRunEnd
public final void testRunEnded (long elapsedTimeMillis,runMetrics)
Laporan 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 yang telah berlalu, dalam milidetik |
runMetrics | Metric . |
testRunFailed
public final void testRunFailed (FailureDescription failure)
Laporan uji coba gagal diselesaikan karena kegagalan yang dijelaskan oleh FailureDescription
.
Parameter | |
---|---|
failure | FailureDescription : FailureDescription menggambarkan kegagalan dan konteksnya. |
testRunFailed
public final void testRunFailed (String errorMessage)
Laporan uji coba gagal diselesaikan karena kesalahan fatal.
Parameter | |
---|---|
errorMessage | String : String yang menjelaskan alasan kegagalan menjalankan. |
testRunMulai
public void testRunStarted (String runName, int testCount, int attemptNumber)
Melaporkan dimulainya uji coba.
Parameter | |
---|---|
runName | String : nama uji coba |
testCount | int : jumlah total tes dalam uji coba |
attemptNumber | int : nomor urut, mengidentifikasi upaya berbeda dari runName yang sama yang dijalankan beberapa kali. TryNumber diindeks 0 dan harus bertambah setiap kali proses baru terjadi. misalnya Sebuah tes granular dicoba ulang 3 kali, harus memiliki 4 total berjalan di bawah runName yang sama dan tryNumber adalah dari 0 hingga 3. |
testRunMulai
public final void testRunStarted (String runName, int testCount)
Melaporkan dimulainya uji coba.
Parameter | |
---|---|
runName | String : nama uji coba |
testCount | int : jumlah total tes dalam uji coba |
testRunMulai
public void testRunStarted (String runName, int testCount, int attemptNumber, long startTime)
Melaporkan dimulainya uji coba.
Parameter | |
---|---|
runName | String : nama uji coba |
testCount | int : jumlah total tes dalam uji coba |
attemptNumber | int : nomor urut, mengidentifikasi upaya berbeda dari runName yang sama yang dijalankan beberapa kali. TryNumber diindeks 0 dan harus bertambah setiap kali proses baru terjadi. misalnya Sebuah tes granular dicoba ulang 3 kali, harus memiliki 4 total berjalan di bawah runName yang sama dan tryNumber adalah dari 0 hingga 3. |
startTime | long : waktu run dimulai, diukur melalui System.currentTimeMillis() |
tesMulai
public final void testStarted (TestDescription test, long startTime)
Alternatif untuk testStarted(com.android.tradefed.result.TestDescription)
di mana 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 tes dimulai, diukur melalui System.currentTimeMillis() |
tesMulai
public final void testStarted (TestDescription test)
Melaporkan awal dari kasus uji individu. Antarmuka yang lebih lama, harus menggunakan testStarted(com.android.tradefed.result.TestDescription)
bila memungkinkan.
Parameter | |
---|---|
test | TestDescription : mengidentifikasi tes |
Metode yang dilindungi
buatModuleChildReference
protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)
Membuat referensi anak untuk modul.
Parameter | |
---|---|
record | TestRecordProto.TestRecord |
Kembali | |
---|---|
TestRecordProto.ChildReference |