Skip to content

Commit 7fdabeb

Browse files
committed
Update README
1 parent 99eef6b commit 7fdabeb

File tree

1 file changed

+9
-19
lines changed

1 file changed

+9
-19
lines changed

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,37 +60,27 @@ plugins {
6060
}
6161
```
6262

63-
## Configure a Blackbox Test Suite
63+
## Blackbox Test Suites
6464

65-
To turn the existing JVM Test Suite _integtest_ ito a Blackbox Test Suite:
66-
67-
```
68-
javaModuleTesting.blackbox(testing.suites["integtest"])
69-
```
70-
71-
You can create and/or configure a different test suite as long as you wrap it in `javaModuleTesting.blackbox(...)`.
72-
See documentation on [JVM Test Suites](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html#sec:jvm_test_suite_configuration)
73-
for more details.
74-
75-
It is expected that a blackbox _test source set_ has its own `module-info.java`.
65+
The plugin automatically turns [JVM Test Suites](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html) into _Blackbox Test Suites_ if the `src/<test-suite-name>/module-info.java` file exists.
7666
A blackbox test suite is a separate module itself.
67+
See documentation on [JVM Test Suites](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html#sec:jvm_test_suite_configuration) for more details on creating and configuring test suites.
7768

78-
## Configure a Whitebox Test Suite
69+
## Whitebox Test Suites
7970

80-
To turn the existing JVM Test Suite _test_ ito a Whitebox Test Suite:
71+
The plugin automatically turns [JVM Test Suites](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html) **without** `module-info.java` file into _Whitebox Test Suites_.
72+
Whitebox Test Suites might require additional configuration, which can be done like this:
8173

8274
```
8375
javaModuleTesting.whitebox(testing.suites["test"]) {
8476
requires.add("org.junit.jupiter.api")
85-
opensTo.add("org.junit.platform.commons")
77+
// opensTo.add("org.junit.platform.commons") <-- opensTo 'org.junit.platform.commons' is done by default
8678
}
8779
```
8880

89-
You can create and/or configure a different test suite as long as you wrap it in `javaModuleTesting.whitebox(...)`.
90-
See documentation on [JVM Test Suites](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html#sec:jvm_test_suite_configuration)
91-
for more details.
81+
See documentation on [JVM Test Suites](https://docs.gradle.org/current/userguide/jvm_test_suite_plugin.html#sec:jvm_test_suite_configuration) for more details on creating and configuring test suites.
9282

93-
It is expected that a whitebox _test source set_ does **not** have a `module-info.java`.
83+
A whitebox _test source set_ does **not** have a `module-info.java`.
9484
Instead, the _main_ and _test_ classes will be patched together and the test will run in the _main_ module which now includes the test classes as well.
9585
Additional `requires` for the test are defined as shown above.
9686
If the _sources under test_ are located in a different source set (not `main`), this can be configured via `sourcesUnderTest.set("source-set-name")`.

0 commit comments

Comments
 (0)