Major version upgrade to v6.0.0 with JUnit Jupiter 6.0.0 support#299
Major version upgrade to v6.0.0 with JUnit Jupiter 6.0.0 support#299TheSouffleuringHatter wants to merge 4 commits into
Conversation
Major version upgrade implementing JUnit Jupiter 6.0.0 support with comprehensive module restructuring and package renaming for better semantic clarity. BREAKING CHANGES: - Drop JUnit 4 support (removed junit4 module) - Rename modules: junit-common → weld-common, junit5 → weld-junit-jupiter - Update artifact IDs: weld-junit-common → weld-common, weld-junit5 → weld-junit-jupiter - Rename packages: org.jboss.weld.junit → org.jboss.weld.testing, org.jboss.weld.junit5 → org.jboss.weld.junit.jupiter - Rename classes: WeldJunit5Extension → WeldJupiterExtension, WeldJunit5AutoExtension → WeldJupiterAutoExtension - Bump to JUnit Jupiter 6.0.0 and JUnit Platform 6.0.0 (requires Java 17+) Features: - Support JUnit Jupiter 5.x and 6.x via version range - Update for JUnit 6 API changes (MethodOrderer.MethodName, Stream.toList()) - Maintain shared weld-common module for JUnit Jupiter and Spock compatibility - All 140 JUnit Jupiter tests passing Migration: - Update Maven dependency artifact IDs - Update package imports from org.jboss.weld.junit5 → org.jboss.weld.junit.jupiter - Update service provider files: META-INF/services/org.jboss.weld.junit.jupiter.WeldJunitEnricher
- Documented support for JUnit Jupiter 5.x and 6.x in `JUNIT_VERSION_COMPATIBILITY.md`. - Updated Maven profiles for testing with JUnit 5 (backward compatibility) and JUnit 6 (default). - Enhanced CI workflow to support matrix testing for JUnit versions.
…r improved clarity - Renamed `WeldJupiterExtension` to `WeldJUnitJupiterExtension` across all occurrences. - Updated associated JavaDoc, annotations, and references to align with the new naming convention. - Adjusted README links and examples accordingly.
…x support - Updated references to align with the WeldJUnitJupiterExtension naming convention. - Revised documentation to clarify support for JUnit Jupiter 5.x and 6.x, requiring Java 17+. - Adjusted example code, Maven dependency, and links to reflect the latest module structure and artifact changes.
Please do not totally unnecessary and useless Java minimum requirement updates. All the JUnit requirement means is, that you need to use a Java 17+ compiler, but using Also, why should JUnit 4 support be dropped? And Spock still supports Java 8, so there is no real need to force users on Java 17, except if JUnit 4, JUnit 5, and Spock support is dropped, or the maintainers of |
I don't have a strong opinion but I haven't seen an issue for it in a long time.
Don't we specify 17 already as a compiler source/target? The parent project holding the config is here. I have other issue with this PR though. For 5.0 branch we can mitigate this easily as I said in the issue (I will send a PR, it's on my TODO list). 6.0 branch will be targetting CDI 5.0 and Weld 7 which is some way off in the distance (Jakarta 12 release plan is for next sumer I think?) so we have time to consider the options yet. |
|
No downloads for weld-junit4 on mvnrepository.com Just a thought towards supporting or dropping weld-junit4: No downloads at https://mvnrepository.com/artifact/org.jboss.weld/weld-junit4 Java 17+ In my opinion, if weld-testing will support junit-jupiter (meaning junit5 and junit6), weld-testing should probably support Java8+, because junit5 has until it's end support for Java8. BUT, as @manovotn mentions, having weld-testing with Java8+ support would be a wider scope as it is for time being. If I am not wrong, weld-testing users have to use Java17+ nowadays already, or use some tricks. weld-testing v5.1 and v6.0 Thinking about a smooth transition for users a way forward could be:
In my opinion, it would be totally weird using junit6 on the one side, but using org.jboss.weld.junit5.WeldJunit5Extension from weld-testing v5.1+ onwards. I think the breaking change towards org.jboss.weld.junit.jupiter.WeldJunitJupiterExtension has to be some day. |
|
Closing here in favor of #301 |
Honestly, I didn't check, just have read the description here.
Yeah, we already thought about it when adding the Spock support, as then
That's pretty irrelevant. |
The version we have now is (IIRC) because of a baseline Java version for respective Jakarta version that Weld implements.
That I have no memory of 😅 |
|
To my knowledge there is no issue with JUnit 6 support in Spock. |
Indeed, as you @Vampire are already highlighting in spockframework/spock#2206 (comment) |
|
The error in question is because of the We can get rid of that to be fair; it is in place to test an extension throwing error in certain scenario and it is a bit of a hack (as JUnit has no easy way of doing that). |
Overview
Major version upgrade to support JUnit Jupiter 6.0.0, dropping JUnit 4 support and restructuring modules for better semantic clarity and alignment with modern JUnit naming conventions.
Breaking Changes
Module Structure
junit4module entirelyjunit-common→weld-common(shared testing utilities for both JUnit Jupiter and Spock)junit5→weld-junit-jupiter(better semantic alignment with JUnit Jupiter naming)5.0.3-SNAPSHOT→6.0.0-SNAPSHOTPackage Renames
org.jboss.weld.junit→org.jboss.weld.testing(shared utilities)org.jboss.weld.junit5→org.jboss.weld.junit.jupiter(JUnit Jupiter integration)org.jboss.weld.junit5.auto→org.jboss.weld.junit.jupiter.autoClass Renames
WeldJunit5Extension→WeldJupiterExtensionWeldJunit5AutoExtension→WeldJupiterAutoExtensionArtifact ID Changes
weld-junit-common→weld-commonweld-junit5→weld-junit-jupiterNew Features
MethodOrderer.Alphanumeric→MethodOrderer.MethodNameCollectionUtils.toUnmodifiableList()→Stream.toList()Dependencies
5.13.4→6.0.01.12.2→6.0.06.0.3.Final(Jakarta namespace)Migration Guide
Maven Dependency Update
Service Provider Configuration
If you have custom WeldJunitEnricher implementations:
OLD:
META-INF/services/org.jboss.weld.junit5.WeldJunitEnricherNEW:
META-INF/services/org.jboss.weld.junit.jupiter.WeldJunitEnricherUpdate the file path and contents to use new package names.
Known Issues
Deferred to Future Releases
Testing
Checklist
Related Issues
Closes #293 #295 #296
Claude implementation plan
I made this plan with my Claude-companion which Claude applied for creating this PR