結果聚合器
public class ResultAggregator
extends CollectingTestListener
特殊轉發器,根據所採取的重試策略,在需要時聚合結果。
概括
公共方法 |
---|
void | cleanEventsFiles () |
final void | forwardAggregatedInvocationLogs () 將所有呼叫等級日誌轉送至不支援粒度結果的結果報告器。 |
void | invocationEnded (long elapsedTime) |
void | invocationFailed (FailureDescription failure) |
void | invocationFailed (Throwable cause) |
void | invocationStarted (IInvocationContext context) |
void | logAssociation (String dataName, LogFile logFile) |
void | setLogSaver (ILogSaver logSaver) |
void | setUpdatedReporting (boolean updatedReporting) 設定新的報告。 |
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 | 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 | testModuleEnded () |
void | testModuleStarted (IInvocationContext moduleContext) |
void | testRunEnded (long elapsedTime, runMetrics) testRunEnded (long elapsedTime, runMetrics) |
void | testRunFailed (FailureDescription failure) |
void | testRunFailed (String errorMessage) |
void | testRunStarted (String name, int testCount, int attemptNumber, long startTime) |
void | testStarted (TestDescription test, long startTime) |
公共構造函數
結果聚合器
public ResultAggregator ( listeners,
RetryStrategy strategy)
參數 |
---|
listeners | |
strategy | RetryStrategy |
公共方法
清理事件文件
public void cleanEventsFiles ()
轉送聚合呼叫日誌
public final void forwardAggregatedInvocationLogs ()
將所有呼叫等級日誌轉送至不支援粒度結果的結果報告器。
呼叫結束
public void invocationEnded (long elapsedTime)
呼叫失敗
public void invocationFailed (FailureDescription failure)
參數 |
---|
failure | FailureDescription |
呼叫失敗
public void invocationFailed (Throwable cause)
調用開始
public void invocationStarted (IInvocationContext context)
參數 |
---|
context | IInvocationContext |
日誌關聯
public void logAssociation (String dataName,
LogFile logFile)
參數 |
---|
dataName | String |
logFile | LogFile |
設定日誌保存程序
public void setLogSaver (ILogSaver logSaver)
設定更新報告
public void setUpdatedReporting (boolean updatedReporting)
設定新的報告。
參數 |
---|
updatedReporting | boolean |
測試假設失敗
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 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 testModuleEnded ()
測試模組啟動
public void testModuleStarted (IInvocationContext moduleContext)
參數 |
---|
moduleContext | IInvocationContext |
測試運行結束
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 testCount,
int attemptNumber,
long startTime)
參數 |
---|
name | String |
testCount | int |
attemptNumber | int |
startTime | long |
測試開始
public void testStarted (TestDescription test,
long startTime)
參數 |
---|
test | TestDescription |
startTime | long |
受保護的方法
取得事件日誌
protected File[] getEventsLogs ()