Skip to content

Commit c13461a

Browse files
committed
Add Javadoc
1 parent f3e93f6 commit c13461a

File tree

3 files changed

+38
-1
lines changed

3 files changed

+38
-1
lines changed

src/main/java/de/jjohannes/gradle/moduletesting/JavaModuleTestingExtension.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,41 @@ public JavaModuleTestingExtension(Project project, JavaModuleDetector moduleDete
3636
this.moduleDetector = moduleDetector;
3737
}
3838

39+
/**
40+
* Turn the given JVM Test Suite into a Blackbox Test Suite.
41+
* For example:
42+
*
43+
* javaModuleTesting.blackbox(testing.suites["integtest"])
44+
*/
3945
public void blackbox(TestSuite jvmTestSuite) {
4046
if (jvmTestSuite instanceof JvmTestSuite) {
4147
configureJvmTestSuiteForBlackbox((JvmTestSuite) jvmTestSuite);
4248
}
4349
}
4450

51+
/**
52+
* Turn the given JVM Test Suite into a Whitebox Test Suite.
53+
* For example:
54+
*
55+
* javaModuleTesting.whitebox(testing.suites["test"])
56+
*/
4557
public void whitebox(TestSuite jvmTestSuite) {
4658
whitebox(jvmTestSuite, NO_OP_ACTION);
4759

4860
}
4961

62+
/**
63+
* Turn the given JVM Test Suite into a Whitebox Test Suite.
64+
* If needed, configure additional 'requires' and open the
65+
* test packages for reflection.
66+
*
67+
* For example, for JUnit 5, you need at least:
68+
*
69+
* javaModuleTesting.whitebox(testing.suites["test"]) {
70+
* requires.add("org.junit.jupiter.api")
71+
* opensTo.add("org.junit.platform.commons")
72+
* }
73+
*/
5074
public void whitebox(TestSuite jvmTestSuite, Action<WhiteboxJvmTestSuite> conf) {
5175
if (jvmTestSuite instanceof JvmTestSuite) {
5276
WhiteboxJvmTestSuite whiteboxJvmTestSuite = project.getObjects().newInstance(WhiteboxJvmTestSuite.class);

src/main/java/de/jjohannes/gradle/moduletesting/JavaModuleTestingPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import org.gradle.api.Project;
66
import org.gradle.util.GradleVersion;
77

8-
@SuppressWarnings({"unused"})
8+
@SuppressWarnings("unused")
99
@NonNullApi
1010
public abstract class JavaModuleTestingPlugin implements Plugin<Project> {
1111

src/main/java/de/jjohannes/gradle/moduletesting/WhiteboxJvmTestSuite.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,22 @@
66

77
public interface WhiteboxJvmTestSuite {
88

9+
/**
10+
* Configure which source set contains the 'sources under test' for
11+
* this Whitebox Test Suite - defaults to 'main'.
12+
*/
913
Property<SourceSet> getSourcesUnderTest();
1014

15+
/**
16+
* Add additional 'requires' directives for the test code.
17+
* For example, 'requires.add("org.junit.jupiter.api")'.
18+
*/
1119
ListProperty<String> getRequires();
1220

21+
/**
22+
* Open all packages of this Whitebox Test Suite to a given Module
23+
* for reflection at runtime.
24+
* For example, 'opensTo.add("org.junit.platform.commons")'.
25+
*/
1326
ListProperty<String> getOpensTo();
1427
}

0 commit comments

Comments
 (0)