TestResultListener

public abstract class TestResultListener
extends Object implements ITestLifeCycleReceiver

java.lang.Object
   ↳ com.android.tradefed.result.TestResultListener


Yalnızca tek tek test sonuçlarıyla ilgilenen uygulayıcılar için ITestLifecycleListener'ın basitleştirilmiş bir sürümü.

Çeşitli yaşam döngüsü etkinliklerini testResult yöntemine göre filtreler.

İş parçacığı açısından güvenli DEĞİLDİR ve özellikle ITestLifecycleListener etkinliklerinin sırayla alındığını varsayar.

Özet

Herkese açık oluşturucular

TestResultListener()

Herkese açık yöntemler

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 testEnded(TestDescription test, long endTime, Map<String, String> testMetrics)

Bitiş zamanını doğrudan belirtebileceğimiz testEnded(TestDescription,Map) işlevinin alternatifi.

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.

final void testEnded(TestDescription test, Map<String, String> testMetrics)

Tek bir test senaryosunun yürütülmesinin sonunu bildirir.

final void testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)

Tek bir test senaryosunun yürütülmesinin sonunu 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.

abstract void testResult(TestDescription test, TestResult result)
void testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)

Test çalıştırmasının sonunu bildirir.

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 testStarted(TestDescription) yerine, doğru ölçüm için testEnded(TestDescription,long,Map) ile birlikte kullanılır.

final void testStarted(TestDescription test)

Tek bir test senaryosunun başlangıcını bildirir.

Herkese açık oluşturucular

TestResultListener

public TestResultListener ()

Herkese açık yöntemler

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

testEnded

public final void testEnded (TestDescription test, 
                long endTime, 
                Map<String, String> 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 Map: yayınlanan metriklerin Map

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 final void testEnded (TestDescription test, 
                Map<String, String> 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 Map: yayınlanan metriklerin Map

testEnded

public final 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, 
                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.

testResult

public abstract void testResult (TestDescription test, 
                TestResult result)

Parametreler
test TestDescription

result TestResult

testRunEnded

public 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.

testSkipped

public 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.