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( devices, boolean methodLevelLogging)

Public methods

void testEnded(TestDescription test, 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, 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 ( devices, 
                boolean methodLevelLogging)

Parameters
devices

methodLevelLogging boolean

Public methods

testEnded

public void testEnded (TestDescription test, 
                 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 : a ERROR(/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, 
                 runMetrics)

Reports end of test run.

Parameters
elapsedTimeMillis long: device reported elapsed time, in milliseconds

runMetrics : key-value pairs reported at the end of a test run

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(com.android.tradefed.result.TestDescription) whenever possible.

Parameters
test TestDescription: identifies the test