Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upStackOverFlow when mocking Thread.getName(). #52
Closed
Labels
Comments
This comment has been minimized.
This comment has been minimized.
Ok, this will be fixed for next release. Thanks for reporting. |
This comment has been minimized.
This comment has been minimized.
While it looks like the example above was fixed in 1.12 I still get a stackoverflow for this test in 1.13
and in 1.14 and beyond I get "java.lang.IllegalArgumentException: Attempted to record expectation on unmockable method". Is there a better way to do this? My actual code isn't going to have a direct reference to the thread instance created in the test, it will be calling Thread.currentThread().getName() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi again,
I want to report an issue I discovered recently.
When one mocks the Thread.getName method, a StackOverFlow occurs. I did debug the code, and it turns out that JMockit internal classes use the Thread.getName method. So when I mock it, an infinite recursion occurs.
Thanks.
JMockit Version 1.10.
JDK 1.7.0_51
OS Win7 64bit