Mock assertion counting does not seem to be thread safe
Brought to you by:
tammofreese
Hi,
I had a test in which a single mock object was called back by various different threads concurrently and it randomly failed to count the calls to each method, leading to unexpected test failures.
I then modified the test so that each thread had its own mock object to hit and I got back repeatable successes.
The drawback is, my test got quite a bit more complex.
Would it be possible to make mock objects thread safe, or to have the ability to create a synchronized wrapper for them, something like EasyMock.synchronizedMock(mock), mimicking what Collections.synchronizedXXX(collection) methods do?