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 den Build ab – bereitet das Ziel vor – führt Tests aus – meldet Ergebnisse

Zusammenfassung

Konstanten

long AVAILABILITY_CHECK_TIMEOUT

String COMMAND_ARGS_KEY

Schlüssel der Attribute für Befehlszeilenargumente

String INVOCATION_EXTERNAL_DEPENDENCIES

String TRADEFED_CONFIG_NAME

String TRADEFED_END_HOST_LOG

String TRADEFED_EVENT_LOG

String TRADEFED_INVOC_COMPLETE_HOST_LOG

String TRADEFED_LOG_NAME

Öffentliche Konstruktoren

TestInvocation()

Öffentliche Methoden

static IBuildInfo backFillBuildInfoForReporting(String commandLine)

Helfer, der die Befehlszeile verwendet, um einen IBuildInfo für Berichte zu erstellen, falls der Download fehlschlägt.

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

Erstellen Sie eine FailureDescription aus einer Aufrufausnahme.

IInvocationExecution createInvocationExec(TestInvocation.RunMode mode)

Erstellen Sie den Aufrufpfad, der befolgt werden soll.

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

Die Informationen zum Beenden des angegebenen Aufrufs.

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

Führen Sie den Testaufruf aus.

static boolean isSubprocess(IConfiguration config)

Gibt „true“ zurück, wenn sich der Aufruf derzeit in einem Unterprozessbereich befindet.

void notifyInvocationForceStopped(String message, ErrorIdentifier errorId)

Benachrichtigen Sie TestInvocation, dass TradeFed angefordert wurde, den Vorgang zu beenden.

void notifyInvocationStopped(String message)

Benachrichtigen Sie TestInvocation, dass TradeFed demnächst 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 weiter, um Messwerte zu melden.

static boolean shouldSkipBugreportError(Throwable t)

Hilfsmethode, die Fehler erkennt, wenn der Fehlerbericht übersprungen werden soll

String toString()

Geschützte Methoden

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

Helfer zum Festlegen des Beendigungscodes.

Konstanten

AVAILABILITY_CHECK_TIMEOUT

public static final long AVAILABILITY_CHECK_TIMEOUT

Konstanter Wert: 180000 (0x000000000002bf20)

COMMAND_ARGS_KEY

public static final String COMMAND_ARGS_KEY

Schlüssel der Attribute für Befehlszeilenargumente

Konstanter Wert: "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

Konstanter Wert: "tradefed-expanded-config"

TRADEFED_END_HOST_LOG

public static final String TRADEFED_END_HOST_LOG

Konstanter Wert: "end_host_log"

TRADEFED_EVENT_LOG

public static final String TRADEFED_EVENT_LOG

Konstanter Wert: "event-logs"

TRADEFED_INVOC_COMPLETE_HOST_LOG

public static final String TRADEFED_INVOC_COMPLETE_HOST_LOG

Konstanter Wert: "invoc_complete_host_log"

TRADEFED_LOG_NAME

public static final String TRADEFED_LOG_NAME

Konstanter Wert: "host_log"

Öffentliche Konstruktoren

TestInvocation

public TestInvocation ()

Öffentliche Methoden

backFillBuildInfoForReporting

public static IBuildInfo backFillBuildInfoForReporting (String commandLine)

Helfer, der die Befehlszeile verwendet, um einen IBuildInfo für Berichte zu erstellen, falls der Download fehlschlägt.

Parameter
commandLine String

Gibt Folgendes 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 Status, der standardmäßig verwendet werden soll, wenn die Ausnahme keine IHarnessException ist.

Gibt Folgendes zurück:
FailureDescription

createInvocationExec

public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)

Erstellen Sie den Aufrufpfad, der befolgt werden soll.

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

Gibt Folgendes zurück:
IInvocationExecution Die IInvocationExecution, die den Aufruf beschreibt.

getDeviceLogName

public static String getDeviceLogName (TestInvocation.Stage stage)

Parameter
stage TestInvocation.Stage

Gibt Folgendes zurück:
String

getEmulatorLogName

public static String getEmulatorLogName (TestInvocation.Stage stage)

Parameter
stage TestInvocation.Stage

Gibt Folgendes zurück:
String

getExitInfo

public ITestInvocation.ExitInformation getExitInfo ()

Die Informationen zum Beenden des angegebenen Aufrufs.

Gibt Folgendes zurück:
ITestInvocation.ExitInformation

aufrufen

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

Führen Sie den Testaufruf aus.

Parameter
context IInvocationContext: Der IInvocationContext, mit dem Tests durchgeführt werden sollen.

config IConfiguration: die IConfiguration dieses Testlaufs.

rescheduler IRescheduler: die IRescheduler, um Teile des Aufrufs für die Ausführung auf einer anderen Ressource bzw. anderen Ressourcen neu zu planen

extraListeners ITestInvocationListener: ITestInvocationListeners, die zusätzlich zu den in config angegebenen benachrichtigt werden sollen

Löst aus
DeviceNotAvailableException
Throwable

isSubprocess

public static boolean isSubprocess (IConfiguration config)

Gibt „true“ zurück, wenn sich der Aufruf derzeit in einem Unterprozessbereich befindet.

Parameter
config IConfiguration

Gibt Folgendes zurück:
boolean

notifyInvocationForceStopped

public void notifyInvocationForceStopped (String message, 
                ErrorIdentifier errorId)

Benachrichtigen Sie TestInvocation, dass TradeFed angefordert wurde, den Vorgang zu beenden.

Parameter
message String: Die Nachricht, die mit dem Beenden des Aufrufs verknüpft ist.

errorId ErrorIdentifier: Kennung, die mit dem erzwungenen Stopp verknüpft ist

notifyInvocationStopped

public void notifyInvocationStopped (String message)

Benachrichtigen Sie TestInvocation, dass TradeFed demnächst heruntergefahren wird.

Parameter
message String: Die Nachricht, die mit dem Beenden des Aufrufs verknüpft 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 weiter, um Messwerte zu melden.

Parameter
client ClearcutClient

shouldSkipBugreportError

public static boolean shouldSkipBugreportError (Throwable t)

Hilfsmethode, die Fehler erkennt, wenn der Fehlerbericht übersprungen werden soll

Parameter
t Throwable

Gibt Folgendes zurück:
boolean

toString

public String toString ()

Gibt Folgendes 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

applyDeviceAutomatedSetup

protected void applyDeviceAutomatedSetup (IInvocationContext context, 
                IConfiguration config)

Parameter
context IInvocationContext

config IConfiguration

setExitCode

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

Helfer zum Festlegen des Beendigungscodes. Für Tests verfügbar gemacht.

Parameter
code CommandRunner.ExitCode

stack Throwable