-
-
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?
Conversation
org.junit.onramp moduleorg.junit.start module
junit-platform-commons/src/main/java/org/junit/platform/commons/util/ModuleUtils.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Marc Philipp <mail@marcphilipp.de>
| [source,java,indent=0] | ||
| ---- | ||
| import module org.junit.start; | ||
| void main() { JUnit.run(); } | ||
| @Test | ||
| void test() { Assertions.assertEquals(2, 1 + 1); } | ||
| ---- |
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.
We don't usually include code snippets in the release notes. Can we link to the User Guide instead?
| ==== New Features and Improvements | ||
|
|
||
| * Introduce new module `org.junit.start` for writing and running tests. It simplifies | ||
| usages of JUnit in compact source files together with a single module import statement: |
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.
| usages of JUnit in compact source files together with a single module import statement: | |
| using JUnit in compact source files together with a single module import statement: |
| import module org.junit.start; | ||
|
|
||
| void main() { | ||
| JUnit.run(); | ||
| } | ||
|
|
||
| @Test | ||
| void stringLength() { | ||
| Assertions.assertEquals(11, "Hello JUnit".length()); | ||
| } |
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.
Would it be possible to replace this snippet with an include of a source file from src/test/java? That way it would get compiled.
| public static final String GRADLE_KOTLIN_EXTENSIONS = "gradle-kotlin-extensions"; | ||
| public static final String GRADLE_MISSING_ENGINE = "gradle-missing-engine"; | ||
| public static final String JAR_DESCRIBE_MODULE = "jar-describe-module"; | ||
| public static final String JUNIT_start = "junit-start"; |
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.
| public static final String JUNIT_start = "junit-start"; | |
| public static final String JUNIT_START = "junit-start"; |
Please review this PR introducing the
org.junit.startmodule.Closes #4982
New "Source Launcher" section in "Running Tests" of the User Guide
I hereby agree to the terms of the JUnit Contributor License Agreement.
Definition of Done
@APIannotations