ToplamaTestDinleyici
public class CollectingTestListener
extends Object
implements ITestInvocationListener, ILogSaverListener
java.lang.Nesne | |
↳ | com.android.tradefed.result.CollectingTestListener |
Bir ITestInvocationListener
tüm test sonuçlarını toplayacaktır.
Bu nesne, kullanılan veri yapılarını evreli olmasına rağmen, ITestInvocationListener
geri aramalar doğru sırada adı gerekir.
Özet
Kamu inşaatçıları | |
---|---|
CollectingTestListener () |
Genel yöntemler | |
---|---|
IBuildInfo | getBuildInfo () Bu yöntem kullanımdan kaldırılmıştır. güvenmek |
TestRunResult | getCurrentRunResults () Geçerli test çalıştırması için sonuçları alır. |
int | getExpectedTests () Beklenen test sayısının sayısını döndürür. |
IInvocationContext | getInvocationContext () Aracılığıyla bildirildi çağırma bağlamı Return |
getMergedTestRunResults () Farklı denemelerdeki tüm çalıştırmalar için birleştirilmiş sonuç koleksiyonunu döndürün. | |
IInvocationContext | getModuleContextForRunResult (String testRunName) İade |
MultiMap<String, LogFile> | getModuleLogFiles () Modülle ilişkili tüm kayıtlı dosyayı içeren haritanın bir kopyasını döndürür |
MultiMap<String, LogFile> | getNonAssociatedLogFiles () Bir test çalıştırması veya modül ile ilişkili olmayan tüm günlüğe kaydedilmiş dosyaları içeren haritanın bir kopyasını döndürür. |
int | getNumAllFailedTestRuns () Başarısızlık durumundaki toplam test çalıştırması sayısını döndürür |
int | getNumAllFailedTests () Başarısızlık durumundaki toplam sınama sayısını döndürür (yalnızca başarısız, varsayım başarısızlıkları buna dahil edilmez). |
int | getNumTestsInState (TestResult.TestStatus status) Bu çalıştırma için verilen durumdaki test sayısını döndürür. |
int | getNumTotalTests () Tüm çalıştırmalar için tamamlanmış testlerin toplam sayısını verir. |
IBuildInfo | getPrimaryBuildInfo () Yoluyla bildirildi birincil yapı bilgi verir |
getRunResults () Bu yöntem kullanımdan kaldırılmıştır. Kullanın | |
TestRunResult | getTestRunAtAttempt (String testRunName, int attempt) Dönüş |
int | getTestRunAttemptCount (String testRunName) Belirli bir test çalıştırması adı için deneme sayısını döndürür. |
getTestRunAttempts (String testRunName) Bir yönelik bütün girişimlere alır | |
getTestRunForAttempts (int attempt) Belirli bir deneme için tüm sonuçları alır. | |
getTestRunNames () Tüm test çalıştırmaları için tüm adları döndürün. | |
boolean | hasFailedTests () Çağrının herhangi bir başarısız veya varsayım testi başarısız olup olmadığını döndürür. |
boolean | hasTestRunResultsForName (String testRunName) Belirli bir test çalıştırması adının herhangi bir sonucu olup olmadığını döndürür. |
void | invocationEnded (long elapsedTime) |
void | invocationFailed (Throwable cause) |
void | invocationStarted (IInvocationContext context) |
void | logAssociation (String dataName, LogFile logFile) |
void | setBuildInfo (IBuildInfo buildInfo) Bu yöntem kullanımdan kaldırılmıştır. Artık test için gerekli değil. |
void | setMergeStrategy (MergeStrategy strategy) Ayarlar |
void | testAssumptionFailure (TestDescription test, String trace) |
void | testAssumptionFailure (TestDescription test, FailureDescription failure) |
void | testEnded (TestDescription test, long endTime, testMetrics) testEnded (TestDescription test, long endTime, testMetrics) |
void | testEnded (TestDescription test, testMetrics) testEnded (TestDescription test, testMetrics) |
void | testFailed (TestDescription test, FailureDescription failure) |
void | testFailed (TestDescription test, String trace) |
void | testIgnored (TestDescription test) |
void | testModuleEnded () |
void | testModuleStarted (IInvocationContext moduleContext) |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) |
void | testRunFailed (FailureDescription failure) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String name, int numTests, int attemptNumber) |
void | testRunStarted (String name, int numTests) |
void | testRunStarted (String name, int numTests, int attemptNumber, long startTime) |
void | testRunStopped (long elapsedTime) |
void | testStarted (TestDescription test, long startTime) |
void | testStarted (TestDescription test)
|
Korumalı yöntemler | |
---|---|
final void | clearModuleLogFiles () Modül dosyasının temizlenmesine izin verir, böylece onları çok uzun süre taşımaktan kaçınırız. |
final void | clearResultsForName (String testRunName) Belirli bir çalıştırma adı için sonuçların silinmesine izin verir. |
void | setIsAggregrateMetrics (boolean aggregate) 'Toplam metrikler' seçeneğini açın/kapatın |
Kamu inşaatçıları
ToplamaTestDinleyici
public CollectingTestListener ()
Genel yöntemler
getBuildInfo
public IBuildInfo getBuildInfo ()
Bu yöntem kullanımdan kaldırılmıştır.
güvenmek IBuildInfo
gelen getInvocationContext()
.
Derleme bilgilerini döndürür.
İadeler | |
---|---|
IBuildInfo |
getCurrentRunResults
public TestRunResult getCurrentRunResults ()
Geçerli test çalıştırması için sonuçları alır.
Sonuçların tam olmayabileceğini unutmayın. Değeri test önerilir TestRunResult.isRunComplete()
sonuç işleme önce, uygun şekilde ve / veya (@link TestRunResult # isRunFailure ()}.
İadeler | |
---|---|
TestRunResult | TestRunResult verilerini temsil eden son test çalışması boyunca toplanan |
getExpectedTestler
public int getExpectedTests ()
Beklenen test sayısının sayısını döndürür. Farklı Could getNumTotalTests()
bazı testler çalıştırmak olmasaydı.
İadeler | |
---|---|
int |
getInvocationContext
public IInvocationContext getInvocationContext ()
Aracılığıyla bildirildi çağırma bağlamı Return invocationStarted(com.android.tradefed.invoker.IInvocationContext)
İadeler | |
---|---|
IInvocationContext |
getMergedTestRunResults
publicgetMergedTestRunResults ()
Farklı denemelerdeki tüm çalıştırmalar için birleştirilmiş sonuç koleksiyonunu döndürün.
Birden fazla sonuç varsa, her test çalıştırması birleştirilir ve en son test sonucu önceki çalıştırmaların test sonuçlarının üzerine yazılır. Test çalıştırmaları deneme numarasına göre sıralanır.
Aynı girişimi ilişkin ölçümler tarafından tercih kümesi temelinde birleştirilecektir aggregate-metrics
. Nihai metrikler, son denemenin metrikleri olacaktır.
İadeler | |
---|---|
getModuleContextForRunResult
public IInvocationContext getModuleContextForRunResult (String testRunName)
İade IInvocationContext
sonuçları ile ilişkili modülün.
parametreler | |
---|---|
testRunName | String : {tarafından verilen isim testRunStarted(String, int) . |
İadeler | |
---|---|
IInvocationContext | IInvocationContext Verilen test çalıştırması adı için modülün null bu isimde hiçbir sonuç olup olmadığını. |
getModuleLogFiles
public MultiMap<String, LogFile> getModuleLogFiles ()
Modülle ilişkili tüm kayıtlı dosyayı içeren haritanın bir kopyasını döndürür
İadeler | |
---|---|
MultiMap<String, LogFile> |
getNonAssociatedLogFiles
public MultiMap<String, LogFile> getNonAssociatedLogFiles ()
Bir test çalıştırması veya modül ile ilişkili olmayan tüm günlüğe kaydedilmiş dosyaları içeren haritanın bir kopyasını döndürür.
İadeler | |
---|---|
MultiMap<String, LogFile> |
getNumAllFailedTestRuns
public int getNumAllFailedTestRuns ()
Başarısızlık durumundaki toplam test çalıştırması sayısını döndürür
İadeler | |
---|---|
int |
getNumAllFailedTestleri
public int getNumAllFailedTests ()
Başarısızlık durumundaki toplam sınama sayısını döndürür (yalnızca başarısız, varsayım başarısızlıkları buna dahil edilmez).
İadeler | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
Bu çalıştırma için verilen durumdaki test sayısını döndürür.
parametreler | |
---|---|
status | TestResult.TestStatus |
İadeler | |
---|---|
int |
getNumTotalTests
public int getNumTotalTests ()
Tüm çalıştırmalar için tamamlanmış testlerin toplam sayısını verir.
İadeler | |
---|---|
int |
getPrimaryBuildInfo
public IBuildInfo getPrimaryBuildInfo ()
Yoluyla bildirildi birincil yapı bilgi verir invocationStarted(com.android.tradefed.invoker.IInvocationContext)
. Birincil yapı, çalışan yapılandırmanın ilk yapı sağlayıcısı tarafından döndürülen yapıdır. Bağlam yoksa null döndürür (test için derleme yok).
İadeler | |
---|---|
IBuildInfo |
getRunResults
publicgetRunResults ()
Bu yöntem kullanımdan kaldırılmıştır.
Kullanın getMergedTestRunResults()
Tüm test çalıştırmalarının sonuçlarını döndürür.
İadeler | |
---|---|
getTestRunAttempt
public TestRunResult getTestRunAtAttempt (String testRunName, int attempt)
Dönüş TestRunResult
tek girişimi.
parametreler | |
---|---|
testRunName | String : {tarafından verilen isim testRunStarted(String, int) . |
attempt | int : girişimi id. |
İadeler | |
---|---|
TestRunResult | TestRunResult verilen isim ve girişimi kimliği veya için null o yoksa. |
getTestRunAttemptCount
public int getTestRunAttemptCount (String testRunName)
Belirli bir test çalıştırması adı için deneme sayısını döndürür.
parametreler | |
---|---|
testRunName | String : {tarafından verilen isim testRunStarted(String, int) . |
İadeler | |
---|---|
int |
getTestRunAttempts
publicgetTestRunAttempts (String testRunName)
Bir yönelik bütün girişimlere alır TestRunResult
verilen test çalışmasının.
parametreler | |
---|---|
testRunName | String : {tarafından verilen isim testRunStarted(String, int) . |
İadeler | |
---|---|
Tüm TestRunResult verilen bir test çalıştırması için, girişimleri tarafından emretti. |
getTestRunForDenemeler
publicgetTestRunForAttempts (int attempt)
Belirli bir deneme için tüm sonuçları alır.
parametreler | |
---|---|
attempt | int : biz sonucu denemesi. |
İadeler | |
---|---|
Tüm TestRunResult verilen bir girişimi için. |
getTestRunNames
publicgetTestRunNames ()
Tüm test çalıştırmaları için tüm adları döndürün.
Bu test çalıştırmaları, farklı denemelerle birden çok kez çalıştırılmış olabilir.
İadeler | |
---|---|
HasFailedTestler
public boolean hasFailedTests ()
Çağrının herhangi bir başarısız veya varsayım testi başarısız olup olmadığını döndürür.
İadeler | |
---|---|
boolean |
hasTestRunResultsForName
public boolean hasTestRunResultsForName (String testRunName)
Belirli bir test çalıştırması adının herhangi bir sonucu olup olmadığını döndürür.
parametreler | |
---|---|
testRunName | String : {tarafından verilen isim testRunStarted(String, int) . |
İadeler | |
---|---|
boolean |
çağrı Bitirildi
public void invocationEnded (long elapsedTime)
parametreler | |
---|---|
elapsedTime | long |
çağırmaBaşarısız
public void invocationFailed (Throwable cause)
parametreler | |
---|---|
cause | Throwable |
çağrıBaşlatıldı
public void invocationStarted (IInvocationContext context)
parametreler | |
---|---|
context | IInvocationContext |
logAssociation
public void logAssociation (String dataName, LogFile logFile)
parametreler | |
---|---|
dataName | String |
logFile | LogFile |
setBuildInfo
public void setBuildInfo (IBuildInfo buildInfo)
Bu yöntem kullanımdan kaldırılmıştır.
Artık test için gerekli değil.
Yapı bilgisini ayarlayın. Sadece test için kullanılmalıdır.
parametreler | |
---|---|
buildInfo | IBuildInfo |
setMergeStrateji
public void setMergeStrategy (MergeStrategy strategy)
Ayarlar MergeStrategy
sonuçlarını birleştirirken kullanmak.
parametreler | |
---|---|
strategy | MergeStrategy |
testVarsayımBaşarısızlık
public void testAssumptionFailure (TestDescription test, String trace)
parametreler | |
---|---|
test | TestDescription |
trace | String |
testVarsayımBaşarısızlık
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
parametreler | |
---|---|
test | TestDescription |
failure | FailureDescription |
testBitti
public void testEnded (TestDescription test, long endTime,testMetrics)
parametreler | |
---|---|
test | TestDescription |
endTime | long |
testMetrics |
testBitti
public void testEnded (TestDescription test,testMetrics)
parametreler | |
---|---|
test | TestDescription |
testMetrics |
test başarısız
public void testFailed (TestDescription test, FailureDescription failure)
parametreler | |
---|---|
test | TestDescription |
failure | FailureDescription |
test başarısız
public void testFailed (TestDescription test, String trace)
parametreler | |
---|---|
test | TestDescription |
trace | String |
testYoksayıldı
public void testIgnored (TestDescription test)
parametreler | |
---|---|
test | TestDescription |
testModuleBitti
public void testModuleEnded ()
testModuleBaşladı
public void testModuleStarted (IInvocationContext moduleContext)
parametreler | |
---|---|
moduleContext | IInvocationContext |
testRunBitti
public void testRunEnded (long elapsedTime,runMetrics)
parametreler | |
---|---|
elapsedTime | long |
runMetrics |
testRunFailed
public void testRunFailed (FailureDescription failure)
parametreler | |
---|---|
failure | FailureDescription |
testRunFailed
public void testRunFailed (String errorMessage)
parametreler | |
---|---|
errorMessage | String |
testÇalıştırıldı
public void testRunStarted (String name, int numTests, int attemptNumber)
parametreler | |
---|---|
name | String |
numTests | int |
attemptNumber | int |
testÇalıştırıldı
public void testRunStarted (String name, int numTests)
parametreler | |
---|---|
name | String |
numTests | int |
testÇalıştırıldı
public void testRunStarted (String name, int numTests, int attemptNumber, long startTime)
parametreler | |
---|---|
name | String |
numTests | int |
attemptNumber | int |
startTime | long |
testRunStopped
public void testRunStopped (long elapsedTime)
parametreler | |
---|---|
elapsedTime | long |
testBaşladı
public void testStarted (TestDescription test, long startTime)
parametreler | |
---|---|
test | TestDescription |
startTime | long |
testBaşladı
public void testStarted (TestDescription test)
parametreler | |
---|---|
test | TestDescription |
Korumalı yöntemler
clearModuleLogFiles
protected final void clearModuleLogFiles ()
Modül dosyasının temizlenmesine izin verir, böylece onları çok uzun süre taşımaktan kaçınırız.
clearResultsForName
protected final void clearResultsForName (String testRunName)
Belirli bir çalıştırma adı için sonuçların silinmesine izin verir. Yalnızca sonuçların toplayıcısı gibi bazı durumlarda kullanılmalıdır.
parametreler | |
---|---|
testRunName | String |
setIsAggregrateMetrics
protected void setIsAggregrateMetrics (boolean aggregate)
'Toplam metrikler' seçeneğini açın/kapatın
parametreler | |
---|---|
aggregate | boolean |