ProtoResultReporter
public
abstract
class
ProtoResultReporter
extends Object
implements
ILogSaverListener,
ISupportGranularResults,
ITestInvocationListener
| java.lang.Object | |
| ↳ | com.android.tradefed.result.proto.ProtoResultReporter |
Sonuç bildiren, tüm sonuçların yer aldığı bir TestRecord protobuf oluşturur. processFinalProto(TestRecord) içindeki nihai proto ile ne yapılacağını ele alacak şekilde genişletilmelidir.
Özet
Herkese açık oluşturucular | |
|---|---|
ProtoResultReporter()
|
|
Herkese açık yöntemler | |
|---|---|
final
void
|
invocationEnded(long elapsedTime)
Çağırmanın başarıyla mı yoksa bir hata durumu nedeniyle mi sonlandırıldığını bildirir. |
void
|
invocationFailed(FailureDescription failure)
Bir hata durumu nedeniyle eksik bir çağırma bildirir. |
void
|
invocationFailed(Throwable cause)
Bir hata durumu nedeniyle eksik bir çağırma bildirir. |
void
|
invocationSkipped(SkipReason reason)
Bir çağırmayı atlandı olarak bildirir. |
void
|
invocationStarted(IInvocationContext context)
Test çağrısının başlangıcını bildirir. |
final
void
|
logAssociation(String dataName, LogFile logFile)
Bazı durumlarda, günlüğün test senaryolarıyla güçlü bir şekilde ilişkilendirilmesi gerekir ancak doğrudan |
void
|
processFinalInvocationLogs(TestRecordProto.TestRecord invocationLogs)
Çağırmanın tüm nihai günlüklerini tek tek göndermek için çağırma kaydını kullanın. |
void
|
processFinalProto(TestRecordProto.TestRecord finalRecord)
Tüm sonuçların yer aldığı nihai prototipin işlenmesi. |
void
|
processStartInvocation(TestRecordProto.TestRecord invocationStartRecord, IInvocationContext invocationContext)
|
void
|
processTestCaseEnded(TestRecordProto.TestRecord testCaseRecord)
|
void
|
processTestCaseStarted(TestRecordProto.TestRecord testCaseStartedRecord)
|
void
|
processTestModuleEnd(TestRecordProto.TestRecord moduleRecord)
|
void
|
processTestModuleStarted(TestRecordProto.TestRecord moduleStartRecord)
|
void
|
processTestRunEnded(TestRecordProto.TestRecord runRecord, boolean moduleInProgress)
|
void
|
processTestRunStarted(TestRecordProto.TestRecord runStartedRecord)
|
void
|
setGranularResults(boolean granularResults)
|
void
|
setInlineRecordOfChildren(boolean inline)
|
boolean
|
supportGranularResults()
Raporlayıcı ayrıntılı sonuçları destekliyorsa True, aksi takdirde False değerini döndürür. |
final
void
|
testAssumptionFailure(TestDescription test, String trace)
Birim testi, yanlış olduğu varsayılan bir koşulu işaretlediğinde çağrılır. |
final
void
|
testAssumptionFailure(TestDescription test, FailureDescription failure)
Birim testi, yanlış olduğu varsayılan bir koşulu işaretlediğinde çağrılır. |
final
void
|
testEnded(TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
Bitiş zamanını doğrudan belirtebileceğimiz |
void
|
testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
Tek bir test senaryosunun yürütülmesinin sonunu bildirir. |
final
void
|
testFailed(TestDescription test, FailureDescription failure)
Tek bir test senaryosunun başarısızlığını bildirir. |
final
void
|
testFailed(TestDescription test, String trace)
Tek bir test senaryosunun başarısızlığını bildirir. |
final
void
|
testIgnored(TestDescription test)
Genellikle bir test yöntemi org.junit.Ignore ile açıklama eklenmiş olduğundan bir test çalıştırılmayacağı zaman çağrılır. |
final
void
|
testModuleEnded()
Bir modül çalıştırmanın sonunu bildirir. |
final
void
|
testModuleStarted(IInvocationContext moduleContext)
Çalışan bir modülün başlangıcını bildirir. |
final
void
|
testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)
Test çalıştırmasının sonunu bildirir. |
final
void
|
testRunFailed(FailureDescription failure)
Raporlar, |
final
void
|
testRunFailed(String errorMessage)
Raporlar test çalıştırması, ölümcül bir hata nedeniyle tamamlanamadı. |
void
|
testRunStarted(String runName, int testCount, int attemptNumber)
Test çalıştırmasının başlangıcını bildirir. |
final
void
|
testRunStarted(String runName, int testCount)
Test çalıştırmasının başlangıcını bildirir. |
void
|
testRunStarted(String runName, int testCount, int attemptNumber, long startTime)
Test çalıştırmasının başlangıcını bildirir. |
final
void
|
testSkipped(TestDescription test, SkipReason reason)
Bir test atlandığında ve genellikle beklenmeyen bir nedenle yürütülmediğinde çağrılır. |
final
void
|
testStarted(TestDescription test, long startTime)
Testin ne zaman başlatıldığını da belirttiğimiz |
final
void
|
testStarted(TestDescription test)
Tek bir test senaryosunun başlangıcını bildirir. |
Korunan yöntemler | |
|---|---|
void
|
afterModuleEnd()
|
void
|
beforeModuleStart()
|
TestRecordProto.ChildReference
|
createModuleChildReference(TestRecordProto.TestRecord record)
Bir modül için alt referans oluşturur. |
Herkese açık oluşturucular
ProtoResultReporter
public ProtoResultReporter ()
Herkese açık yöntemler
invocationEnded
public final void invocationEnded (long elapsedTime)
Çağırmanın başarıyla mı yoksa bir hata durumu nedeniyle mi sonlandırıldığını bildirir.
TradeFederation çerçevesi tarafından otomatik olarak çağrılır.
| Parametreler | |
|---|---|
elapsedTime |
long: çağrının geçen süresi (ms) |
invocationFailed
public void invocationFailed (FailureDescription failure)
Bir hata durumu nedeniyle eksik bir çağırma bildirir.
TradeFederation çerçevesi tarafından otomatik olarak çağrılır.
| Parametreler | |
|---|---|
failure |
FailureDescription: Hatanın nedenini açıklayan FailureDescription |
invocationFailed
public void invocationFailed (Throwable cause)
Bir hata durumu nedeniyle eksik bir çağırma bildirir.
TradeFederation çerçevesi tarafından otomatik olarak çağrılır.
| Parametreler | |
|---|---|
cause |
Throwable: hatanın Throwable nedeni |
invocationSkipped
public void invocationSkipped (SkipReason reason)
Bir çağırmayı atlandı olarak bildirir.
| Parametreler | |
|---|---|
reason |
SkipReason |
invocationStarted
public void invocationStarted (IInvocationContext context)
Test çağrısının başlangıcını bildirir.
TradeFederation çerçevesi tarafından otomatik olarak çağrılır. Raporcuların, birden fazla cihazın raporlamasını desteklemek için bu yöntemi geçersiz kılması gerekir.
| Parametreler | |
|---|---|
context |
IInvocationContext: çağrı hakkında bilgiler |
logAssociation
public final void logAssociation (String dataName,
LogFile logFile)Bazı durumlarda, günlüğün test senaryolarıyla güçlü bir şekilde ilişkilendirilmesi gerekir ancak doğrudan testLogSaved(String,LogDataType,InputStreamSource,LogFile) geri çağırmada bunu yapmak mümkün değildir. Bu nedenle, bu geri çağırma, güçlü bir ilişkilendirme sağlamaya olanak tanır.
| Parametreler | |
|---|---|
dataName |
String: Verilerin adı |
logFile |
LogFile: Daha önce kaydedilmiş ve test senaryosuyla ilişkilendirilmesi gereken LogFile. |
processFinalInvocationLogs
public void processFinalInvocationLogs (TestRecordProto.TestRecord invocationLogs)
Çağırmanın tüm nihai günlüklerini tek tek göndermek için çağırma kaydını kullanın.
| Parametreler | |
|---|---|
invocationLogs |
TestRecordProto.TestRecord: Çağırmayı temsil eden sonlandırılmış proto. |
processFinalProto
public void processFinalProto (TestRecordProto.TestRecord finalRecord)
Tüm sonuçların yer aldığı nihai prototipin işlenmesi.
| Parametreler | |
|---|---|
finalRecord |
TestRecordProto.TestRecord: Tüm çağırma sonuçlarını içeren son prototip. |
processStartInvocation
public void processStartInvocation (TestRecordProto.TestRecord invocationStartRecord,
IInvocationContext invocationContext)invocationStarted(IInvocationContext) gerçekleştikten sonra kısmi çağırma testi kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
invocationStartRecord |
TestRecordProto.TestRecord: invocationStart'tan sonra doldurulan kısmi proto. |
invocationContext |
IInvocationContext: Çağrı IInvocationContext. |
processTestCaseEnded
public void processTestCaseEnded (TestRecordProto.TestRecord testCaseRecord)
testEnded(TestDescription,long,HashMap) gerçekleştikten sonra sonlandırılmış test durumu kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
testCaseRecord |
TestRecordProto.TestRecord: Bir test durumunu temsil eden sonlandırılmış proto. |
processTestCaseStarted
public void processTestCaseStarted (TestRecordProto.TestRecord testCaseStartedRecord)
testStarted(TestDescription,long) işlemi gerçekleştikten sonra kısmi test durumu kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
testCaseStartedRecord |
TestRecordProto.TestRecord: Test durumunu temsil eden kısmi proto. |
processTestModuleEnd
public void processTestModuleEnd (TestRecordProto.TestRecord moduleRecord)
testModuleEnded() gerçekleştikten sonra kesinleştirilmiş modül kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
moduleRecord |
TestRecordProto.TestRecord: Modülü temsil eden son proto. |
processTestModuleStarted
public void processTestModuleStarted (TestRecordProto.TestRecord moduleStartRecord)
testModuleStarted(IInvocationContext) işleminden sonra kısmi modül kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
moduleStartRecord |
TestRecordProto.TestRecord: Modülü temsil eden kısmi proto. |
processTestRunEnded
public void processTestRunEnded (TestRecordProto.TestRecord runRecord,
boolean moduleInProgress)testRunEnded(long,HashMap) gerçekleştikten sonra tamamlanmış çalıştırma kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
runRecord |
TestRecordProto.TestRecord: Çalıştırmayı temsil eden son proto. |
moduleInProgress |
boolean: Modülün devam edip etmediği |
processTestRunStarted
public void processTestRunStarted (TestRecordProto.TestRecord runStartedRecord)
testRunStarted(String,int)
gerçekleştikten sonra kısmi test çalıştırma kaydı proto'sunun işlenmesi.
| Parametreler | |
|---|---|
runStartedRecord |
TestRecordProto.TestRecord: Çalıştırmayı temsil eden kısmi proto. |
setGranularResults
public void setGranularResults (boolean granularResults)
| Parametreler | |
|---|---|
granularResults |
boolean |
setInlineRecordOfChildren
public void setInlineRecordOfChildren (boolean inline)
| Parametreler | |
|---|---|
inline |
boolean |
supportGranularResults
public boolean supportGranularResults ()
Raporlayıcı ayrıntılı sonuçları destekliyorsa True, aksi takdirde False değerini döndürür.
| İadeler | |
|---|---|
boolean |
|
testAssumptionFailure
public final void testAssumptionFailure (TestDescription test, String trace)
Birim testi, yanlış olduğu varsayılan bir koşulu işaretlediğinde çağrılır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
trace |
String: Hatayla sonuçlanan yığın izleme |
testAssumptionFailure
public final void testAssumptionFailure (TestDescription test, FailureDescription failure)
Birim testi, yanlış olduğu varsayılan bir koşulu işaretlediğinde çağrılır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
failure |
FailureDescription: FailureDescription arızayı ve bağlamını açıklayın. |
testEnded
public final void testEnded (TestDescription test, long endTime, HashMap<String, MetricMeasurement.Metric> testMetrics)
Bitiş zamanını doğrudan belirtebileceğimiz testEnded(TestDescription,Map) işlevinin alternatifi. Doğru ölçüm için testStarted(TestDescription,long) ile birlikte kullanın.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
endTime |
long: Testin sona erdiği zaman (System.currentTimeMillis() üzerinden ölçülür) |
testMetrics |
HashMap: yayınlanan metriklerin Map |
testEnded
public void testEnded (TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
Tek bir test senaryosunun yürütülmesinin sonunu bildirir.
testFailed(TestDescription, FailureDescription) çağrılmadıysa bu test başarılı olur. Ayrıca, test senaryosunun yürütülmesi sırasında yayınlanmış olabilecek tüm anahtar/değer metriklerini de döndürür.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
testMetrics |
HashMap: yayınlanan metriklerin Map |
testFailed
public final void testFailed (TestDescription test, FailureDescription failure)
Tek bir test senaryosunun başarısızlığını bildirir.
testStarted ve testEnded arasında çağrılır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
failure |
FailureDescription: FailureDescription arızayı ve bağlamını açıklayın. |
testFailed
public final void testFailed (TestDescription test, String trace)
Tek bir test senaryosunun başarısızlığını bildirir.
testStarted ve testEnded arasında çağrılır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
trace |
String: Hatayla sonuçlanan yığın izleme |
testIgnored
public final void testIgnored (TestDescription test)
Genellikle bir test yöntemi org.junit.Ignore ile açıklama eklenmiş olduğundan bir test çalıştırılmayacağı zaman çağrılır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
testModuleEnded
public final void testModuleEnded ()
Bir modül çalıştırmanın sonunu bildirir.
testModuleStarted
public final void testModuleStarted (IInvocationContext moduleContext)
Çalışan bir modülün başlangıcını bildirir. Bu geri çağırma, testModuleEnded() ile ilişkilidir ve dizide isteğe bağlıdır. Yalnızca modül kullanan bir çalıştırma sırasında kullanılır: pakete dayalı çalıştırıcılar.
| Parametreler | |
|---|---|
moduleContext |
IInvocationContext: modülün IInvocationContext. |
testRunEnded
public final void testRunEnded (long elapsedTimeMillis,
HashMap<String, MetricMeasurement.Metric> runMetrics)Test çalıştırmasının sonunu bildirir. DÜZELTİLMESİ GEREKEN YER: Farklı türde iki Map<> arayüzümüz olamaz. Bu nedenle burada HashMap kullanmamız gerekiyor.
| Parametreler | |
|---|---|
elapsedTimeMillis |
long: Cihazın bildirdiği geçen süre (milisaniye cinsinden) |
runMetrics |
HashMap: Metric ile yapılan bir test çalıştırmasının sonunda bildirilen anahtar/değer çiftleri. |
testRunFailed
public final void testRunFailed (FailureDescription failure)
Raporlar, FailureDescription tarafından açıklanan bir hata nedeniyle test çalıştırmasını tamamlayamadı.
| Parametreler | |
|---|---|
failure |
FailureDescription: FailureDescription arızayı ve bağlamını açıklayın. |
testRunFailed
public final void testRunFailed (String errorMessage)
Raporlar test çalıştırması, ölümcül bir hata nedeniyle tamamlanamadı.
| Parametreler | |
|---|---|
errorMessage |
String: Çalıştırma hatasının nedenini açıklayan String. |
testRunStarted
public void testRunStarted (String runName,
int testCount,
int attemptNumber)Test çalıştırmasının başlangıcını bildirir.
| Parametreler | |
|---|---|
runName |
String: Test çalıştırmasının adı |
testCount |
int: test çalıştırmasındaki toplam test sayısı |
attemptNumber |
int: Aynı runName'in birden fazla kez çalıştırılan farklı denemelerini tanımlayan sipariş numarası. attemptNumber, 0 tabanlıdır ve her yeni çalıştırmada artırılmalıdır. Örneğin, bir test 3 kez ayrıntılı olarak yeniden denenirse aynı runName altında toplam 4 çalıştırma olmalı ve attemptNumber 0 ile 3 arasında olmalıdır. |
testRunStarted
public final void testRunStarted (String runName,
int testCount)Test çalıştırmasının başlangıcını bildirir.
| Parametreler | |
|---|---|
runName |
String: Test çalıştırmasının adı |
testCount |
int: test çalıştırmasındaki toplam test sayısı |
testRunStarted
public void testRunStarted (String runName,
int testCount,
int attemptNumber,
long startTime)Test çalıştırmasının başlangıcını bildirir.
| Parametreler | |
|---|---|
runName |
String: Test çalıştırmasının adı |
testCount |
int: test çalıştırmasındaki toplam test sayısı |
attemptNumber |
int: Aynı runName'in birden fazla kez çalıştırılan farklı denemelerini tanımlayan sipariş numarası. attemptNumber, 0 tabanlıdır ve her yeni çalıştırmada artırılmalıdır. Örneğin, bir test 3 kez ayrıntılı olarak yeniden denenirse aynı runName altında toplam 4 çalıştırma olmalı ve attemptNumber 0 ile 3 arasında olmalıdır. |
startTime |
long: Çalıştırmanın başladığı zaman (System.currentTimeMillis() üzerinden ölçülür) |
testSkipped
public final void testSkipped (TestDescription test, SkipReason reason)
Bir test atlandığında ve genellikle beklenmeyen bir nedenle yürütülmediğinde çağrılır. Bu testler, uygun bir yürütme elde etmek için yeniden denenmeye çalışılacaktır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
reason |
SkipReason: SkipReason |
testStarted
public final void testStarted (TestDescription test, long startTime)
Testin ne zaman başlatıldığını da belirttiğimiz testStarted(TestDescription) yerine, doğru ölçüm için testEnded(TestDescription,long,Map) ile birlikte kullanılır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
startTime |
long: Testin başladığı zaman (System.currentTimeMillis() üzerinden ölçülür) |
testStarted
public final void testStarted (TestDescription test)
Tek bir test senaryosunun başlangıcını bildirir. Eski arayüz, mümkün olduğunda testStarted(TestDescription) kullanılmalıdır.
| Parametreler | |
|---|---|
test |
TestDescription: Testi tanımlar. |
Korunan yöntemler
afterModuleEnd
protected void afterModuleEnd ()
beforeModuleStart
protected void beforeModuleStart ()
createModuleChildReference
protected TestRecordProto.ChildReference createModuleChildReference (TestRecordProto.TestRecord record)
Bir modül için alt referans oluşturur.
| Parametreler | |
|---|---|
record |
TestRecordProto.TestRecord |
| Return'ler | |
|---|---|
TestRecordProto.ChildReference |
|