模組監聽器
public class ModuleListener
extends CollectingTestListener
偵聽器附加到每個模組的每個IRemoteTest
以收集結果清單。
概括
公共方法 |
---|
boolean | hasLastAttemptFailed () 傳回偵聽器上次重試會話是否失敗。 |
void | logAssociation (String dataName, LogFile logFile) |
void | setAttemptIsolation (CurrentInvocation.IsolationGrade isolation) 設定是否應將嘗試報告為孤立的。 |
void | setCollectTestsOnly (boolean collectTestsOnly) 設定我們是否只收集測試。 |
void | setMarkTestsSkipped (boolean skip) 是否將所有測試案例標記為跳過。 |
void | testAssumptionFailure (TestDescription test, String trace) |
void | testAssumptionFailure (TestDescription test, FailureDescription failure) |
void | testEnded (TestDescription test, long endTime, testMetrics) testEnded (TestDescription test, long endTime, testMetrics) |
void | testEnded (TestDescription test, testMetrics) testEnded (TestDescription test, testMetrics) |
void | testFailed (TestDescription test, FailureDescription failure) |
void | testFailed (TestDescription test, String trace) |
void | testIgnored (TestDescription test) |
void | testLog (String dataName, LogDataType dataType, InputStreamSource dataStream) |
void | testLogSaved (String dataName, LogDataType dataType, InputStreamSource dataStream, LogFile logFile) |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) |
void | testRunFailed (FailureDescription failure) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String name, int numTests, int attemptNumber) |
void | testRunStarted (String name, int numTests, int attemptNumber, long startTime) |
void | testStarted (TestDescription test, long startTime) |
公共構造函數
模組監聽器
public ModuleListener (ITestInvocationListener listener)
構造函數。
參數 |
---|
listener | ITestInvocationListener |
公共方法
上次嘗試失敗
public boolean hasLastAttemptFailed ()
傳回偵聽器上次重試會話是否失敗。
日誌關聯
public void logAssociation (String dataName,
LogFile logFile)
參數 |
---|
dataName | String |
logFile | LogFile |
設定嘗試隔離
public void setAttemptIsolation (CurrentInvocation.IsolationGrade isolation)
設定是否應將嘗試報告為孤立的。
參數 |
---|
isolation | CurrentInvocation.IsolationGrade |
僅設定收集測試
public void setCollectTestsOnly (boolean collectTestsOnly)
設定我們是否只收集測試。
參數 |
---|
collectTestsOnly | boolean |
設定跳過的標記測試
public void setMarkTestsSkipped (boolean skip)
是否將所有測試案例標記為跳過。
測試假設失敗
public void testAssumptionFailure (TestDescription test,
String trace)
參數 |
---|
test | TestDescription |
trace | String |
測試假設失敗
public void testAssumptionFailure (TestDescription test,
FailureDescription failure)
參數 |
---|
test | TestDescription |
failure | FailureDescription |
測試結束
public void testEnded (TestDescription test,
long endTime,
testMetrics)
參數 |
---|
test | TestDescription |
endTime | long |
testMetrics | |
測試結束
public void testEnded (TestDescription test,
testMetrics)
參數 |
---|
test | TestDescription |
testMetrics | |
測試失敗
public void testFailed (TestDescription test,
FailureDescription failure)
參數 |
---|
test | TestDescription |
failure | FailureDescription |
測試失敗
public void testFailed (TestDescription test,
String trace)
參數 |
---|
test | TestDescription |
trace | String |
測試被忽略
public void testIgnored (TestDescription test)
public void testLog (String dataName,
LogDataType dataType,
InputStreamSource dataStream)
參數 |
---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
public void testLogSaved (String dataName,
LogDataType dataType,
InputStreamSource dataStream,
LogFile logFile)
參數 |
---|
dataName | String |
dataType | LogDataType |
dataStream | InputStreamSource |
logFile | LogFile |
測試運行結束
public void testRunEnded (long elapsedTime,
runMetrics)
參數 |
---|
elapsedTime | long |
runMetrics | |
測試運行失敗
public void testRunFailed (FailureDescription failure)
參數 |
---|
failure | FailureDescription |
測試運行失敗
public void testRunFailed (String errorMessage)
測試運行開始
public void testRunStarted (String name,
int numTests,
int attemptNumber)
參數 |
---|
name | String |
numTests | int |
attemptNumber | int |
測試運行開始
public void testRunStarted (String name,
int numTests,
int attemptNumber,
long startTime)
參數 |
---|
name | String |
numTests | int |
attemptNumber | int |
startTime | long |
測試開始
public void testStarted (TestDescription test,
long startTime)
參數 |
---|
test | TestDescription |
startTime | long |