Risultato esecuzione test
public class TestRunResult
extends Object
java.lang.Object | |
↳ | com.android.tradefed.result.TestRunResult |
Contiene i risultati di una singola esecuzione di test.
Mantiene un conteggio accurato dei test e tiene traccia dei test incompleti.
Non thread-safe! I callback test* devono essere chiamati in ordine
Riepilogo
Campi | |
---|---|
public static final String | ERROR_DIVIDER
|
Costruttori pubblici | |
---|---|
TestRunResult () Crea un |
Metodi pubblici | |
---|---|
getCompletedTests () Ottiene l'insieme dei test completati. | |
long | getElapsedTime () Restituisce il tempo trascorso dell'esecuzione corrente. |
int | getExpectedTestCount () Ottiene il numero di casi di test che questo TestRunResult prevede di avere. |
getFailedTests () Ottiene l'insieme dei test non riusciti. | |
String | getName () |
int | getNumAllFailedTests () Restituisce il numero totale di test in uno stato di errore (non riuscito, presupposto errore) |
int | getNumCompleteTests () Ottiene il numero di test completi in questa esecuzione, ovvero con stato != incompleto. |
int | getNumTests () Ottiene il numero di test in questa esecuzione. |
int | getNumTestsInState (TestResult.TestStatus status) Ottiene il numero di test nello stato specificato per questa esecuzione. |
getPassedTests () Ottiene l'insieme dei 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 tutto il file registrato associato 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 l'insieme 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 esecuzione non riuscita. |
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 che utilizza le nuove metriche prototipali. |
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_DIVIDER
public static final String ERROR_DIVIDER
Costruttori pubblici
Metodi pubblici
getCompletedTests
publicgetCompletedTests ()
Ottiene l'insieme dei 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 che questo TestRunResult prevede di avere. Il numero effettivo potrebbe essere inferiore a quello 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 l'insieme dei 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 (non riuscito, presupposto errore)
ritorna | |
---|---|
int |
getNumCompleteTest
public int getNumCompleteTests ()
Ottiene il numero di test completi in questa esecuzione, ovvero con stato != incompleto.
ritorna | |
---|---|
int |
getNumTest
public int getNumTests ()
Ottiene il numero di test in questa esecuzione.
ritorna | |
---|---|
int |
getNumTestInState
public int getNumTestsInState (TestResult.TestStatus status)
Ottiene il numero di test nello stato specificato per questa esecuzione.
Parametri | |
---|---|
status | TestResult.TestStatus |
ritorna | |
---|---|
int |
getPassedTest
publicgetPassedTests ()
Ottiene l'insieme dei test superati.
ritorna | |
---|---|
getRunFailureDescrizione
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 tutto il file registrato associato a quel test case.
ritorna | |
---|---|
MultiMap <String, LogFile > |
getRunProtoMetrics
publicgetRunProtoMetrics ()
ritorna | |
---|---|
un ERROR(/Map) delle metriche dell'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 l'insieme 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 ha avuto test non riusciti o con errori. |
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 avuto 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 esempio "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 dell'esecuzione finale 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 esecuzione non riuscita.
A volte è necessario reimpostare lo stato di errore di esecuzione quando si riprova. Questo dovrebbe essere fatto con attenzione per evitare di risolvere un vero e proprio fallimento.
setAggregateMetrics
public void setAggregateMetrics (boolean metricAggregation)
Parametri | |
---|---|
metricAggregation | boolean |
setRunComplete
public void setRunComplete (boolean runComplete)
Parametri | |
---|---|
runComplete | boolean |
testAssunzioneFallimento
public void testAssumptionFailure (TestDescription test, String trace)
Parametri | |
---|---|
test | TestDescription |
trace | String |
testAssunzioneFallimento
public void testAssumptionFailure (TestDescription test, FailureDescription failure)
Parametri | |
---|---|
test | TestDescription |
failure | FailureDescription |
testEnded
public void testEnded (TestDescription test, long endTime,testMetrics)
Parametri | |
---|---|
test | TestDescription |
endTime | long |
testMetrics |
testEnded
public void testEnded (TestDescription test,testMetrics)
Parametri | |
---|---|
test | TestDescription |
testMetrics |
prova non riuscita
public void testFailed (TestDescription test, FailureDescription failure)
Parametri | |
---|---|
test | TestDescription |
failure | FailureDescription |
prova non riuscita
public void testFailed (TestDescription test, String trace)
Parametri | |
---|---|
test | TestDescription |
trace | String |
testLogSaved
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 che utilizza le nuove metriche prototipali.
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 tracciamento. |
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 tracciamento. |
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 |