Skip to content

Strengthen OSGi factory tests - #118

Merged
garydgregory merged 1 commit into
apache:mainfrom
garydgregory:strengthen-osgi-factory-tests
Nov 8, 2026
Merged

garydgregory merged 1 commit into
apache:mainfrom
garydgregory:strengthen-osgi-factory-tests

Conversation

@garydgregory

Copy link
Copy Markdown
Member

Strengthen OSGi factory tests.

Verify that all six secure default factory entry points select their
expected JDK implementations when the thread context class loader is
the library's OSGi bundle loader. Set each factory's provider property
to a nonexistent provider during its check so an accidental fallback
to ordinary provider discovery cannot silently pass. Restore each
property afterward.

Add isolated class-loading tests for FallbackIgnoreLSResourceResolver
so its static initializer executes independently for each scenario.
Verify that:
- A failed lookup through the context class loader succeeds on retry
  through the system class loader.
- A failed retry retains the original lookup exception as suppressed.
- Both successful and failed retries restore the caller's context
  class loader.
Skip these initialization tests in native images and on Android,
where their class-loading assumptions do not apply.

Clarify the OSGi test Javadoc: only the initial default-factory checks
use the bundle loader as the thread context class loader. The reused
unit tests retain the launcher's context loader because XSLTC-generated
translets require visibility of JDK internals. Document the suite's
explicit class, method, and tag exclusions.

Assisted-By: OpenAI Codex
@garydgregory
garydgregory force-pushed the strengthen-osgi-factory-tests branch from 3045697 to dc860f8 Compare November 8, 2026 12:36
@garydgregory
garydgregory merged commit adf3772 into apache:main Nov 8, 2026
17 checks passed
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