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_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 |
static
FailureDescription
|
createFailureFromException(Throwable exception, TestRecordProto.FailureStatus defaultStatus)
Erstellen Sie ein |
IInvocationExecution
|
createInvocationExec(TestInvocation.RunMode mode)
Erstellen Sie den Aufruf-Pfad, 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 |
void
|
notifyInvocationStopped(String message)
Benachrichtigen Sie |
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
|
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)
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
Konstanter Wert: "invocation-external-dependencies"
TRADEFED_CONFIG_NAME
public static final String TRADEFED_CONFIG_NAME
Constant Value: "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
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 im Falle eines Downloadfehlers zu ergänzen.
| Parameter | |
|---|---|
commandLine |
String |
| Returns | |
|---|---|
IBuildInfo |
|
createFailureFromException
public static FailureDescription createFailureFromException (Throwable exception, TestRecordProto.FailureStatus defaultStatus)
Erstellen Sie ein 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. |
| Returns | |
|---|---|
FailureDescription |
|
createInvocationExec
public IInvocationExecution createInvocationExec (TestInvocation.RunMode mode)
Erstellen Sie den Aufruf-Pfad, der befolgt werden soll.
| Parameter | |
|---|---|
mode |
TestInvocation.RunMode: Der Modus, in dem wir derzeit ausgeführt werden. |
| Returns | |
|---|---|
IInvocationExecution |
Die IInvocationExecution, die den Aufruf beschreibt. |
getDeviceLogName
public static String getDeviceLogName (TestInvocation.Stage stage)
| Parameter | |
|---|---|
stage |
TestInvocation.Stage |
| Returns | |
|---|---|
String |
|
getEmulatorLogName
public static String getEmulatorLogName (TestInvocation.Stage stage)
| Parameter | |
|---|---|
stage |
TestInvocation.Stage |
| Returns | |
|---|---|
String |
|
getExitInfo
public ITestInvocation.ExitInformation getExitInfo ()
Die Informationen zum Beenden des angegebenen Aufrufs.
| Returns | |
|---|---|
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 oder anderen Ressourcen neu zu planen |
extraListeners |
ITestInvocationListener: ITestInvocationListener, die zusätzlich zu den in config angegebenen benachrichtigt werden sollen |
| Ausgabe | |
|---|---|
DeviceNotAvailableException |
|
isSubprocess
public static boolean isSubprocess (IConfiguration config)
Gibt „true“ zurück, wenn sich der Aufruf derzeit in einem Unterprozessbereich befindet.
| Parameter | |
|---|---|
config |
IConfiguration |
| Returns | |
|---|---|
boolean |
|
notifyInvocationForceStopped
public void notifyInvocationForceStopped (String message,
ErrorIdentifier errorId)Benachrichtigen Sie TestInvocation, dass TradeFed angehalten werden soll.
| 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 |
| Returns | |
|---|---|
boolean |
|
toString
public String toString ()
| Returns | |
|---|---|
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 Beendigungscodes. Für Tests verfügbar gemacht.
| Parameter | |
|---|---|
code |
CommandRunner.ExitCode |
stack |
Throwable |