File tree Expand file tree Collapse file tree 4 files changed +54
-2
lines changed Expand file tree Collapse file tree 4 files changed +54
-2
lines changed Original file line number Diff line number Diff line change @@ -230,6 +230,8 @@ endif::[]
230230// Jupiter Migration Support
231231:EnableJUnit4MigrationSupport: {javadoc-root}/org.junit.jupiter.migrationsupport/org/junit/jupiter/migrationsupport/EnableJUnit4MigrationSupport.html[@EnableJUnit4MigrationSupport]
232232:EnableRuleMigrationSupport: {javadoc-root}/org.junit.jupiter.migrationsupport/org/junit/jupiter/migrationsupport/rules/EnableRuleMigrationSupport.html[@EnableRuleMigrationSupport]
233+ // JUnit Start
234+ :JUnit: {javadoc-root}/org.junit.start/org/junit/start/JUnit.html[JUnit]
233235// Vintage
234236:junit-vintage-engine: {javadoc-root}/org.junit.vintage.engine/org/junit/vintage/engine/package-summary.html[junit-vintage-engine]
235237// Examples Repository
@@ -247,6 +249,8 @@ endif::[]
247249:Checkstyle: https://checkstyle.sourceforge.io[Checkstyle]
248250:DiscussionsQA: https://github.com/junit-team/junit-framework/discussions/categories/q-a[Q&A category on GitHub Discussions]
249251:Hamcrest: https://hamcrest.org/JavaHamcrest/[Hamcrest]
252+ :JEP511: https://openjdk.org/jeps/511[JEP 511]
253+ :JEP512: https://openjdk.org/jeps/512[JEP 512]
250254:Jimfs: https://google.github.io/jimfs/[Jimfs]
251255:Log4j: https://logging.apache.org/log4j/2.x/[Log4j]
252256:Log4j_JDK_Logging_Adapter: https://logging.apache.org/log4j/2.x/log4j-jul/index.html[Log4j JDK Logging Adapter]
Original file line number Diff line number Diff line change @@ -52,6 +52,17 @@ repository on GitHub.
5252[[release-notes-6.1.0-M1-junit-jupiter-new-features-and-improvements]]
5353==== New Features and Improvements
5454
55+ * Introduce new module `org.junit.start` for writing and running tests. It simplifies
56+ usages of JUnit in compact source files together with a single module import statement:
57+ [source,java,indent=0]
58+ ----
59+ import module org.junit.start;
60+
61+ void main() { JUnit.run(); }
62+
63+ @Test
64+ void test() { Assertions.assertEquals(2, 1 + 1); }
65+ ----
5566* Introduce new `dynamicTest(Consumer<? super Configuration>)` factory method for dynamic
5667 tests. It allows configuring the `ExecutionMode` of the dynamic test in addition to its
5768 display name, test source URI, and executable.
Original file line number Diff line number Diff line change @@ -836,6 +836,40 @@ DYNAMIC = 35
836836REPORTED = 37
837837----
838838
839+ [[running-tests-source-launcher]]
840+ === Source Launcher
841+
842+ Java 25 introduced Module Import Declarations with {JEP511} and Compact Source Files
843+ and Instance Methods with {JEP512}. The `org.junit.start` module is JUnit's "On-Ramp"
844+ enabler, allowing to write minimal source code programs. For example, like in a
845+ `HelloTests.java` file reading:
846+
847+ ```java
848+ import module org.junit.start;
849+
850+ void main() {
851+ JUnit.run();
852+ }
853+
854+ @Test
855+ void stringLength() {
856+ Assertions.assertEquals(11, "Hello JUnit".length());
857+ }
858+ ```
859+ With all required modular JAR files available in a local `lib/` directory, the
860+ following Java 25+ command will discover and execute tests using the JUnit Platform.
861+ It will also print the result tree to the console.
862+
863+ ```shell
864+ java --module-path lib --add-modules org.junit.start HelloTests.java
865+ ╷
866+ └─ JUnit Jupiter ✔
867+ └─ HelloTests ✔
868+ └─ stringLength() ✔
869+ ```
870+
871+ Find JUnit's class API documentation here: {JUnit}
872+
839873[[running-tests-discovery-selectors]]
840874=== Discovery Selectors
841875
Original file line number Diff line number Diff line change 11< body >
22
3- < p > This document consists of three sections:</ p >
3+ < p > This document consists of four sections:</ p >
44
55< dl >
66 < dt > Platform</ dt >
1212 </ dd >
1313 < dt > Jupiter</ dt >
1414 < dd > JUnit Jupiter is the combination of the programming model and extension model for
15- writing JUnit tests and extensions. The Jupiter sub-project provides a TestEngine
15+ writing JUnit tests and extensions. The Jupiter subproject provides a TestEngine
1616 for running Jupiter based tests on the platform.
1717 </ dd >
1818 < dt > Vintage</ dt >
1919 < dd > JUnit Vintage provides a TestEngine for running JUnit 3 and JUnit 4 based tests on the
2020 platform.
2121 </ dd >
22+ < dt > Other Modules</ dt >
23+ < dd > This section lists all modules that are not part of a dedicated section.
24+ </ dd >
2225</ dl >
2326
2427< p > Already consulted the < a href ="../user-guide/index.html "> JUnit User Guide</ a > ?</ p >
You can’t perform that action at this time.
0 commit comments