Skip to content

Add tests for requireJavaVersion five-part JDK strings #980 - #1019

Merged
slawekjaranowski merged 1 commit into
apache:masterfrom
AzazelSensei:test-980-five-part-java-version
Aug 31, 2026
Merged

Add tests for requireJavaVersion five-part JDK strings #980#1019
slawekjaranowski merged 1 commit into
apache:masterfrom
AzazelSensei:test-980-five-part-java-version

Conversation

@AzazelSensei

Copy link
Copy Markdown
Contributor

Following this checklist to help us incorporate your
contribution quickly and easily:

  • Your pull request should address just one issue, without pulling in other changes.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body.
    Note that commits might be squashed by a maintainer on merge.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied.
    This may not always be possible but is a best-practice.
  • Run mvn verify to make sure basic checks pass.
    A more thorough check will be performed on your pull request automatically.
  • You have run the integration tests successfully (mvn -Prun-its verify).

#980 asked for tests around #967. requireJavaVersion with ${java.version} pins the raw runtime string. For 21.0.10.0.1 that normalizes to 21.0.10-0, so the exact string has to be accepted first.

I added:

  • normalizeJDKVersion("21.0.10.0.1")21.0.10-0
  • exact 21.0.10.0.1 is allowed
  • the normalized form is not in that exact range
  • setVersion(SystemUtils.JAVA_VERSION) then execute() still passes on the running JDK

mvn -pl enforcer-rules -am verify -DskipITs -Dtest=TestRequireJavaVersion is green here.

normalizeJDKVersion(21.0.10.0.1) becomes 21.0.10-0, so a requireJavaVersion
pin of ${java.version} only passes when the raw runtime string is tried first.
@AzazelSensei AzazelSensei mentioned this pull request Aug 27, 2026
@slawekjaranowski slawekjaranowski linked an issue Aug 31, 2026 that may be closed by this pull request
@slawekjaranowski
slawekjaranowski merged commit a53e395 into apache:master Aug 31, 2026
17 checks passed
@github-actions github-actions Bot added this to the 3.6.4 milestone Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make UTs for #967

3 participants