PrettyTestEventLogger

public class PrettyTestEventLogger
extends Object implements ITestInvocationListener

java.lang.Object
   ↳ com.android.tradefed.testtype.host.PrettyTestEventLogger


与事件匹配的记录器,并按顺序记录事件,以便更轻松地进行调试。主机端和设备端的日志将严格匹配,以便于搜索。

摘要

公共构造函数

PrettyTestEventLogger( devices, boolean methodLevelLogging)

公共方法

void testEnded(TestDescription test, testMetrics)

报告单个测试用例的执行结束时间。

void testFailed(TestDescription test, FailureDescription failure)

报告单个测试用例的失败。

void testFailed(TestDescription test, String trace)

报告单个测试用例的失败。

void testRunEnded(long elapsedTimeMillis, runMetrics)

报告测试运行结束。

void testRunStarted(String runName, int testCount)

报告测试运行的开始。

void testStarted(TestDescription test)

报告单个测试用例的开始。

公共构造函数

PrettyTestEventLogger

public PrettyTestEventLogger ( devices, 
                boolean methodLevelLogging)

参数
devices

methodLevelLogging boolean

公共方法

testEnded

public void testEnded (TestDescription test, 
                 testMetrics)

报告单个测试用例的执行结束时间。

如果未调用 testFailed(TestDescription, FailureDescription),则此测试通过。还会返回测试用例执行期间可能发出的任何键值指标。

参数
test TestDescription:用于标识测试

testMetrics :所发出指标的 ERROR(/Map)

testFailed

public void testFailed (TestDescription test, 
                FailureDescription failure)

报告单个测试用例的失败。

将在 testStarted 和 testEnded 之间调用。

参数
test TestDescription:用于标识测试

failure FailureDescription:描述失败及其上下文的 FailureDescription

testFailed

public void testFailed (TestDescription test, 
                String trace)

报告单个测试用例的失败。

将在 testStarted 和 testEnded 之间调用。

参数
test TestDescription:用于标识测试

trace String:失败的堆栈轨迹

testRunEnded

public void testRunEnded (long elapsedTimeMillis, 
                 runMetrics)

报告测试运行结束。

参数
elapsedTimeMillis long:设备报告的已用时间,以毫秒为单位

runMetrics :在测试运行结束时报告的键值对

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

报告测试运行的开始。

参数
runName String:测试运行名称

testCount int:测试运行中的测试总数

testStarted

public void testStarted (TestDescription test)

报告单个测试用例的开始。旧版接口,应尽可能使用 testStarted(com.android.tradefed.result.TestDescription)

参数
test TestDescription:用于标识测试