Test Dinleyici Toplama
public class CollectingTestListener
extends Object
implements ITestInvocationListener, ILogSaverListener
java.lang.Object | |
↳ | com.android.tradefed.result.CollectingTestListener |
Tüm test sonuçlarını toplayacak bir ITestInvocationListener
.
Bu nesnede kullanılan veri yapıları iş parçacığı açısından güvenli olsa da, ITestInvocationListener
geri çağrılarının doğru sırada çağrılması gerekir.
Özet
Kamu inşaatçıları | |
---|---|
CollectingTestListener () |
Genel yöntemler | |
---|---|
IBuildInfo | getBuildInfo () Bu yöntem kullanımdan kaldırılmıştır. |
TestRunResult | getCurrentRunResults () Geçerli test çalıştırmasının sonuçlarını alır. |
int | getExpectedTests () Beklenen test sayısının sayısını döndürür. |
IInvocationContext | getInvocationContext () |
getMergedTestRunResults () Farklı denemelerdeki tüm çalıştırmalar için birleştirilmiş sonuç koleksiyonunu döndürün. | |
IInvocationContext | getModuleContextForRunResult (String testRunName) Sonuçlarla ilişkili modülün |
MultiMap<String, LogFile> | getModuleLogFiles () Modülle ilişkili tüm günlüğe kaydedilen dosyaları içeren haritanın bir kopyasını döndürür |
MultiMap<String, LogFile> | getNonAssociatedLogFiles () Bir test çalıştırması veya bir modülle ilişkili olmayan tüm günlüğe kaydedilen dosyaları içeren haritanın bir kopyasını döndürür. |
int | getNumAllFailedTestRuns () Arıza durumunda toplam test çalıştırması sayısını döndürür |
int | getNumAllFailedTests () Başarısızlık durumundaki toplam test sayısını döndürür (yalnızca başarısız oldu, varsayım hataları buna dahil edilmez). |
int | getNumTestsInState (TestResult.TestStatus status) Bu çalıştırma için belirli durumdaki testlerin sayısını döndürür. |
int | getNumTotalTests () Tüm çalıştırmalar için tamamlanan testlerin toplam sayısını döndürür. |
IBuildInfo | getPrimaryBuildInfo () |
getRunResults () Bu yöntem kullanımdan kaldırılmıştır. | |
TestRunResult | getTestRunAtAttempt (String testRunName, int attempt) Tek bir deneme için |
int | getTestRunAttemptCount (String testRunName) Belirli bir test çalıştırması adı için deneme sayısını döndürür. |
getTestRunAttempts (String testRunName) Belirli bir test çalıştırmasının | |
getTestRunForAttempts (int attempt) Belirli bir girişimin tüm sonuçlarını alır. | |
getTestRunNames () Tüm test çalıştırmalarının tüm adlarını döndürün. | |
boolean | hasFailedTests () Çağrının başarısız olduğu veya varsayımın başarısız olduğu testler 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) Sonuçları birleştirirken kullanılacak |
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 temizlenmesini sağlar, 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 temizlenmesini sağlar. |
void | setIsAggregrateMetrics (boolean aggregate) 'Metrikleri toplulaştır' seçeneğini değiştirin |
Kamu inşaatçıları
Test Dinleyici Toplama
public CollectingTestListener ()
Genel yöntemler
getBuildInfo
public IBuildInfo getBuildInfo ()
Bu yöntem kullanımdan kaldırılmıştır.
getInvocationContext()
öğesinden IBuildInfo
güvenin.
Derleme bilgilerini döndürür.
İadeler | |
---|---|
IBuildInfo |
getCurrentRunResults
public TestRunResult getCurrentRunResults ()
Geçerli test çalıştırmasının sonuçlarını alır.
Sonuçların tam olmayabileceğini unutmayın. Sonuçları işlemeden önce TestRunResult.isRunComplete()
ve/veya (@link TestRunResult#isRunFailure()} değerinin uygun şekilde test edilmesi önerilir.
İadeler | |
---|---|
TestRunResult | Son test çalıştırması sırasında toplanan verileri temsil eden TestRunResult |
getExpectedTestler
public int getExpectedTests ()
Beklenen test sayısının sayısını döndürür. Bazı testler çalışmadıysa getNumTotalTests()
işlevinden farklı olabilir.
İadeler | |
---|---|
int |
getInvokasyonContext
public IInvocationContext getInvocationContext ()
invocationStarted(com.android.tradefed.invoker.IInvocationContext)
aracılığıyla bildirilen çağırma bağlamını döndürün
İadeler | |
---|---|
IInvocationContext |
getMergedTestRunSonuçları
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ı denemeye ait metrikler, aggregate-metrics
tarafından belirlenen tercihe göre birleştirilecektir. Nihai metrikler son denemenin metrikleri olacaktır.
İadeler | |
---|---|
getModuleContextForRunResult
public IInvocationContext getModuleContextForRunResult (String testRunName)
Sonuçlarla ilişkili modülün IInvocationContext
döndürür.
Parametreler | |
---|---|
testRunName | String : { testRunStarted(String, int) tarafından verilen ad. |
İadeler | |
---|---|
IInvocationContext | Belirli bir test çalıştırması adı için modülün IInvocationContext , bu ad için sonuç yoksa null . |
getModuleLogFiles
public MultiMap<String, LogFile> getModuleLogFiles ()
Modülle ilişkili tüm günlüğe kaydedilen dosyaları 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 bir modülle ilişkili olmayan tüm günlüğe kaydedilen dosyaları içeren haritanın bir kopyasını döndürür.
İadeler | |
---|---|
MultiMap<String, LogFile> |
getNumAllFailedTestRuns
public int getNumAllFailedTestRuns ()
Arıza durumunda toplam test çalıştırması sayısını döndürür
İadeler | |
---|---|
int |
getNumAllFailedTests
public int getNumAllFailedTests ()
Başarısızlık durumundaki toplam test sayısını döndürür (yalnızca başarısız oldu, varsayım hataları buna dahil edilmez).
İadeler | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
Bu çalıştırma için belirli durumdaki testlerin sayısını döndürür.
Parametreler | |
---|---|
status | TestResult.TestStatus |
İadeler | |
---|---|
int |
getNumTotalTests
public int getNumTotalTests ()
Tüm çalıştırmalar için tamamlanan testlerin toplam sayısını döndürür.
İadeler | |
---|---|
int |
getPrimaryBuildInfo
public IBuildInfo getPrimaryBuildInfo ()
invocationStarted(com.android.tradefed.invoker.IInvocationContext)
aracılığıyla bildirilen birincil derleme bilgilerini döndürün. 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 (test senaryosuna derleme yok) null değerini döndürür.
İadeler | |
---|---|
IBuildInfo |
getRunResults
publicgetRunResults ()
Bu yöntem kullanımdan kaldırılmıştır.
getMergedTestRunResults()
işlevini kullanın
Tüm test çalıştırmalarının sonuçlarını döndürür.
İadeler | |
---|---|
getTestRunAttempt
public TestRunResult getTestRunAtAttempt (String testRunName, int attempt)
Tek bir deneme için TestRunResult
döndürün.
Parametreler | |
---|---|
testRunName | String : { testRunStarted(String, int) tarafından verilen ad. |
attempt | int : Deneme kimliği. |
İadeler | |
---|---|
TestRunResult | Verilen ad ve deneme kimliği için TestRunResult veya mevcut değilse null . |
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 : { testRunStarted(String, int) tarafından verilen ad. |
İadeler | |
---|---|
int |
getTestRunAttempts
publicgetTestRunAttempts (String testRunName)
Belirli bir test çalıştırmasının TestRunResult
yönelik tüm girişimleri alır.
Parametreler | |
---|---|
testRunName | String : { testRunStarted(String, int) tarafından verilen ad. |
İadeler | |
---|---|
Belirli bir test çalıştırması için denemelere göre sıralanmış tüm TestRunResult . |
getTestRunForAttempts
publicgetTestRunForAttempts (int attempt)
Belirli bir girişimin tüm sonuçlarını alır.
Parametreler | |
---|---|
attempt | int : Sonuçlarını istediğimiz girişim. |
İadeler | |
---|---|
Belirli bir deneme için tüm TestRunResult . |
getTestRunNames
publicgetTestRunNames ()
Tüm test çalıştırmalarının tüm adlarını döndürün.
Bu test çalıştırmaları farklı denemelerle birden çok kez çalıştırılmış olabilir.
İadeler | |
---|---|
Başarısız Testler
public boolean hasFailedTests ()
Çağrının başarısız olduğu veya varsayımın başarısız olduğu testler 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 : { testRunStarted(String, int) tarafından verilen ad. |
İadeler | |
---|---|
boolean |
çağırma sona erdi
public void invocationEnded (long elapsedTime)
Parametreler | |
---|---|
elapsedTime | long |
çağrı başarısız oldu
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ı bilgilerini ayarlayın. Sadece test amaçlı kullanılmalıdır.
Parametreler | |
---|---|
buildInfo | IBuildInfo |
setMergeStrateji
public void setMergeStrategy (MergeStrategy strategy)
Sonuçları birleştirirken kullanılacak MergeStrategy
ayarlar.
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 |
testSonlandı
public void testEnded (TestDescription test, long endTime,testMetrics)
Parametreler | |
---|---|
test | TestDescription |
endTime | long |
testMetrics |
testSonlandı
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 |
testModuleEnded
public void testModuleEnded ()
testModuleStarted
public void testModuleStarted (IInvocationContext moduleContext)
Parametreler | |
---|---|
moduleContext | IInvocationContext |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
Parametreler | |
---|---|
elapsedTime | long |
runMetrics |
testRun Başarısız
public void testRunFailed (FailureDescription failure)
Parametreler | |
---|---|
failure | FailureDescription |
testRun Başarısız
public void testRunFailed (String errorMessage)
Parametreler | |
---|---|
errorMessage | String |
testRunBaşlatıldı
public void testRunStarted (String name, int numTests, int attemptNumber)
Parametreler | |
---|---|
name | String |
numTests | int |
attemptNumber | int |
testRunBaşlatıldı
public void testRunStarted (String name, int numTests)
Parametreler | |
---|---|
name | String |
numTests | int |
testRunBaşlatıldı
public void testRunStarted (String name, int numTests, int attemptNumber, long startTime)
Parametreler | |
---|---|
name | String |
numTests | int |
attemptNumber | int |
startTime | long |
testRunDurduruldu
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 temizlenmesini sağlar, 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 temizlenmesini sağlar. Yalnızca sonuçların toplayıcısı gibi bazı durumlarda kullanılmalıdır.
Parametreler | |
---|---|
testRunName | String |
setIsAggregateMetrics
protected void setIsAggregrateMetrics (boolean aggregate)
'Metrikleri toplulaştır' seçeneğini değiştirin
Parametreler | |
---|---|
aggregate | boolean |