Closed
Conversation
Commit 0223a4 removed all the usages of @SystemDefaults annotations from this test, but left behind a pointless SystemDefaultsSwitch rule. This patch finishes the job and removes this unused rule.
This patch finalizes the upgrade of commons-lang's tests to use JUnit Jupiter and remove the Vintage Engine dependency entirely. While most of these changes are drop-in replacements with no functional benefit, there are some non-obvious changes worth mentioning. Unlike org.junit.Assert.assertEquals(double, double, double), org.junit.jupiter.api.Assertions.assertEquals(double, double, double) does not support deltas of zero, only strictly positive deltas. This issue will be addressed in JUnit Jupiter 5.4 (see junit-team/junit-framework#1613 for details). In the meanwhile, assertTrue(expected==actual) was used, and TODO comments were placed in the code to refactor it to assertEquals once JUnit 5.4 is available. Unlike org.junit.Test, org.junit.jupiter.api.Test does not have an "expected" argument. Instead, an explicit call to org.junit.jupiter.api.Assertions.assertThrows is used. Unlike org.junit.Test, org.junit.jupiter.api.Test does not have a "timeout" argument either. Instead, an explicit call to org.junit.jupiter.api.Assertions.assertTimeoutPreemptively is used. JUnit Jupiter also no longer has the concept of Rules. Usages of the SystemDefaultsSwitch rule and its accompanying annotates were replaced with the @DefaultLocale annotation that Benedikt Ritter contributed to JUnit Pioneer, the semi-official JUnit extension project. Following the removal of their usages, the SystemDefaults annotation, the SystemDefaultsSwitch rule and the SystemDefaultsSwitchTest class that tests them had no more use, and they were removed entirely. It's also worth noting this is a minimal patch for migrating the package's tests to Jupiter. There are several tests that can be made more elegant with Jupiter's new features, but that work is left for subsequent patches.
9a3e1d7 to
8577320
Compare
Contributor
|
Thank you very much for this massive effort! 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch finalizes the upgrade of commons-lang's tests to use JUnit Jupiter and removes the Vintage Engine dependency entirely.
While most of these changes are drop-in replacements with no functional benefit, there are some non-obvious changes worth mentioning.
Unlike
org.junit.Assert.assertEquals(double, double, double),org.junit.jupiter.api.Assertions.assertEquals(double, double, double)does not support deltas of zero, only strictly positive deltas.This issue will be addressed in JUnit Jupiter 5.4 (see junit-team/junit-framework#1613 for details). In the meanwhile,
assertTrue(expected==actual)was used, andTODOcomments were placed in the code to refactor it to assertEquals once JUnit 5.4 is available.Unlike
org.junit.Test,org.junit.jupiter.api.Testdoes not have anexpectedargument. Instead, an explicit call toorg.junit.jupiter.api.Assertions.assertThrowsis used.Unlike
org.junit.Test,org.junit.jupiter.api.Testdoes not have atimeoutargument either. Instead, an explicit call toorg.junit.jupiter.api.Assertions.assertTimeoutPreemptivelyis used.JUnit Jupiter also no longer has the concept of Rules. Usages of the
SystemDefaultsSwitchrule and its accompanying annotates were replaced with the@DefaultLocaleannotation that @britter contributed to JUnit Pioneer, the semi-official JUnit extension project, or simply removed entirely where they had no use (i.e., fromStringUtilsEqulasIndexOfTest).Following the removal of their usages, the
@SystemDefaultsannotation, theSystemDefaultsSwitchrule and theSystemDefaultsSwitchTestclass that tests them had no more use, and they were removed entirely.It's also worth noting this is a minimal patch for migrating the package's tests to Jupiter. There are several tests that can be made more elegant with Jupiter's new features, but that work is left for subsequent patches.