-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Introduce org.junit.start module
#5042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3afdf0a
2fdb122
e59b227
8cdf2f5
4d1f062
f4ba4fc
ea1e686
0eb6fa0
64d6554
a3c4b61
f542616
2308620
4dd14d6
61c678d
a170306
1e060d0
efb6cd8
bb31561
8199ca7
dea7a32
13cabb8
6c5ca16
fabc52c
d15673a
3ff5a4e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -836,6 +836,40 @@ DYNAMIC = 35 | |
| REPORTED = 37 | ||
| ---- | ||
|
|
||
| [[running-tests-source-launcher]] | ||
| === Source Launcher | ||
|
|
||
| Java 25 introduced Module Import Declarations with {JEP511} and Compact Source Files | ||
| and Instance Methods with {JEP512}. The `org.junit.start` module is JUnit's "On-Ramp" | ||
| enabler, allowing to write minimal source code programs. For example, like in a | ||
| `HelloTests.java` file reading: | ||
|
|
||
| ```java | ||
| import module org.junit.start; | ||
|
|
||
| void main() { | ||
| JUnit.run(); | ||
| } | ||
|
|
||
| @Test | ||
| void stringLength() { | ||
| Assertions.assertEquals(11, "Hello JUnit".length()); | ||
| } | ||
sormuras marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ``` | ||
| With all required modular JAR files available in a local `lib/` directory, the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the question of which modules, and how to obtain them out of scope for this PR? |
||
| following Java 25+ command will discover and execute tests using the JUnit Platform. | ||
| It will also print the result tree to the console. | ||
|
|
||
| ```shell | ||
| java --module-path lib --add-modules org.junit.start HelloTests.java | ||
| ╷ | ||
| └─ JUnit Jupiter ✔ | ||
| └─ HelloTests ✔ | ||
| └─ stringLength() ✔ | ||
| ``` | ||
|
|
||
| Find JUnit's class API documentation here: {JUnit} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After running |
||
|
|
||
| [[running-tests-discovery-selectors]] | ||
| === Discovery Selectors | ||
|
|
||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a lot of jargon and detail in this paragraph. It gets in the way of conveying the essence. Consider something like: