JUnitToInvocationResultForwarder
public class JUnitToInvocationResultForwarder
extends Object
implements TestListener
java.lang.Object |
↳ | com.android.tradefed.result.JUnitToInvocationResultForwarder |
侦听TestListener
事件并将它们转发到ITestInvocationListener
的类。
概括
公共构造函数
JUnitToInvocationResultForwarder
public JUnitToInvocationResultForwarder (ITestInvocationListener invocationListener)
参数 |
---|
invocationListener | ITestInvocationListener |
JUnitToInvocationResultForwarder
public JUnitToInvocationResultForwarder ( invocationListeners)
公共方法
添加错误
public void addError (Test test,
Throwable t)
添加失败
public void addFailure (Test test,
AssertionFailedError t)
参数 |
---|
test | Test |
t | AssertionFailedError |
结束测试
public void endTest (Test test,
metrics)
来自可以转发指标的 JUnit3 测试的回调。
参数 |
---|
test | Test :刚运行完的Test 。 |
metrics | :要传递给结果回调的 Map 格式的指标。 |
结束测试
public void endTest (Test test)
开始测试
public void startTest (Test test)
public void testLog (String dataName,
LogDataType dataType,
InputStreamSource dataStream)
从 JUnit3 转发器回调,以便从测试中获取日志。
参数 |
---|
dataName | String :数据的 String 描述性名称。例如“device_logcat”。注意 dataName 每次调用可能不是唯一的。即实现者必须能够处理具有相同数据名的多个调用 |
dataType | LogDataType :数据的 LogDataType |
dataStream | InputStreamSource :数据的 InputStreamSource。实施者应调用 createInputStream 开始读取数据,并确保在完成后关闭生成的 InputStream。调用者应确保数据源保持存在且可访问,直到 testLog 方法完成。 |