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

Test failure with the Eclipse Junit 5 bulk launcher #98

Open
vgjosse opened this issue Jan 12, 2023 · 3 comments
Open

Test failure with the Eclipse Junit 5 bulk launcher #98

vgjosse opened this issue Jan 12, 2023 · 3 comments
Assignees

Comments

@vgjosse
Copy link

vgjosse commented Jan 12, 2023

Hello,

I recently migrate some projects from Junit 4 to Junit 5 and I now have test failures linked to Jmockit.
My settings:

  • Jmockit 1.49.4
  • Open Jdk 11.0.17+8
  • MyEclipse 2022-1-0a

When I launch the tests via Maven, it works.
When I launch the tests in Eclipse one by one, it works.
When I launch the tests in Eclipse in bulk, it fails.

The issue is linked to the ArgumentCapturing.varIndexToTypeDesc static map.
varIndex is not unique in the Eclipse bulk launch and the value stored in the map, before the test launch, is overrided.
Which is an issue, because during the test execution, in CaptureMatcher.matches(), expectedType.isInstance(argValue) is false and the value is not captured.

Below is a simple example I made to reproduce the issue.
https://github.com/vgjosse/jmockit-dummy-test

I tried to understand what the varIndex variable is .. but I was not able :(
What I understand is that it is not unique when I launch my tests in Eclipse, in bulk, with Junit5.

Let me know if you need more information.

Thanks a lot for supporting that project.

Vincent

@hazendaz
Copy link
Owner

@vgjosse Thanks for putting a sample project together. I'll try to look this over this coming weekend.

@hazendaz
Copy link
Owner

@vgjosse Haven't looked yet but did want to confirm, you do have the jmockit agent installed in your MyEclipse correct? If not, install that as it should solve the issue. Update site is https://bisonschweizag.github.io/jmockit-plugin/updatesite

@vgjosse
Copy link
Author

vgjosse commented Jan 16, 2023

Hi,

I've just made the test with the eclipse plugin you've mentionned and it is still not working.
I made a try with all the 'Check scope' available.

Thanks for you answer.

Vincent

@hazendaz hazendaz self-assigned this Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants