名称MangleListener
public abstract class NameMangleListener
extends Object
implements ITestInvocationListener
java.lang.Object | |
↳ | com.android.tradefed.result.NameMangleListener |
代理侦听器,用于在报告结果时翻译测试方法、类和包名称。
概括
公共构造函数 | |
---|---|
NameMangleListener (ITestInvocationListener listener) |
公共方法 | |
---|---|
TestSummary | getSummary () |
void | invocationEnded (long elapsedTime) |
void | invocationFailed (Throwable cause) |
void | invocationStarted (IInvocationContext context) |
void | testAssumptionFailure (TestDescription test, String trace) |
void | testEnded (TestDescription test, testMetrics) testEnded (TestDescription test, testMetrics) |
void | testFailed (TestDescription test, String trace) |
void | testIgnored (TestDescription test) |
void | testLog (String dataName, LogDataType dataType, InputStreamSource dataStream) |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String runName, int testCount) |
void | testRunStopped (long elapsedTime) |
void | testStarted (TestDescription test)
|
受保护的方法 | |
---|---|
TestDescription | mangleTestId (TestDescription test) 此方法在传递给 |
String | mangleTestRunName (String name) 此方法在传递给 |
公共构造函数
名称MangleListener
public NameMangleListener (ITestInvocationListener listener)
参数 | |
---|---|
listener | ITestInvocationListener |
公共方法
获取摘要
public TestSummary getSummary ()
退货 | |
---|---|
TestSummary |
调用结束
public void invocationEnded (long elapsedTime)
参数 | |
---|---|
elapsedTime | long |
调用失败
public void invocationFailed (Throwable cause)
参数 | |
---|---|
cause | Throwable |
调用开始
public void invocationStarted (IInvocationContext context)
参数 | |
---|---|
context | IInvocationContext |
测试假设失败
public void testAssumptionFailure (TestDescription test, String trace)
参数 | |
---|---|
test | TestDescription |
trace | String |
测试结束
public void testEnded (TestDescription test,testMetrics)
参数 | |
---|---|
test | TestDescription |
testMetrics |
测试失败
public void testFailed (TestDescription test, String trace)
参数 | |
---|---|
test | TestDescription |
trace | String |
测试被忽略
public void testIgnored (TestDescription test)
参数 | |
---|---|
test | TestDescription |
测试日志
public void testLog (String dataName, LogDataType dataType, InputStreamSource dataStream)
参数 | |
---|---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
测试运行结束
public void testRunEnded (long elapsedTime,runMetrics)
参数 | |
---|---|
elapsedTime | long |
runMetrics |
测试运行失败
public void testRunFailed (String errorMessage)
参数 | |
---|---|
errorMessage | String |
测试运行开始
public void testRunStarted (String runName, int testCount)
参数 | |
---|---|
runName | String |
testCount | int |
测试运行停止
public void testRunStopped (long elapsedTime)
参数 | |
---|---|
elapsedTime | long |
测试开始
public void testStarted (TestDescription test)
参数 | |
---|---|
test | TestDescription |
受保护的方法
mangle测试ID
protected TestDescription mangleTestId (TestDescription test)
此方法在传递给testStarted(com.android.tradefed.result.TestDescription)
、 testFailed(com.android.tradefed.result.TestDescription, String)
和ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, HashMap)
) 的所有TestDescription
上运行。 ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, HashMap)
回调。该方法应该返回一个可能不同的TestDescription
,该 TestDescription 将被传递给在构造期间指定的下游ITestInvocationListener
。
实现时应注意不要修改原始TestDescription
。
默认实现不加修改地传递传入标识符。
参数 | |
---|---|
test | TestDescription |
退货 | |
---|---|
TestDescription |
mangle测试运行名称
protected String mangleTestRunName (String name)
此方法在传递给testRunStarted(String, int)
回调的所有测试运行名称上运行。该方法应返回一个可能不同的测试运行名称,该名称将传递给在构造期间指定的下游ITestInvocationListener
。
参数 | |
---|---|
name | String |
退货 | |
---|---|
String |