In earlier versions of Easymock, it was possible to call a mock from different threads concurrently. This is now no longer possible: Either it is checked whether the mock is called only from a single thread, or all mock calls are synchronized.
This is bad if one wants to test the threading behaviour of an object which calls methods on a second (mocked) object. To check whether synchronisation is correct, the mock needs to have the same threading behavior as the mocked object. One common case is that there is no synchronisation in the mocked object, and this behaviour cannot be produced in the mocks any more.
My suggestion would be to add a disableThreadChecks(boolean disable) method to the IMocksControl object, which would be used to disable the thread checks if the mock is not synchronized.
Log in to post a comment.