Roman Macor created ISPN-6019:
---------------------------------
Summary: RetryOnFailureUnitTest.testMultipleRetryOnExecuteFailure fails
randomly
Key: ISPN-6019
URL:
https://issues.jboss.org/browse/ISPN-6019
Project: Infinispan
Issue Type: Bug
Components: Test Suite - Server
Reporter: Roman Macor
RetryOnFailureUnitTest.testMultipleRetryOnExecuteFailure fails randomly with:
Error Message
Misplaced argument matcher detected here:
-> at
org.infinispan.client.hotrod.TransportObjectFactoryTest.testValidate(TransportObjectFactoryTest.java:34)
You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
when(mock.get(anyInt())).thenReturn(null);
doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
verify(mock).someMethod(contains("foo"))
Also, this error might show up because you use argument matchers with methods that cannot
be mocked.
Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
Stacktrace
org.mockito.exceptions.misusing.InvalidUseOfMatchersException:
Misplaced argument matcher detected here:
-> at
org.infinispan.client.hotrod.TransportObjectFactoryTest.testValidate(TransportObjectFactoryTest.java:34)
You cannot use argument matchers outside of verification or stubbing.
Examples of correct usage of argument matchers:
when(mock.get(anyInt())).thenReturn(null);
doThrow(new RuntimeException()).when(mock).someVoidMethod(anyObject());
verify(mock).someMethod(contains("foo"))
Also, this error might show up because you use argument matchers with methods that cannot
be mocked.
Following methods *cannot* be stubbed/verified: final/private/equals()/hashCode().
at
org.infinispan.client.hotrod.retry.RetryOnFailureUnitTest.doRetryTest(RetryOnFailureUnitTest.java:56)
at
org.infinispan.client.hotrod.retry.RetryOnFailureUnitTest.testMultipleRetryOnExecuteFailure(RetryOnFailureUnitTest.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)