PrettyTestEventLogger
public
class
PrettyTestEventLogger
extends Object
implements
ITestInvocationListener
| java.lang.Object | |
| ↳ | com.android.tradefed.testtype.host.PrettyTestEventLogger |
Logger matching the events and logging them in order to make it easier to debug. The log on host-side and device side will strictly match in order to make it easy to search for it.
Summary
Public constructors | |
|---|---|
PrettyTestEventLogger(List<ITestDevice> devices, boolean methodLevelLogging)
|
|
Public methods | |
|---|---|
void
|
testEnded(TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
Reports the execution end of an individual test case. |
void
|
testFailed(TestDescription test, FailureDescription failure)
Reports the failure of a individual test case. |
void
|
testFailed(TestDescription test, String trace)
Reports the failure of a individual test case. |
void
|
testRunEnded(long elapsedTimeMillis, HashMap<String, MetricMeasurement.Metric> runMetrics)
Reports end of test run. |
void
|
testRunStarted(String runName, int testCount)
Reports the start of a test run. |
void
|
testStarted(TestDescription test)
Reports the start of an individual test case. |
Public constructors
PrettyTestEventLogger
public PrettyTestEventLogger (List<ITestDevice> devices, boolean methodLevelLogging)
| Parameters | |
|---|---|
devices |
List |
methodLevelLogging |
boolean |
Public methods
testEnded
public void testEnded (TestDescription test, HashMap<String, MetricMeasurement.Metric> testMetrics)
Reports the execution end of an individual test case.
If testFailed(TestDescription, FailureDescription) was not invoked, this test passed. Also returns any key/value
metrics which may have been emitted during the test case's execution.
| Parameters | |
|---|---|
test |
TestDescription: identifies the test |
testMetrics |
HashMap: a Map of the metrics emitted |
testFailed
public void testFailed (TestDescription test, FailureDescription failure)
Reports the failure of a individual test case.
Will be called between testStarted and testEnded.
| Parameters | |
|---|---|
test |
TestDescription: identifies the test |
failure |
FailureDescription: FailureDescription describing the failure and its context. |
testFailed
public void testFailed (TestDescription test, String trace)
Reports the failure of a individual test case.
Will be called between testStarted and testEnded.
| Parameters | |
|---|---|
test |
TestDescription: identifies the test |
trace |
String: stack trace of failure |
testRunEnded
public void testRunEnded (long elapsedTimeMillis,
HashMap<String, MetricMeasurement.Metric> runMetrics)Reports end of test run. FIXME: We cannot have two Map<> interfaces with different type, so we have to use HashMap here.
| Parameters | |
|---|---|
elapsedTimeMillis |
long: device reported elapsed time, in milliseconds |
runMetrics |
HashMap: key-value pairs reported at the end of a test run with Metric. |
testRunStarted
public void testRunStarted (String runName,
int testCount)Reports the start of a test run.
| Parameters | |
|---|---|
runName |
String: the test run name |
testCount |
int: total number of tests in test run |
testStarted
public void testStarted (TestDescription test)
Reports the start of an individual test case. Older interface, should use testStarted(TestDescription) whenever possible.
| Parameters | |
|---|---|
test |
TestDescription: identifies the test |