Comments (2)
The console launcher already has:
RUNTIME CONFIGURATION
-cp, --classpath, --class-path=PATH
Provide additional classpath entries -- for example, for adding
engines and their dependencies. This option can be repeated.
You suggest to add:
--module-path=PATH
Provide additional module-path entries -- for example, for adding
engines and their dependencies. This option can be repeated.
Right?
The underlying issue is that java -jar APP.jar
always launches applications on the class-path; i.e. in the unnamed module. That's why you need to resort to the long-form version as shown in your initial snippet. Which could be written a bit shorter:
java --module-path libs:build/jar \
--add-modules ALL-MODULE-PATH \ // make all modules part of the module graph
--module org.junit.platform.console \ // root module is added automatically
execute \
--scan-modules \ // let junit engines find tests in all modules
--reports-dir build/junit
Now, starting off on the class-path, some code in JUnit needs to figure out how to create a module layer at runtime in order to match the configuration the user wants: which could be a combination of all module system related options java
offers. Which include: --module-path, --add-exports, --add-modules, --add-opens, --limit-modules, --patch-module, --upgrade-module-path``. Thus, when adding
--module-path` to the set of JUnit's console options, we should also consider adding some or all others. And this can turn into a maintainance burden.
I'd rather see java
to support an optional modular launcher protocol where java --multi-module-jar APP.jar
would a) run on the module path and b) support running with multi-module JARs where many named modules are packaged into a single file.
from junit5.
In addition to the manual and command-line centric "add test module into the graph configuration" above, it would be interesting to explore a programmatic approach using Java's ServiceLoader
SPI. Analog to what Testable is for @Test
methods - you would make your test modules provide a SelectModuleForTesting
implementation which then is loaded by the JUnit Platform via uses SelectModuleForTesting;
.
With that in place, no extra configuration is needed on the command-line - not left, nor right of execute
.
from junit5.
Related Issues (20)
- Running tests where the test suite has a module descriptor HOT 11
- `ClassOrderer.Random` and `MethodOrderer.Random` do not use same default seed HOT 3
- Introduce named argument set support for `@ParameterizedTest` HOT 17
- `NullPointerException` when deserializing `TestIdentifier`
- 7 files found with path `META-INF/LICENSE.md` HOT 2
- Support control characters in `@CsvSource` and `@CsvFileSource` HOT 7
- Version reported as `null` on module path
- `junit.jupiter.conditions.deactivate` is not behaving as expected. HOT 1
- Support cartesian product for multiple `@EnumSource` annotations for `@ParameterizedTest` HOT 2
- `@AfterAll` from superclasses executed after `@AfterAll` in subclasses HOT 2
- Backport selected bug fixes to 5.10.3 HOT 4
- Introduce `rootCause()` condition for use with the `EngineTestKit`
- Add static factory methods that return `Supplier<String>` to format test errors HOT 1
- Document that `Lifecycle.PER_CLASS` implies `@Execution(SAME_THREAD)` in the JavaDoc HOT 1
- Introduce `assertSize()` in Jupiter assertions HOT 7
- Combine annotations `Source` annotations to create cartesian product HOT 2
- Introduce `@NullAndEmptyAndBlankSource` for use with parameterized tests HOT 4
- assertEquals for map comparison does not report diff correctly HOT 3
- Consider implementing assertEqualsAnyOrder(Collection, Collection) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from junit5.