(jsr-353) Re-enable test suite by running tests from class path - #97
Merged
Merged
Conversation
Tests were disabled in 18-Jan-2025 because the JSON-P 1.1 RI
(`org.glassfish:javax.json`) declares Automatic-Module-Name "java.json" -- the
same name as the API module (`javax.json:javax.json-api`) -- so the two cannot
both be read on the module path:
javax.json.JsonException: Provider org.glassfish.json.JsonProviderImpl not found
The module name only matters on the module path, so tell surefire to run from
the class path instead (`useModulePath=false`) and restore the test-scoped RI
dependency. Main sources are still compiled on the module path, so the
`module-info.java` `requires java.json` is still validated.
This brings back 26 tests that have not run since Jan 2025 -- including
`JsonPatchDeserializationTest` and `ModuleSPIMetadataTest`. All pass.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
cowtowncoder
approved these changes
Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
jsr-353has had<skipTests>true</skipTests>since 18-Jan-2025. The reason is recorded in the pom: the JSON-P 1.1 RI (org.glassfish:javax.json) declaresAutomatic-Module-Name: java.json, the same name as the API module (javax.json:javax.json-api), so both cannot be read on the module path. With the RI dropped, every test errors at class-init:So the module has shipped with zero executed tests for over a year. That is how the
JsonPatchSTART_ARRAY guard could sit here with tests that never ran while its jakarta twin silently lacked the fix (#92).Fix
The clashing Automatic-Module-Name only matters on the module path. Run the tests from the class path instead:
and restore the test-scoped
org.glassfish:javax.jsondependency.Main sources are still compiled on the module path, so
module-info.java'srequires java.jsonis still validated — this only changes how tests execute.Result
26 tests run and pass, where 0 ran before:
mvn verifyon the module also passes: jar builds, SBOM generates. One benign warning remains during test compilation, which is exactly the collision being side-stepped:Full reactor is green (jsr-353 26, joda-money 95, json-org 12, jakarta-jsonp 23, jakarta-mail 7, javax-money 135, moneta 137).
If you would rather retire the module than maintain it, that is obviously a fine outcome too — but while it ships, having the suite actually run seems worth it.