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

Improve multithreading error report in MocksBehavior #73

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


None yet
1 participant

henri-tremblay commented Jun 3, 2015

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

Please change the org.easymock.internal.MocksBehavior.checkCurrentThreadSameAsLastThread as follows:

public void checkCurrentThreadSameAsLastThread() {
if (lastThread == null) {
lastThread = Thread.currentThread();
} else if(lastThread != Thread.currentThread()) {
throw new AssertionErrorWrapper(new AssertionError(
"\n Un-thread-safe mock called from multiple threads: Last:"+lastThread+ " Current:"+Thread.currentThread()));

This makes investigation of problems with threading easier (For me it was a great help when investigating bug in TestNG)

@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