Skip to content

fix junit tests when jdk11 is used. #1255 #1259

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

Merged
merged 3 commits into from
May 28, 2025

Conversation

Lokowandtg
Copy link
Contributor

In cloudfoundry-operations there are 32 JUnit errors when jdk 11 or jdk 17 are used. Those are fixed with this change. So far not tested with later jdks.
fixes #1255

@anthonydahanne
Copy link
Contributor

please rebase on main

@anthonydahanne
Copy link
Contributor

I could assert this PR fixes the 32 Junit errors on Java 17 AND Java 21. Thank you! 🙏

@Lokowandtg can you please in your branch your update the CI to :

  • delete .github/workflows/ci-java-17-and-21.yml
  • rename .github/workflows/ci-java-8-and-11.yml to .github/workflows/ci-java.yml
  • in .github/workflows/ci-java.yml add 17, 21 to:
      matrix:
        java: [ 8, 11 ]

and then replace

      - if: ${{ matrix.java != 8 }}

with

      - if: ${{ matrix.java == 11 }}

Thanks again!

@Kehrlann
Copy link
Contributor

@Lokowandtg thanks for your contribution!

I'm picking this back up.
On my own main branch, all tests in cloudfoundry-operations pass on JDK 11 ; am I missing something?

@Lokowandtg
Copy link
Contributor Author

@Kehrlann thanks for having a look!
JDK 8 and JDK 21 worked in my setup out of main. JDK 11 and JDK 17 had the same problems in cloudfoundry-operations.
According to @anthonydahanne some merges in december fixed JDK 11 but not JDK 17. So can you test your main branch on JDK 17? Maybe I have to fix the title of this pull request.
P.S.: At the moment I am working on JDK 24 and Eclipse 2025.

@Kehrlann
Copy link
Contributor

I've tried locally, and as Anthony pointed out, it works fine 🎉

Spotless should work on JDK11+ , so I'd recommend keeping the original:

      - if: ${{ matrix.java != 8 }}

And then I'll merge this.

@Kehrlann Kehrlann self-assigned this May 28, 2025
in cloudfoundry-operations there are 32 JUnit errors when
jdk 11 or jdk17 are used. Those are fixed with this change.
So far not tested with later jdks.
@Lokowandtg Lokowandtg force-pushed the FixUnitTests-Java11 branch from 0c480e7 to 29b9a60 Compare May 28, 2025 13:44
@Kehrlann Kehrlann self-requested a review May 28, 2025 14:02
@Kehrlann Kehrlann added this to the 6.0.0 release milestone May 28, 2025
Copy link
Contributor

@Kehrlann Kehrlann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for your contribution!

@Kehrlann Kehrlann merged commit 6a8ae43 into cloudfoundry:main May 28, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit tests fail when java compiler 11 or 17 is used
3 participants