TestAufruf
public class TestInvocation
extends Object
implements ITestInvocation
java.lang.Object | |
↳ | com.android.tradefed.invoker.TestInvocation |
Standardimplementierung von ITestInvocation
.
IConfiguration
– ruft Build ab – bereitet Ziel vor – führt Tests aus – meldet ErgebnisseZusammenfassung
Verschachtelte Klassen | |
---|---|
enum | TestInvocation.RunMode Der unterschiedliche Modus, in dem ein Aufruf ausgeführt werden kann. |
enum | TestInvocation.Stage
|
Felder | |
---|---|
public static final String | COMMAND_ARGS_KEY Schlüssel der Befehlszeilen-Argumentattribute |
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 Konstrukteure | |
---|---|
TestInvocation () |
Öffentliche Methoden | |
---|---|
static IBuildInfo | backFillBuildInfoForReporting (String commandLine) Helfer, die die Befehlszeile verwenden, um eine |
static FailureDescription | createFailureFromException (Throwable exception, TestRecordProto.FailureStatus defaultStatus) Erstellen Sie eine |
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 aus. |
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 die |
void | notifyInvocationStopped (String message) Benachrichtigen Sie die |
static void | printStageDelimiter ( TestInvocation.Stage phase, boolean end) Gibt ein Trennzeichen für eine bestimmte Stufe des Aufrufs aus. |
void | registerExecutionFiles ( ExecutionFiles executionFiles) |
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 Setzen des Exit-Codes. |
Felder
COMMAND_ARGS_KEY
public static final String COMMAND_ARGS_KEY
Schlüssel der Befehlszeilen-Argumentattribute
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 Konstrukteure
TestAufruf
public TestInvocation ()
Öffentliche Methoden
backFillBuildInfoForReporting
public static IBuildInfo backFillBuildInfoForReporting (String commandLine)
Helfer, die die Befehlszeile verwenden, um eine IBuildInfo
für die Berichterstattung 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 aus.
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 anderen Ressourcen |
extraListeners | ITestInvocationListener : Zu benachrichtigende ITestInvocationListener s, zusätzlich zu denen in config |
Wirft | |
---|---|
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 |
benachrichtigenInvocationForceStopped
public void notifyInvocationForceStopped (String message, ErrorIdentifier errorId)
Benachrichtigen Sie die TestInvocation
, 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 |
benachrichtigenInvocationStopped
public void notifyInvocationStopped (String message)
Benachrichtigen Sie die TestInvocation
, dass TradeFed schließlich 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 Stufe des Aufrufs aus.
Parameter | |
---|---|
phase | TestInvocation.Stage |
end | boolean |
registerExecutionFiles
public void registerExecutionFiles (ExecutionFiles executionFiles)
Parameter | |
---|---|
executionFiles | ExecutionFiles |
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 Setzen des Exit-Codes. Zum Testen ausgesetzt.
Parameter | |
---|---|
code | CommandRunner.ExitCode |
stack | Throwable |
Alle Inhalte und Codebeispiele auf dieser Seite unterliegen den Lizenzen wie im Abschnitt Inhaltslizenz beschrieben. Java und OpenJDK sind Marken oder eingetragene Marken von Oracle und/oder seinen Tochtergesellschaften.
Zuletzt aktualisiert: 2022-08-15 (UTC).