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

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

Comments

Projects
None yet
1 participant
@henri-tremblay
Contributor

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.

@henri-tremblay henri-tremblay self-assigned this Jun 3, 2015

@henri-tremblay henri-tremblay added this to the 2.5 milestone Jun 3, 2015

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