模块监听器
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 |