TestÇalışmasıSonucu
public class TestRunResult
extends Object
java.lang.Object | |
↳ | com.android.tradefed.result.TestRunResult |
Tek bir test çalışmasının sonuçlarını tutar.
Testlerin doğru sayısını korur ve tamamlanmamış testleri izler.
İş parçacığı güvenli değil! Test* geri aramaları sırayla çağrılmalıdır
Özet
Alanlar | |
---|---|
public static final String | ERROR_DIVIDER
|
Kamu inşaatçıları | |
---|---|
TestRunResult () Boş bir |
Genel yöntemler | |
---|---|
getCompletedTests () Tamamlanan testlerin kümesini alır. | |
long | getElapsedTime () Geçerli çalıştırmada geçen süreyi döndürür. |
int | getExpectedTestCount () Bu TestRunResult'un sahip olmayı beklediği test senaryolarının sayısını alır. |
getFailedTests () Başarısız olan testlerin kümesini alır. | |
String | getName () |
int | getNumAllFailedTests () Başarısızlık durumundaki toplam test sayısını döndür (başarısız, varsayım hatası) |
int | getNumCompleteTests () Bu çalıştırmadaki tamamlanan testlerin sayısını alır; yani != eksik durumuyla. |
int | getNumTests () Bu çalıştırmadaki testlerin sayısını alır. |
int | getNumTestsInState (TestResult.TestStatus status) Bu çalıştırma için belirli durumdaki testlerin sayısını alır. |
getPassedTests () Geçilen testlerin kümesini alır. | |
FailureDescription | getRunFailureDescription () Çalıştırma hatası tanımlayıcısını döndürür; çalıştırma başarısız olursa |
String | getRunFailureMessage () Çalıştırma hatası hata mesajını döndürün; çalıştırma başarısız olursa |
MultiMap <String, LogFile > | getRunLoggedFiles () Bu test senaryosuyla ilişkili tüm günlüğe kaydedilen dosyaları içeren haritanın bir kopyasını döndürür. |
getRunMetrics () | |
getRunProtoMetrics () | |
long | getStartTime () İlk testRunStart çağrısının başlangıç zamanını döndürür. |
getTestResults () Test sonuçlarının bir haritasını döndürür. | |
getTestsInState ( statuses) getTestsInState ( statuses) Verilen durumlardaki test kümesini alır. | |
getTestsResultsInState (TestResult.TestStatus status) Belirli bir durumdaki tüm | |
String | getTextSummary () Sonuçları açıklayan kullanıcı dostu bir dize döndürür. |
boolean | hasFailedTests () |
boolean | isRunComplete () |
boolean | isRunFailure () |
static TestRunResult | merge ( testRunResults) merge ( testRunResults) |
static TestRunResult | merge ( testRunResults, MergeStrategy strategy) merge ( testRunResults, MergeStrategy strategy) Aynı testRunName'in birden fazla TestRunResult'unu birleştirin. |
void | resetRunFailure () Çalıştırma hatası durumunu sıfırlayın. |
void | setAggregateMetrics (boolean metricAggregation) |
void | setRunComplete (boolean runComplete) |
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 | testLogSaved (String dataName, LogFile logFile) Günlüğe kaydedilen bir dosya hakkındaki bilgiler saklanır ve devam eden test senaryosu veya test çalıştırmasıyla ilişkilendirilir. |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) Yeni protokol metriklerini kullanan yeni arayüz. |
void | testRunFailed ( FailureDescription failureDescription) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String runName, int testCount, long startTime) Bir test çalıştırmasının başladığını bildirin. |
void | testRunStarted (String runName, int testCount) Bir test çalıştırmasının başladığını bildirin. |
void | testRunStopped (long elapsedTime) |
void | testStarted ( TestDescription test, long startTime) |
void | testStarted ( TestDescription test) |
Alanlar
ERROR_DIVIDER
public static final String ERROR_DIVIDER
Kamu inşaatçıları
Genel yöntemler
getCompletedTests
publicgetCompletedTests ()
Tamamlanan testlerin kümesini alır.
İadeler | |
---|---|
getElapsedTime
public long getElapsedTime ()
Geçerli çalıştırmada geçen süreyi döndürür.
İadeler | |
---|---|
long |
getExpectedTestCount
public int getExpectedTestCount ()
Bu TestRunResult'un sahip olmayı beklediği test senaryolarının sayısını alır. Gerçek sayı, test kazaları nedeniyle beklenen sayıdan daha az olabilir. Normalde böyle bir uyumsuzluk, bir test çalıştırması başarısızlığını gösterir.
İadeler | |
---|---|
int |
getFailedTestler
publicgetFailedTests ()
Başarısız olan testlerin kümesini alır.
İadeler | |
---|---|
getName
public String getName ()
İadeler | |
---|---|
String | test çalıştırması adı |
getNumAllFailedTests
public int getNumAllFailedTests ()
Başarısızlık durumundaki toplam test sayısını döndür (başarısız, varsayım hatası)
İadeler | |
---|---|
int |
getNumCompleteTests
public int getNumCompleteTests ()
Bu çalıştırmadaki tamamlanan testlerin sayısını alır; yani != eksik durumuyla.
İadeler | |
---|---|
int |
getNumTests
public int getNumTests ()
Bu çalıştırmadaki testlerin sayısını alır.
İadeler | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
Bu çalıştırma için belirli durumdaki testlerin sayısını alır.
Parametreler | |
---|---|
status | TestResult.TestStatus |
İadeler | |
---|---|
int |
getPassedTestler
publicgetPassedTests ()
Geçilen testlerin kümesini alır.
İadeler | |
---|---|
getRunFailureAçıklama
public FailureDescription getRunFailureDescription ()
Çalıştırma hatası tanımlayıcısını döndürür; çalıştırma başarısız olursa null
olur.
İadeler | |
---|---|
FailureDescription |
getRunFailureMessage
public String getRunFailureMessage ()
Çalıştırma hatası hata mesajını döndürün; çalıştırma başarısız olursa null
.
İadeler | |
---|---|
String |
getRunLoggedFiles
public MultiMap<String, LogFile> getRunLoggedFiles ()
Bu test senaryosuyla ilişkili tüm günlüğe kaydedilen dosyaları içeren haritanın bir kopyasını döndürür.
İadeler | |
---|---|
MultiMap <String, LogFile > |
getRunProtoMetrics
publicgetRunProtoMetrics ()
İadeler | |
---|---|
yeni protokol formatıyla test çalıştırması ölçümlerinin bir ERROR(/Map) . |
getStartTime
public long getStartTime ()
İlk testRunStart çağrısının başlangıç zamanını döndürür.
İadeler | |
---|---|
long |
Test Sonuçlarını Al
publicgetTestResults ()
Test sonuçlarının bir haritasını döndürür.
İadeler | |
---|---|
getTestsInState
publicgetTestsInState ( statuses)
Verilen durumlardaki test kümesini alır.
Parametreler | |
---|---|
statuses |
İadeler | |
---|---|
getTestsResultsInState
publicgetTestsResultsInState (TestResult.TestStatus status)
Belirli bir durumdaki tüm TestResult
döndürür.
Parametreler | |
---|---|
status | TestResult.TestStatus |
İadeler | |
---|---|
getTextSummary
public String getTextSummary ()
Sonuçları açıklayan kullanıcı dostu bir dize döndürür.
İadeler | |
---|---|
String |
Başarısız Testler
public boolean hasFailedTests ()
İadeler | |
---|---|
boolean | test çalıştırmasında herhangi bir başarısız veya hata testi varsa true . |
isRunComplete
public boolean isRunComplete ()
İadeler | |
---|---|
boolean | test çalıştırması bittiyse true . |
isRunFailure
public boolean isRunFailure ()
İadeler | |
---|---|
boolean | test çalıştırması başarısız olursa true . |
birleştirmek
public static TestRunResult merge (testRunResults)
Parametreler | |
---|---|
testRunResults |
İadeler | |
---|---|
TestRunResult |
Ayrıca bakınız:
birleştirmek
public static TestRunResult merge (testRunResults, MergeStrategy strategy)
Aynı testRunName'in birden fazla TestRunResult'unu birleştirin. Bir test senaryosu birden fazla TestRunResults'ta görünüyorsa ancak farklı sonuçlara sahipse (örneğin, "boottest-device" FAIL-FAIL-PASS sonucuyla üç kez çalıştırılırsa), FAILED çalıştırmalarından tüm yığın izlerini birleştirir ve durum için son çalıştırma sonucuna güveniriz, ölçümler, günlük dosyaları, başlangıç/bitiş zamanı.
Parametreler | |
---|---|
testRunResults | |
strategy | MergeStrategy : sonuçların birleştirilmesi için benimsenen birleştirme stratejisi. |
İadeler | |
---|---|
TestRunResult | testRunResults'tan birleştirilmiş verileri içeren son TestRunResult. |
ResetRunFailure
public void resetRunFailure ()
Çalıştırma hatası durumunu sıfırlayın.
Yeniden deneme sırasında bazen çalıştırma hatası durumunun sıfırlanması gerekebilir. Bu, gerçek bir arızanın giderilmesini önlemek için dikkatli bir şekilde yapılmalıdır.
setAggregateMetrics
public void setAggregateMetrics (boolean metricAggregation)
Parametreler | |
---|---|
metricAggregation | boolean |
setRunComplete
public void setRunComplete (boolean runComplete)
Parametreler | |
---|---|
runComplete | boolean |
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 |
testLogKaydedildi
public void testLogSaved (String dataName, LogFile logFile)
Günlüğe kaydedilen bir dosya hakkındaki bilgiler saklanır ve devam eden test senaryosu veya test çalıştırmasıyla ilişkilendirilir.
Parametreler | |
---|---|
dataName | String : Veriye başvuran ad. |
logFile | LogFile : Nesnenin kaydedildiği yeri ve onunla ilgili bilgileri temsil eden LogFile nesnesi. |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
Yeni protokol metriklerini kullanan yeni arayüz.
Parametreler | |
---|---|
elapsedTime | long |
runMetrics |
testRun Başarısız
public void testRunFailed (FailureDescription failureDescription)
Parametreler | |
---|---|
failureDescription | FailureDescription |
testRun Başarısız
public void testRunFailed (String errorMessage)
Parametreler | |
---|---|
errorMessage | String |
testRunBaşlatıldı
public void testRunStarted (String runName, int testCount, long startTime)
Bir test çalıştırmasının başladığını bildirin.
Parametreler | |
---|---|
runName | String : İzleme amacıyla test çalıştırmasıyla ilişkilendirilen ad. |
testCount | int : test çalıştırmasıyla ilişkili beklenen test senaryolarının sayısı. |
startTime | long |
testRunBaşlatıldı
public void testRunStarted (String runName, int testCount)
Bir test çalıştırmasının başladığını bildirin.
Parametreler | |
---|---|
runName | String : İzleme amacıyla test çalıştırmasıyla ilişkilendirilen ad. |
testCount | int : test çalıştırmasıyla ilişkili beklenen test senaryolarının sayısı. |
testRunDurduruldu
public void testRunStopped (long elapsedTime)
Parametreler | |
---|---|
elapsedTime | long |
testBaşladı
public void testStarted (TestDescription test, long startTime)
Parametreler | |
---|---|
test | TestDescription |
startTime | long |