-
Notifications
You must be signed in to change notification settings - Fork 8
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
Migrate JUnit 3 tests to JUnit 4 #33
Comments
I think we should already be able to cover most of this through our JUnit 4 & Jupiter recipes: https://docs.openrewrite.org/recipes/java/testing/junit5 The If there's any missing steps or imperfections we'd love to hear; should be easy to pick up in: |
No, that is for migrating from JUnit 4 to JUnit 5. This ticket is about migrating from JUnit 3 to JUnit 4. |
The mentioned recipe does go from a |
Yes it's a bit of a leap, and I'll leave that decision up to both of you. Just know that JUnit Jupiter was released in 2017, so I'd lean towards making that leap now, rather than invest effort into a recipe copy that targets JUnit 4 still. |
JUnit 5 is largely unused in the Jenkins project, so while I am not opposed to trying it out, I am sure there will be some problems. In other words, we would want to roll this out slowly until we gain more experience and confidence with JUnit 5. In contrast JUnit 4 largely "just works" and is well adopted in the Jenkins project, and there are very few places left still using JUnit 3, so we can confidently and quickly migrate the remaining stragglers to JUnit 4 and roll this change out immediately. |
Some plugin tests still extend the JUnit 3
TestCase
object. JUnit 4 tests are much more common in Jenkins core and in Jenkins plugins. Migrate the JUnit 3 tests to JUnit 4. See this StackOverflow article that describes the steps to migrate from JUnit 3 to JUnit 4. To identify the sources impacted, search in all project files for patterns likeimport junit.framework.TestCase
orextends TestCase
.The text was updated successfully, but these errors were encountered: