This module is part of the Apache Sling project.
Runs JUnit tests in an OSGi framework and provides the JUnit/Hamcrest APIs used by remote test bundles.
- Test discovery and execution inside a running Sling/OSGi runtime.
- Servlet-based test endpoints with HTML, JSON, XML, and text renderers.
- Runtime support for JUnit 4, plus optional JUnit 5 (Jupiter/Platform) integration when JUnit 5 classes are available.
- Exported JUnit and Hamcrest packages for remote test bundles.
Use Maven from the repository root:
mvn -B -ntp clean packagemvn -B -ntp testmvn -B -ntp clean verifyNotes:
verifyis heavier thantestbecause it also runs Maven Invoker integration tests fromsrc/it.- Running
src/it/annotations-itdirectly requires-Dannotations.bundle.version=<version>.
src/main/java- Bundle APIs and implementation.src/main/resources- Static resources (for examplejunit.css).src/test/java- Unit tests (JUnit 4 and JUnit 5).src/it/annotations-it- Integration tests (Maven Invoker / Pax Exam).bnd.bnd- OSGi manifest instructions, including exported JUnit/Hamcrest packages.
- Uses
jakarta.json-api(migration fromjavax.json). - Uses
org.apache.commons:commons-lang33.18.0. - JUnit 4.13.2 and Hamcrest 1.3 are exported for remote test compatibility.
- JUnit 5 support is optional at runtime and activated when platform classes are present.
