Document offline validation as the default and add test (#246) #281
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.
This PR addresses #246.
Summary
SBMLDocument.checkConsistency()already delegates tocheckConsistencyOffline(), so offline validation is effectively the default. However, the Javadoc still claimed that validation was "currently performed using the SBML.org online validator". This PR:checkConsistency()continues to use the offline validator.Changes
Javadoc updates in
SBMLDocumentcore/src/org/sbml/jsbml/SBMLDocument.javacheckConsistencyOffline()Javadoc now explains that the offline validator is used by default when callingcheckConsistency(), and points tocheckConsistencyOnline()as the alternative.checkConsistency()Javadoc is updated to state that validation is performed using the JSBML internal offline validator, with the SBML.org online validator still available viacheckConsistencyOnline().New unit test
core/test/org/sbml/jsbml/test/SBMLDocumentValidationModeTest.javaTestDocumentsubclass ofSBMLDocumentthat overrides:checkConsistencyOffline()andcheckConsistencyOnline()and records which one is called.
checkConsistencyUsesOfflineValidatorByDefault()asserts that:checkConsistency()calls the offline variant,This guards against future regressions where
checkConsistency()might accidentally call the online validator again.Tests
Executed locally:
mvn -pl core test✅Test Results
The newly added regression test behaves as expected and passes successfully.