TestInvocation

public class TestInvocation
extends Object implements ITestInvocation

java.lang.Object
   ↳ com.android.tradefed.invoker.TestInvocation


Implementazione predefinita di ITestInvocation.

Carica gli oggetti principali in base a IConfiguration - recupera la build - prepara la destinazione - esegue i test - segnala i risultati

Riepilogo

Costanti

long AVAILABILITY_CHECK_TIMEOUT

String COMMAND_ARGS_KEY

Chiave degli attributi degli argomenti della riga di comando

String INVOCATION_EXTERNAL_DEPENDENCIES

String TRADEFED_CONFIG_NAME

String TRADEFED_END_HOST_LOG

String TRADEFED_INVOC_COMPLETE_HOST_LOG

String TRADEFED_LOG_NAME

Costruttori pubblici

TestInvocation()

Metodi pubblici

static IBuildInfo backFillBuildInfoForReporting(String commandLine)

Helper che utilizza la riga di comando per eseguire il backfill di un IBuildInfo per la generazione di report in caso di errore di download.

static FailureDescription createFailureFromException(Throwable exception, TestRecordProto.FailureStatus defaultStatus)

Crea un FailureDescription da un'eccezione di chiamata.

IInvocationExecution createInvocationExec(TestInvocation.RunMode mode)

Crea il percorso di invocazione da seguire.

static String getDeviceLogName(TestInvocation.Stage stage)
static String getEmulatorLogName(TestInvocation.Stage stage)
ITestInvocation.ExitInformation getExitInfo()

Le informazioni sull'uscita dell'invocazione specificata.

void invoke(IInvocationContext context, IConfiguration config, IRescheduler rescheduler, ITestInvocationListener... extraListeners)

Esegui la chiamata di test.

static boolean isSubprocess(IConfiguration config)

Restituisce true se la chiamata si trova attualmente nell'ambito di un sottoprocesso.

void notifyInvocationForceStopped(String message, ErrorIdentifier errorId)

Notifica a TestInvocation che è stato richiesto l'arresto di TradeFed.

void notifyInvocationStopped(String message)

Notifica a TestInvocation che TradeFed verrà chiuso.

static void printStageDelimiter(TestInvocation.Stage phase, boolean end)

Stampa un delimitatore per una determinata fase dell'invocazione.

void registerExecutionFiles(ExecutionFiles executionFiles)
void setClearcutClient(ClearcutClient client)

Inoltra il client clearcut per generare report sulle metriche.

static boolean shouldSkipBugreportError(Throwable t)

Metodo helper che identifica gli errori quando il report bug deve essere ignorato

String toString()

Metodi protetti

void addInvocationMetric(InvocationMetricLogger.InvocationMetricKey key, String value)
void addInvocationMetric(InvocationMetricLogger.InvocationMetricKey key, long value)
void applyAutomatedReporters(IConfiguration config)
void setExitCode(CommandRunner.ExitCode code, Throwable stack)

Helper per impostare il codice di uscita.

Costanti

AVAILABILITY_CHECK_TIMEOUT

public static final long AVAILABILITY_CHECK_TIMEOUT

Valore costante: 180000 (0x000000000002bf20)

COMMAND_ARGS_KEY

public static final String COMMAND_ARGS_KEY

Chiave degli attributi degli argomenti della riga di comando

Valore costante: "command_line_args"

INVOCATION_EXTERNAL_DEPENDENCIES

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

Constant Value: "invocation-external-dependencies"

TRADEFED_CONFIG_NAME

public static final String TRADEFED_CONFIG_NAME

Valore costante: "tradefed-expanded-config"

TRADEFED_END_HOST_LOG

public static final String TRADEFED_END_HOST_LOG

Constant Value: "end_host_log"

TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

Valore costante: "invoc_complete_host_log"

TRADEFED_LOG_NAME

public static final String TRADEFED_LOG_NAME

Constant Value: "host_log"

Costruttori pubblici

TestInvocation

public TestInvocation ()

Metodi pubblici

backFillBuildInfoForReporting

public static IBuildInfo backFillBuildInfoForReporting (String commandLine)

Helper che utilizza la riga di comando per eseguire il backfill di un IBuildInfo per la generazione di report in caso di errore di download.

