TestRunResult
public class TestRunResult
extends Object
java.lang.Oggetto | |
↳ | com.android.tradefed.result.TestRunResult |
Conserva i risultati di una singola esecuzione del test.
Mantiene un conteggio accurato dei test e tiene traccia dei test incompleti.
Non thread-safe! I callback test* devono essere richiamati in ordine
Riepilogo
Campi | |
---|---|
public static final String | ERROR_DIVIDER
|
Costruttori pubblici | |
---|---|
TestRunResult () Crea un |
Metodi pubblici | |
---|---|
getCompletedTests () Ottiene il set di test completati. | |
long | getElapsedTime () Restituisce il tempo trascorso dell'esecuzione corrente. |
int | getExpectedTestCount () Ottiene il numero di casi di test previsti da questo TestRunResult. |
getFailedTests () Ottiene il set di test non riusciti. | |
String | getName () |
int | getNumAllFailedTests () Restituisce il numero totale di test in uno stato di errore (fallito, presupposto fallito) |
int | getNumCompleteTests () Ottiene il numero di test completi in questa esecuzione, ad esempio con stato != incompleto. |
int | getNumTests () Ottiene il numero di test in questa esecuzione. |
int | getNumTestsInState (TestResult.TestStatus status) Ottiene il numero di test in un determinato stato per questa esecuzione. |
getPassedTests () Ottiene il set di test superati. | |
FailureDescription | getRunFailureDescription () Restituisce il descrittore dell'errore di esecuzione, |
String | getRunFailureMessage () Restituisce il messaggio di errore di esecuzione non riuscita, |
MultiMap <String, LogFile > | getRunLoggedFiles () Restituisce una copia della mappa contenente tutti i file registrati associati a quel test case. |
getRunMetrics () | |
getRunProtoMetrics () | |
long | getStartTime () Restituisce l'ora di inizio della prima chiamata testRunStart. |
getTestResults () Restituisce una mappa dei risultati del test. | |
getTestsInState ( statuses) getTestsInState ( statuses) Ottiene il set di test negli stati specificati. | |
getTestsResultsInState (TestResult.TestStatus status) Restituisce tutto il | |
String | getTextSummary () Restituisce una stringa intuitiva che descrive i risultati. |
boolean | hasFailedTests () |
boolean | isRunComplete () |
boolean | isRunFailure () |
static TestRunResult | merge ( testRunResults) merge ( testRunResults) |
static TestRunResult | merge ( testRunResults, MergeStrategy strategy) merge ( testRunResults, MergeStrategy strategy) Unisci più TestRunResults dello stesso testRunName. |
void | resetRunFailure () Reimpostare lo stato di errore dell'esecuzione. |
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) Le informazioni su un file registrato vengono archiviate e associate al test case o all'esecuzione del test in corso. |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) Nuova interfaccia utilizzando le nuove metriche proto. |
void | testRunFailed ( FailureDescription failureDescription) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String runName, int testCount, long startTime) Notifica che è iniziata un'esecuzione di test. |
void | testRunStarted (String runName, int testCount) Notifica che è iniziata un'esecuzione di test. |
void | testRunStopped (long elapsedTime) |
void | testStarted ( TestDescription test, long startTime) |
void | testStarted ( TestDescription test) |
Campi
ERRORE_DIVISORE
public static final String ERROR_DIVIDER
Costruttori pubblici
Metodi pubblici
getCompletedTests
publicgetCompletedTests ()
Ottiene il set di test completati.
ritorna | |
---|---|
getElapsedTime
public long getElapsedTime ()
Restituisce il tempo trascorso dell'esecuzione corrente.
ritorna | |
---|---|
long |
getExpectedTestCount
public int getExpectedTestCount ()
Ottiene il numero di casi di test previsti da questo TestRunResult. Il numero effettivo potrebbe essere inferiore al numero previsto a causa di arresti anomali del test. Normalmente, una tale mancata corrispondenza indica un errore di esecuzione del test.
ritorna | |
---|---|
int |
getFailedTests
publicgetFailedTests ()
Ottiene il set di test non riusciti.
ritorna | |
---|---|
getNome
public String getName ()
ritorna | |
---|---|
String | il nome dell'esecuzione del test |
getNumAllFailedTests
public int getNumAllFailedTests ()
Restituisce il numero totale di test in uno stato di errore (fallito, presupposto fallito)
ritorna | |
---|---|
int |
getNumCompleteTests
public int getNumCompleteTests ()
Ottiene il numero di test completi in questa esecuzione, ad esempio con stato != incompleto.
ritorna | |
---|---|
int |
getNumTest
public int getNumTests ()
Ottiene il numero di test in questa esecuzione.
ritorna | |
---|---|
int |
getNumTestsInState
public int getNumTestsInState (TestResult.TestStatus status)
Ottiene il numero di test in un determinato stato per questa esecuzione.
Parametri | |
---|---|
status | TestResult.TestStatus |
ritorna | |
---|---|
int |
getPassedTests
publicgetPassedTests ()
Ottiene il set di test superati.
ritorna | |
---|---|
getRunFailureDescription
public FailureDescription getRunFailureDescription ()
Restituisce il descrittore dell'errore di esecuzione, null
se l'esecuzione non ha avuto esito negativo.
ritorna | |
---|---|
FailureDescription |
getRunFailureMessage
public String getRunFailureMessage ()
Restituisce il messaggio di errore di esecuzione non riuscita, null
se l'esecuzione non ha avuto esito negativo.
ritorna | |
---|---|
String |
getRunLoggedFiles
public MultiMap<String, LogFile> getRunLoggedFiles ()
Restituisce una copia della mappa contenente tutti i file registrati associati a quel test case.
ritorna | |
---|---|
MultiMap <String, LogFile > |
getRunProtoMetrics
publicgetRunProtoMetrics ()
ritorna | |
---|---|
un ERROR(/Map) delle metriche di esecuzione del test con il nuovo formato proto. |
getStartTime
public long getStartTime ()
Restituisce l'ora di inizio della prima chiamata testRunStart.
ritorna | |
---|---|
long |
getTestResults
publicgetTestResults ()
Restituisce una mappa dei risultati del test.
ritorna | |
---|---|
getTestInState
publicgetTestsInState ( statuses)
Ottiene il set di test negli stati specificati.
Parametri | |
---|---|
statuses |
ritorna | |
---|---|
getTestsResultsInState
publicgetTestsResultsInState (TestResult.TestStatus status)
Restituisce tutto il TestResult
in uno stato particolare.
Parametri | |
---|---|
status | TestResult.TestStatus |
ritorna | |
---|---|
getTextSummary
public String getTextSummary ()
Restituisce una stringa intuitiva che descrive i risultati.
ritorna | |
---|---|
String |
hasFailedTests
public boolean hasFailedTests ()
ritorna | |
---|---|
boolean | true se l'esecuzione del test presenta test non riusciti o di errore. |
isRunComplete
public boolean isRunComplete ()
ritorna | |
---|---|
boolean | true se l'esecuzione del test è terminata. |
isRunFailure
public boolean isRunFailure ()
ritorna | |
---|---|
boolean | true se l'esecuzione del test ha esito negativo. |
unire
public static TestRunResult merge (testRunResults)
Parametri | |
---|---|
testRunResults |
ritorna | |
---|---|
TestRunResult |
Guarda anche:
unire
public static TestRunResult merge (testRunResults, MergeStrategy strategy)
Unisci più TestRunResults dello stesso testRunName. Se un testcase viene visualizzato in più TestRunResults ma ha risultati diversi (ad es. "boottest-device" viene eseguito tre volte con risultato FAIL-FAIL-PASS), concateniamo tutte le tracce dello stack dalle esecuzioni FAILED e ci fidiamo del risultato finale dell'esecuzione per lo stato, metriche, file di registro, ora di inizio/fine.
Parametri | |
---|---|
testRunResults | |
strategy | MergeStrategy : la strategia di fusione adottata per unire i risultati. |
ritorna | |
---|---|
TestRunResult | il TestRunResult finale contenente i dati uniti da testRunResults. |
resetRunFailure
public void resetRunFailure ()
Reimpostare lo stato di errore dell'esecuzione.
A volte è necessario reimpostare lo stato di errore di esecuzione quando si riprova. Questo dovrebbe essere fatto con cura per evitare di cancellare un vero fallimento.
setAggregateMetrics
public void setAggregateMetrics (boolean metricAggregation)
Parametri | |
---|---|
metricAggregation | boolean |
setRunComplete
public void setRunComplete (boolean runComplete)
Parametri | |
---|---|
runComplete | boolean |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, String trace)
Parametri | |
---|---|
test | TestDescription |
trace | String |
testAssumptionFailure
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
Parametri | |
---|---|
test | TestDescription |
failure | FailureDescription |
testTerminato
public void testEnded (TestDescription test, long endTime,testMetrics)
Parametri | |
---|---|
test | TestDescription |
endTime | long |
testMetrics |
testTerminato
public void testEnded (TestDescription test,testMetrics)
Parametri | |
---|---|
test | TestDescription |
testMetrics |
testFailed
public void testFailed (TestDescription test, FailureDescription failure)
Parametri | |
---|---|
test | TestDescription |
failure | FailureDescription |
testFailed
public void testFailed (TestDescription test, String trace)
Parametri | |
---|---|
test | TestDescription |
trace | String |
testLogSalvato
public void testLogSaved (String dataName, LogFile logFile)
Le informazioni su un file registrato vengono archiviate e associate al test case o all'esecuzione del test in corso.
Parametri | |
---|---|
dataName | String : il nome che fa riferimento ai dati. |
logFile | LogFile : l'oggetto LogFile che rappresenta dove è stato salvato l'oggetto e le informazioni su di esso. |
testRunEnded
public void testRunEnded (long elapsedTime,runMetrics)
Nuova interfaccia utilizzando le nuove metriche proto.
Parametri | |
---|---|
elapsedTime | long |
runMetrics |
testRunFailed
public void testRunFailed (FailureDescription failureDescription)
Parametri | |
---|---|
failureDescription | FailureDescription |
testRunFailed
public void testRunFailed (String errorMessage)
Parametri | |
---|---|
errorMessage | String |
testRunStarted
public void testRunStarted (String runName, int testCount, long startTime)
Notifica che è iniziata un'esecuzione di test.
Parametri | |
---|---|
runName | String : il nome associato all'esecuzione del test a scopo di monitoraggio. |
testCount | int : il numero di casi di test previsti associati all'esecuzione del test. |
startTime | long |
testRunStarted
public void testRunStarted (String runName, int testCount)
Notifica che è iniziata un'esecuzione di test.
Parametri | |
---|---|
runName | String : il nome associato all'esecuzione del test a scopo di monitoraggio. |
testCount | int : il numero di casi di test previsti associati all'esecuzione del test. |
testRunStopped
public void testRunStopped (long elapsedTime)
Parametri | |
---|---|
elapsedTime | long |
testAvviato
public void testStarted (TestDescription test, long startTime)
Parametri | |
---|---|
test | TestDescription |
startTime | long |