-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[3.9.x] MavenPluginJavaPrerequisiteChecker: Handle 8/1.8 Java version in ranges as well #11577
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,22 @@ public class MavenPluginJavaPrerequisiteCheckerTest { | |
| public void testMatchesVersion() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use Parameterized tests here
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did the change as you asked, but now fails with checkstyle:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clearly the two are not aligned: as if I make field private or just non-public, I get So one want this, other want that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do it simple, you can try to add suppress for checkstyle, by the way I'm working on move test to JUnit 5 in #11547 |
||
| MavenPluginJavaPrerequisiteChecker checker = new MavenPluginJavaPrerequisiteChecker(); | ||
| assertTrue(checker.matchesVersion("8", "1.8")); | ||
| assertTrue(checker.matchesVersion("[8,)", "1.8")); | ||
| assertTrue(checker.matchesVersion("(,8]", "1.8")); | ||
| assertFalse(checker.matchesVersion("(,8)", "1.8")); | ||
| assertTrue(checker.matchesVersion("8", "9.0.1+11")); | ||
| assertTrue(checker.matchesVersion("[8,)", "9.0.1+11")); | ||
| assertFalse(checker.matchesVersion("(,8]", "9.0.1+11")); | ||
| assertFalse(checker.matchesVersion("(,8)", "9.0.1+11")); | ||
| assertTrue(checker.matchesVersion("1.8", "1.8")); | ||
| assertTrue(checker.matchesVersion("[1.8,)", "1.8")); | ||
| assertTrue(checker.matchesVersion("(,1.8]", "1.8")); | ||
| assertFalse(checker.matchesVersion("(,1.8)", "1.8")); | ||
| assertTrue(checker.matchesVersion("1.8", "9.0.1+11")); | ||
| assertTrue(checker.matchesVersion("[1.8,)", "9.0.1+11")); | ||
| assertFalse(checker.matchesVersion("(,1.8]", "9.0.1+11")); | ||
| assertFalse(checker.matchesVersion("(,1.8)", "9.0.1+11")); | ||
|
|
||
| assertTrue(checker.matchesVersion("1.0", "1.8")); | ||
| assertTrue(checker.matchesVersion("1.8", "9.0.1+11")); | ||
| assertFalse(checker.matchesVersion("[1.0,2],[3,4]", "2.1")); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two lines above you substring
currentVersionhere it's aboutrequiredVersion. Is it intended or are you accidently mixing variables?