Skip to content

Conversation

@dyrpsf
Copy link
Contributor

@dyrpsf dyrpsf commented Feb 2, 2026

This PR addresses #246.

Summary

SBMLDocument.checkConsistency() already delegates to checkConsistencyOffline(), 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:

  • updates the documentation to match the actual behaviour, and
  • adds a small regression test to ensure checkConsistency() continues to use the offline validator.

Changes

  1. Javadoc updates in SBMLDocument

    • core/src/org/sbml/jsbml/SBMLDocument.java
      • checkConsistencyOffline() Javadoc now explains that the offline validator is used by default when calling checkConsistency(), and points to checkConsistencyOnline() 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 via checkConsistencyOnline().

    Note: No executable code was changed; only comments/Javadoc were modified.
    The method remains:

    public int checkConsistency() {
      return checkConsistencyOffline();
    }
  2. New unit test

    • Added core/test/org/sbml/jsbml/test/SBMLDocumentValidationModeTest.java
    • The test creates a small TestDocument subclass of SBMLDocument that overrides:
      • checkConsistencyOffline() and
      • checkConsistencyOnline()
        and records which one is called.
    • The test checkConsistencyUsesOfflineValidatorByDefault() asserts that:
      • checkConsistency() calls the offline variant,
      • does not call the online variant,
      • and returns the offline method’s result.

    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.

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.

1 participant