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: migrate Maintest to JUnit 5 #4570

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

MartinWitt
Copy link
Collaborator

#3919
This is by far the hardest test to migrate. Testing against System.exit is more or less dying. For this, we need a Security Manager or a lib providing it for us, like https://todd.ginsberg.com/post/testing-system-exit/. But Security Manager is getting removed real fast in a near version of java https://openjdk.java.net/jeps/411 and the lib can't test for the message. We could only test if the exit code -1 is set. Therefore, I would simply remove this testcase otherwise we have to remove it in JDK 19 or something because spoon can't compile any more(calling methods from a removed API is hard :) ).

 The following has changed in the code:
Replaced junit 4 test annotation with junit 5 test annotation in testGenericContract
Replaced junit 4 test annotation with junit 5 test annotation in testTest
Replaced junit 4 test annotation with junit 5 test annotation in testResourcesCopiedInTargetDirectory
Replaced junit 4 test annotation with junit 5 test annotation in testResourcesNotCopiedInTargetDirectory
Replaced junit 4 test annotation with junit 5 test annotation in testLauncherWithoutArgumentsExitWithSystemExit
Transformed junit4 assert to junit 5 assertion in testTest
Transformed junit4 assert to junit 5 assertion in testResourcesCopiedInTargetDirectory
Transformed junit4 assert to junit 5 assertion in testResourcesNotCopiedInTargetDirectory
@monperrus monperrus merged commit f362f68 into INRIA:master Jan 26, 2022
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

Successfully merging this pull request may close these issues.

2 participants