Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cocoa/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java TestNG';s getCurrentInvocationCount()太高?_Java_Count_Testng_Invocation - Fatal编程技术网

Java TestNG';s getCurrentInvocationCount()太高?

Java TestNG';s getCurrentInvocationCount()太高?,java,count,testng,invocation,Java,Count,Testng,Invocation,我有一个测试监听器类,使用扩展AbstractWebDriverEventListener实现ITestListener,IInvokedMethodListener 在调用之前的中调用ITestNGMethod.getCurrentInvocationCount()返回0 在afterInvocation中,调用ITestNGMethod.getCurrentInvocationCount()返回2 这只是一个测试,为什么调用完成后计数为2? 不是应该是1吗 我将断点设置为org.testng

我有一个测试监听器类,使用
扩展AbstractWebDriverEventListener实现ITestListener,IInvokedMethodListener

在调用之前的
调用
ITestNGMethod.getCurrentInvocationCount()
返回0 在
afterInvocation
中,调用
ITestNGMethod.getCurrentInvocationCount()
返回2

这只是一个测试,为什么调用完成后计数为2? 不是应该是1吗

我将断点设置为org.testng.internal.BaseTestMethod.java的
incrementCurrentInvocationCount()
,它在
IvokeMethodRunnable.java
中调用一次,然后在testng方法完成后在
Invoker.java
中再次调用

调用计数为2意味着它被称为1?它被称为2??)