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,並傳遞至建構期間指定的下游 ITestInvocationListener

實作時應小心,避免修改原始 TestDescription

預設實作方式會將傳入的 ID 傳遞至未修改的狀態。

參數
test TestDescription

傳回
TestDescription

mangleTestRunName

protected String mangleTestRunName (String name)

這個方法會在傳遞至 testRunStarted(String, int) 回呼的所有測試執行名稱上執行。此方法應傳回可能不同的測試執行名稱,並傳遞至建構期間指定的下游 ITestInvocationListener

實作時應小心,避免修改原始執行作業名稱。

預設實作方式會將傳入的測試執行名稱傳遞,且不會修改。

參數
name String

傳回
String