Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create opportunity to disable SingleThread checks #88

henri-tremblay opened this issue Jun 3, 2015 · 0 comments

Create opportunity to disable SingleThread checks #88

henri-tremblay opened this issue Jun 3, 2015 · 0 comments


Copy link

henri-tremblay commented Jun 3, 2015

Migrated from: CodeHaus issue EASYMOCK-77
Original reporter: Henri Tremblay

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant