Gate platform-optional test assertions on probed capabilities - #63
Merged
garydgregory merged 1 commit intoAug 30, 2026
Merged
Conversation
Add probe-once capability constants to AttackTestSupport (secure processing, parser-attached schemas, XInclude, SAXParser.reset) and gate the wrapper tests' platform-optional assertions on them instead of failing where the platform default implementation does not support the surface, notably Android. Tests of the DOM wrapper contract skip where the platform DOM is left unwrapped, the newDefault* smoke tests assert the degraded lookup instead of the removed FactoryConfigurationError, and every SecureFactoriesSmokeTest method now carries the tag of the JAXP factory it exercises, running it across the implementation matrix. That wider matrix exposed the schema smoke tests asserting the stock JDK's FEATURE_SECURE_PROCESSING default rather than the library's contract; they now assert the wrapped SecureSchema product, the actual schema securing observable. Assisted-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MbfpcsKig16HfSe6jGhcvh
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.
Makes the Android instrumented suite green after #62 by gating platform-optional test assertions on probed capabilities instead of platform checks.
AttackTestSupportgains seven probe-once constants built on asupportsConfiguration(Executable)helper:DOM_SUPPORTS_SCHEMA/SECURE_PROCESSING/XINCLUDEandSAX_SUPPORTS_RESET/SCHEMA/SECURE_PROCESSING/XINCLUDE. Each probes the platform default factory once at class load; Android's implementations inherit the throwing JAXP base methods, so the guarded assertions skip there and start running automatically on any platform that adds the capability.DOM_RESOLVES_INTERNAL_ENTITIESprobe where the platform DOM is deliberately left unwrapped.newDefault*smoke tests drop their obsoleteassertThrows(FactoryConfigurationError)Android branches (the merged degradation makes the methods succeed) and guard only the FSP assertions; the TrAX variant asserts its documented Android contract,TransformerFactoryConfigurationError, since TrAX is outside the degradation's scope.SecureFactoriesSmokeTestmethod now carries the tag of the JAXP factory it exercises, so the smoke tests run across the whole implementation matrix. That exposed the schema smoke tests asserting the stock JDK'sFEATURE_SECURE_PROCESSINGdefault rather than the library's contract (schema securing is the resolver floor plus secure sub-parsers; FSP is deliberately not set on the factory): they now assert the wrappedSecureSchemaproduct instead.Verified: full JVM surefire matrix green;
connectedDebugAndroidTeston the API 33 emulator green with zero failures (capability-gated tests report as skipped, likeXIncludeTest).🤖 Generated with Claude Code
https://claude.ai/code/session_01MbfpcsKig16HfSe6jGhcvh