Skip to content

Conversation

@Bukama
Copy link
Contributor

@Bukama Bukama commented Nov 7, 2025

JUnit Pioneer is happy to contribute its DefaultLocaleExtension and DefaultTimeZoneExtension to JUnit Jupiter.

closes #4727


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

@sbrannen sbrannen linked an issue Nov 8, 2025 that may be closed by this pull request
@sbrannen sbrannen changed the title Initial draft for providing DefaultLocale and DefaulTimezone extensions Initial draft for providing @DefaultLocale and @DefaulTimezone extensions Nov 8, 2025
Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

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

Thanks for this initial push! 👍

How to use JUnit's internal testkit

We just use EngineTestKit directly, without the abstraction that Pioneer has. I commented on one such test.

Why checkstyle fails just right after spotless:apply goal was run

Checkstyle can fail even though Spotless formatted the code. Spotless is purely about formatting, while we use Checkstyle for some more semantic checks.

That ArchUnit rules are in place

What did you want to check for?

@marcphilipp marcphilipp changed the title Initial draft for providing @DefaultLocale and @DefaulTimezone extensions Initial draft for providing @DefaultLocale and @DefaultTimeZone extensions Nov 8, 2025
@Bukama
Copy link
Contributor Author

Bukama commented Nov 9, 2025

Thank you for your feedback, I think (hope) I applied all of it correctly. I find the testkit methods very confusing and verbose, but I guess that's a thing how used you are to them.

What did you want to check for?
Nothing, I saw that I have violations against ArchUnit's rules, but was too tired to check which I violate (turned out it was the missing @API annotations.

In general I'm done with most parts, I now have to figure out which are the correct findAnnotation methods in JUpiter to match those of Pioneer. Especially those with nested and class level ones.

@Bukama Bukama force-pushed the 4727_passdefaultlocale branch 2 times, most recently from dda60f6 to 14a75bc Compare November 20, 2025 19:09
@Bukama
Copy link
Contributor Author

Bukama commented Nov 20, 2025

To keep you up to date:
Putting the classes in the api.util packages results in a circular dependency of api.extension due the TimeoutUtil class in the same package. For testing purpose I moved all of them to a dummy package (will split and rename it later) to make progress on getting the build green. I then spent some time on the module-info, but also got this now, but now test that check the module-info break. But it's far too late today. Will continue tomorrow or Saturday.

@marcphilipp
Copy link
Member

Putting the classes in the api.util packages results in a circular dependency of api.extension due the TimeoutUtil class in the same package.

Hmm, I hadn't thought of that. We should probably move TimeoutUtil to a separate package. Let's go with org.junit.jupiter.api.timeout for now, ok?

@marcphilipp
Copy link
Member

Hmm, I hadn't thought of that. We should probably move TimeoutUtil to a separate package. Let's go with org.junit.jupiter.api.timeout for now, ok?

Actually, I've just done this on main so it should suffice for you to rebase this PR.

@Bukama
Copy link
Contributor Author

Bukama commented Nov 22, 2025

Hmm, I hadn't thought of that. We should probably move TimeoutUtil to a separate package. Let's go with org.junit.jupiter.api.timeout for now, ok?

Actually, I've just done this on main so it should suffice for you to rebase this PR.

Great, I will work later this day / tomorrow

@Bukama Bukama force-pushed the 4727_passdefaultlocale branch from cada4ef to 9d1e8c1 Compare November 22, 2025 18:35
@Bukama
Copy link
Contributor Author

Bukama commented Nov 22, 2025

I give up. After wasting another few hours for getting those tests green which check module system files that do nowhere exists and complain about modules would not exists while the compiler says they do.

@Bukama Bukama force-pushed the 4727_passdefaultlocale branch from 3e4c8d9 to 9a7a7fa Compare November 24, 2025 19:23
@Bukama Bukama changed the title Initial draft for providing @DefaultLocale and @DefaultTimeZone extensions Contribute DefaultLocaleExtension and DefaultTimeZoneExtension Nov 24, 2025
@Bukama Bukama marked this pull request as ready for review November 24, 2025 19:25
@Bukama
Copy link
Contributor Author

Bukama commented Nov 24, 2025

Thanks @sormuras for pointing out the obvious 🤦‍♂️ When you don't see the forest because of trees...

Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

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

Di you have time to make the requested changes? If not, please let me know and I can take over.

@Bukama Bukama force-pushed the 4727_passdefaultlocale branch from 372ebfa to f106f36 Compare December 2, 2025 19:18
@Bukama Bukama requested a review from marcphilipp December 2, 2025 19:19
JUnit Pioneer is happy to contribute its DefaultLocaleExtension and DefaultTimeZoneExtension to JUnit Jupiter.

closes junit-team#4727
@Bukama Bukama force-pushed the 4727_passdefaultlocale branch from f106f36 to e079fac Compare December 6, 2025 12:38
@testlens-app
Copy link

testlens-app bot commented Dec 6, 2025

✅ All tests passed ✅

🏷️ Commit: 9888b92
▶️ Tests: 43477 executed
⚪️ Checks: 15/15 completed

Copy link
Member

@marcphilipp marcphilipp left a comment

Choose a reason for hiding this comment

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

Thanks for all the hard work! I polished the documentation a bit and pushed two commits.

@marcphilipp marcphilipp merged commit bea12a8 into junit-team:main Dec 7, 2025
18 checks passed
@Bukama Bukama deleted the 4727_passdefaultlocale branch December 7, 2025 14:26
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.

Support set / reset time zone and locale during test execution

4 participants