Parametri
commandLine String

Ritorni
IBuildInfo

createFailureFromException

public static FailureDescription createFailureFromException (Throwable exception, 
                TestRecordProto.FailureStatus defaultStatus)

Crea un FailureDescription da un'eccezione di chiamata.

Parametri
exception Throwable: l'eccezione da convertire

defaultStatus TestRecordProto.FailureStatus: lo stato da utilizzare per impostazione predefinita se l'eccezione non è un IHarnessException.

Ritorni
FailureDescription

createInvocationExec

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

Crea il percorso di invocazione da seguire.

Parametri
mode TestInvocation.RunMode: la modalità in cui è attualmente in esecuzione.

Ritorni
IInvocationExecution Il IInvocationExecution che descrive l'invocazione.

getDeviceLogName

public static String getDeviceLogName (TestInvocation.Stage stage)

Parametri
stage TestInvocation.Stage

Ritorni
String

getEmulatorLogName

public static String getEmulatorLogName (TestInvocation.Stage stage)

Parametri
stage TestInvocation.Stage

Ritorni
String

getExitInfo

public ITestInvocation.ExitInformation getExitInfo ()

Le informazioni sull'uscita dell'invocazione specificata.

Ritorni
ITestInvocation.ExitInformation

richiamare

public void invoke (IInvocationContext context, 
                IConfiguration config, 
                IRescheduler rescheduler, 
                ITestInvocationListener... extraListeners)

Esegui la chiamata di test.

Parametri
context IInvocationContext: il IInvocationContext per eseguire i test.

config IConfiguration: il IConfiguration di questa esecuzione di test.

rescheduler IRescheduler: il IRescheduler, per riprogrammare parti dell'invocazione per l'esecuzione su altre risorse

extraListeners ITestInvocationListener: ITestInvocationListener da notificare, oltre a quelli in config

Lanci
DeviceNotAvailableException

isSubprocess

public static boolean isSubprocess (IConfiguration config)

Restituisce true se la chiamata si trova attualmente nell'ambito di un sottoprocesso.

Parametri
config IConfiguration

Ritorni
boolean

notifyInvocationForceStopped

public void notifyInvocationForceStopped (String message, 
                ErrorIdentifier errorId)

Notifica a TestInvocation che è stato richiesto l'arresto di TradeFed.

Parametri
message String: Il messaggio associato all'interruzione della chiamata

errorId ErrorIdentifier: Identificatore associato all'arresto forzato

notifyInvocationStopped

public void notifyInvocationStopped (String message)

Notifica a TestInvocation che TradeFed verrà chiuso.

Parametri
message String: Il messaggio associato all'interruzione della chiamata

printStageDelimiter

public static void printStageDelimiter (TestInvocation.Stage phase, 
                boolean end)

Stampa un delimitatore per una determinata fase dell'invocazione.

Parametri
phase TestInvocation.Stage

end boolean

registerExecutionFiles

public void registerExecutionFiles (ExecutionFiles executionFiles)

Parametri
executionFiles ExecutionFiles

setClearcutClient

public void setClearcutClient (ClearcutClient client)

Inoltra il client clearcut per generare report sulle metriche.

Parametri
client ClearcutClient

shouldSkipBugreportError

public static boolean shouldSkipBugreportError (Throwable t)

Metodo helper che identifica gli errori quando il report bug deve essere ignorato

Parametri
t Throwable

Ritorni
boolean

toString

public String toString ()

Ritorni
String

Metodi protetti

addInvocationMetric

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                String value)

Parametri
key InvocationMetricLogger.InvocationMetricKey

value String

addInvocationMetric

protected void addInvocationMetric (InvocationMetricLogger.InvocationMetricKey key, 
                long value)

Parametri
key InvocationMetricLogger.InvocationMetricKey

value long

applyAutomatedReporters

protected void applyAutomatedReporters (IConfiguration config)

Parametri
config IConfiguration

setExitCode

protected void setExitCode (CommandRunner.ExitCode code, 
                Throwable stack)

Helper per impostare il codice di uscita. Esposto per i test.

Parametri
code CommandRunner.ExitCode

stack Throwable