-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Introduce adapters for JUnit 4 Rules #433
Comments
@sbrannen Is the proposal to allow these three Rules in JUnit Jupiter tests but not others? |
@kcooney, yes, that's correct. The JUnit 5 team analyzed the existing rules in JUnit 4 and selected ones that can be supported with current extension APIs in JUnit Jupiter. JUnit 4 rules not in the above list cannot currently be supported without some sort of |
Suggestion (from vacation again, excuse top posting). Adapters will promote the continued use of the old rules. Consider as an alternative providing mappings. For bonus points, automate NB I'm writing from my phone at a Gaelic football tournament. I've not Cheers On Jul 30, 2016 12:03 PM, "Sam Brannen" notifications@github.com wrote:
|
Two points:
|
I agree that
Indeed, this proposal addresses a different scenario. We have been approached multiple times by developers who want to use Jupiter but are awed by the amount of tests they would need to migrate in order to have old and new tests use the new engine. For such use cases, it will be a lot easier just to replace all the annotations through a script and keep using the most common rules (for now). E.g. replacing
I'll reply on #169 regarding your prototype. |
@marcphilipp instead of special-casing these two rules, have you considered modifying these rules to implement an interface that JUnit Jupiter could support? That would allow third-party developers to potentially update their rules to work with JUnit Jupiter. Of course, then people who want to easily migrate their tests using this migration tool would beed to upgrade to JUnit 4.13 (at least if they wanted the tool to migrate tests using those rules). It would be quite easy to retrofit these rules to implement my |
limited support for JUnit 4 rules of type org.junit.rules.ExternalResource optional dependency of the Jupiter engine on JUnit 4 #433 (cherry picked from commit a20fd0d)
add tests for the initial rule support. #433
new integration test with 2 rules and after invocation verification #433
Refactor ExternalResourceSupport to prepare for rule-annotated methods and other TestRules #433
Support rule-annotated methods and make the afterAll-check fail the build if appropriate. #433
The ExternalResourceSupport is now composed of the two separately implemented support classes for method and field support, respectively. Includes a test to verify the relative order of both cases. #433
…from JUnit 4 This test would fail correctly if commented in so serves as documentation only. #433
limited support for JUnit 4 rules of type org.junit.rules.ExternalResource optional dependency of the Jupiter engine on JUnit 4 #433 (cherry picked from commit a20fd0d)
add tests for the initial rule support. #433
new integration test with 2 rules and after invocation verification #433
Refactor ExternalResourceSupport to prepare for rule-annotated methods and other TestRules #433
Support rule-annotated methods and make the afterAll-check fail the build if appropriate. #433
add tests for the initial rule support. #433
new integration test with 2 rules and after invocation verification #433
Refactor ExternalResourceSupport to prepare for rule-annotated methods and other TestRules #433
Support rule-annotated methods and make the afterAll-check fail the build if appropriate. #433
The ExternalResourceSupport is now composed of the two separately implemented support classes for method and field support, respectively. Includes a test to verify the relative order of both cases. #433
…from JUnit 4 This test would fail correctly if commented in so serves as documentation only. #433
Goals
Introduce adapters for common JUnit 4 Rules in the
junit-jupiter-engine
.The dependency from
junit-jupiter-engine
to JUnit 4 must be an optional dependency.This support should be automatically enabled if
junit-4.x.jar
is on the classpath.Proposed Candidates
ExpectedException
ExternalResource
Verifier
Related Issues
Related Blog Posts
The text was updated successfully, but these errors were encountered: