TestInvocation

public class TestInvocation
extends Object implements ITestInvocation

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


Standardimplementierung von ITestInvocation .

Lädt wichtige Objekte basierend auf IConfiguration – ruft Build ab – bereitet Ziel vor – führt Tests aus – meldet Ergebnisse

Zusammenfassung

Konstanten

long AVAILABILITY_CHECK_TIMEOUT

Felder

public static final String COMMAND_ARGS_KEY

Schlüssel der Befehlszeilenargumentattribute

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

public static final String TRADEFED_CONFIG_NAME

public static final String TRADEFED_END_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_LOG_NAME

Öffentliche Bauträger

TestInvocation ()

Öffentliche Methoden

static IBuildInfo backFillBuildInfoForReporting (String commandLine)

Hilfsprogramm, das die Befehlszeile verwendet, um ein IBuildInfo für die Berichterstellung im Falle eines Downloadfehlers aufzufüllen.

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

Erstellen Sie eine FailureDescription aus einer Aufrufausnahme.

IInvocationExecution createInvocationExec ( TestInvocation.RunMode mode)

Erstellen Sie den Aufrufpfad, dem gefolgt werden soll.

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

Die Exit-Informationen des angegebenen Aufrufs.

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

Führen Sie den Testaufruf durch.

static boolean isSubprocess ( IConfiguration config)

Gibt „true“ zurück, wenn sich der Aufruf derzeit innerhalb eines Unterprozessbereichs befindet.

void notifyInvocationForceStopped (String message, ErrorIdentifier errorId)

Benachrichtigen Sie den TestInvocation darüber, dass TradeFed zum Stoppen aufgefordert wurde.

void notifyInvocationStopped (String message)

Benachrichtigen Sie den TestInvocation darüber, dass TradeFed irgendwann heruntergefahren wird.

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

Gibt ein Trennzeichen für eine bestimmte Phase des Aufrufs aus.

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

Leiten Sie den Clearcut-Client an Berichtsmetriken weiter.

static boolean shouldSkipBugreportError (Throwable t)

Hilfsmethode, die Fehler identifiziert, wenn der Fehlerbericht übersprungen werden sollte

String toString ()

Geschützte Methoden

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)

Helfer zum Festlegen des Exit-Codes.

Konstanten

AVAILABILITY_CHECK_TIMEOUT

public static final long AVAILABILITY_CHECK_TIMEOUT

Konstanter Wert: 180000 (0x000000000002bf20)

Felder

COMMAND_ARGS_KEY

public static final String COMMAND_ARGS_KEY

Schlüssel der Befehlszeilenargumentattribute

INVOCATION_EXTERNAL_DEPENDENCIES

public static final String INVOCATION_EXTERNAL_DEPENDENCIES

TRADEFED_CONFIG_NAME

public static final String TRADEFED_CONFIG_NAME

TRADEFED_END_HOST_LOG

public static final String TRADEFED_END_HOST_LOG

TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

TRADEFED_LOG_NAME

public static final String TRADEFED_LOG_NAME

Öffentliche Bauträger

TestInvocation

public TestInvocation ()

Öffentliche Methoden

backFillBuildInfoForReporting

public static IBuildInfo backFillBuildInfoForReporting (String commandLine)

Hilfsprogramm, das die Befehlszeile verwendet, um ein IBuildInfo für die Berichterstellung im Falle eines Downloadfehlers aufzufüllen.

Parameter
commandLine String

Kehrt zurück
IBuildInfo

createFailureFromException

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

Erstellen Sie eine FailureDescription aus einer Aufrufausnahme.

Parameter
exception Throwable : Die zu konvertierende Ausnahme

defaultStatus TestRecordProto.FailureStatus : Der standardmäßig zu verwendende Status, wenn die Ausnahme keine IHarnessException ist.

Kehrt zurück
FailureDescription

createInvocationExec

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

Erstellen Sie den Aufrufpfad, dem gefolgt werden soll.

Parameter
mode TestInvocation.RunMode : Der Modus, in dem wir derzeit ausgeführt werden.

Kehrt zurück
IInvocationExecution Die IInvocationExecution , die den Aufruf beschreibt.

getDeviceLogName

public static String getDeviceLogName (TestInvocation.Stage stage)

Parameter
stage TestInvocation.Stage

Kehrt zurück
String

getEmulatorLogName

public static String getEmulatorLogName (TestInvocation.Stage stage)

Parameter
stage TestInvocation.Stage

Kehrt zurück
String

getExitInfo

public ITestInvocation.ExitInformation getExitInfo ()

Die Exit-Informationen des angegebenen Aufrufs.

Kehrt zurück
ITestInvocation.ExitInformation

aufrufen

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

Führen Sie den Testaufruf durch.

Parameter
context IInvocationContext : der IInvocationContext zum Durchführen von Tests.

config IConfiguration : die IConfiguration dieses Testlaufs.

rescheduler IRescheduler : Der IRescheduler zum Neuplanen von Teilen des Aufrufs zur Ausführung auf einer oder mehreren anderen Ressourcen.

extraListeners ITestInvocationListener : Zu benachrichtigende ITestInvocationListener -s, zusätzlich zu denen in config

Würfe
DeviceNotAvailableException

isSubprocess

public static boolean isSubprocess (IConfiguration config)

Gibt „true“ zurück, wenn sich der Aufruf derzeit innerhalb eines Unterprozessbereichs befindet.

Parameter
config IConfiguration

Kehrt zurück
boolean

notifyInvocationForceStopped

public void notifyInvocationForceStopped (String message, 
                ErrorIdentifier errorId)

Benachrichtigen Sie den TestInvocation darüber, dass TradeFed zum Stoppen aufgefordert wurde.

Parameter
message String : Die Nachricht, die dem Stoppen des Aufrufs zugeordnet ist

errorId ErrorIdentifier : Identifikator, der dem erzwungenen Stopp zugeordnet ist

notifyInvocationStopped

public void notifyInvocationStopped (String message)

Benachrichtigen Sie den TestInvocation darüber, dass TradeFed irgendwann heruntergefahren wird.

Parameter
message String : Die Nachricht, die dem Stoppen des Aufrufs zugeordnet ist

printStageDelimiter

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

Gibt ein Trennzeichen für eine bestimmte Phase des Aufrufs aus.

Parameter
phase TestInvocation.Stage

end boolean

registerExecutionFiles

public void registerExecutionFiles (ExecutionFiles executionFiles)

Parameter
executionFiles ExecutionFiles

setClearcutClient

public void setClearcutClient (ClearcutClient client)

Leiten Sie den Clearcut-Client an Berichtsmetriken weiter.

Parameter
client ClearcutClient

ShouldSkipBugreportError

public static boolean shouldSkipBugreportError (Throwable t)

Hilfsmethode, die Fehler identifiziert, wenn der Fehlerbericht übersprungen werden sollte

Parameter
t Throwable

Kehrt zurück
boolean

toString

public String toString ()

Kehrt zurück
String

Geschützte Methoden

addInvocationMetric

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

Parameter
key InvocationMetricLogger.InvocationMetricKey

value String

addInvocationMetric

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

Parameter
key InvocationMetricLogger.InvocationMetricKey

value long

applyAutomatedReporters

protected void applyAutomatedReporters (IConfiguration config)

Parameter
config IConfiguration

setExitCode

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

Helfer zum Festlegen des Exit-Codes. Zum Testen ausgesetzt.

Parameter
code CommandRunner.ExitCode

stack Throwable