名稱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.testDescription) 的所有 ITestLifeCycleReceiver.testEnded(com.android.testDescription) 的所有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 |