NameMangleListener

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)

void testFailed(TestDescription test, String trace)

void testIgnored(TestDescription test)

void testLog(String dataName, LogDataType dataType, InputStreamSource dataStream)

void 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)

此方法会在传递给 testStarted(com.android.tradefed.result.TestDescription)testFailed(com.android.tradefed.result.TestDescription, String)ITestLifeCycleReceiver.testEnded(com.android.tradefed.result.TestDescription, HashMap) 回调的所有 TestDescription 上运行。

String mangleTestRunName(String name)

系统会对传递给 testRunStarted(String, int) 回调的所有测试运行名称运行此方法。

公共构造函数

NameMangleListener

public NameMangleListener (ITestInvocationListener listener)

参数
listener ITestInvocationListener

公共方法

getSummary

public TestSummary getSummary ()

返回
TestSummary

invocationEnded

public void invocationEnded (long elapsedTime)

参数
elapsedTime long

invocationFailed

public void invocationFailed (Throwable cause)

参数
cause Throwable

invocationStarted

public void invocationStarted (IInvocationContext context)

参数
context IInvocationContext

testAssumptionFailure

public void testAssumptionFailure (TestDescription test, 
                String trace)

参数
test TestDescription

trace String

testEnded

public void testEnded (TestDescription test, 
                 testMetrics)

参数
test TestDescription

testMetrics

testFailed

public void testFailed (TestDescription test, 
                String trace)

参数
test TestDescription

trace String

testIgnored

public void testIgnored (TestDescription test)

参数
test TestDescription

testLog

public void testLog (String dataName, 
                LogDataType dataType, 
                InputStreamSource dataStream)

参数
dataName String

dataType LogDataType

dataStream InputStreamSource

testRunEnded

public void testRunEnded (long elapsedTime, 
                 runMetrics)

参数
elapsedTime long

runMetrics

testRunFailed

public void testRunFailed (String errorMessage)

参数
errorMessage String

testRunStarted

public void testRunStarted (String runName, 
                int testCount)

参数
runName String

testCount int

testRunStopped

public void testRunStopped (long elapsedTime)

参数
elapsedTime long

testStarted

public void testStarted (TestDescription test)

参数
test TestDescription

受保护的方法

mangleTestId

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 上运行。该方法应返回一个可能不同的 TestDescription,该 TestDescription 将传递给构建期间指定的下游 ITestInvocationListener

实现时应注意不要修改原始 TestDescription

默认实现会将传入标识符原封不动地传递给下游。

参数
test TestDescription

返回
TestDescription

mangleTestRunName

protected String mangleTestRunName (String name)

系统会对传递给 testRunStarted(String, int) 回调的所有测试运行名称运行此方法。该方法应返回可能不同的测试运行名称,该名称将传递给构建期间指定的下游 ITestInvocationListener

实现时应注意不要修改原始运行名称。

默认实现会将传入的测试运行名称原封不动地传递给下游。

参数
name String

返回
String