Skip to content

Commit 2dc5f38

Browse files
committed
Move ProcessStarter to separate source set to fix Vintage tests
1 parent a9dc43a commit 2dc5f38

File tree

13 files changed

+52
-20
lines changed

13 files changed

+52
-20
lines changed

junit-platform-reporting/junit-platform-reporting.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ dependencies {
2020
osgiVerification(libs.openTestReporting.tooling.spi)
2121

2222
testFixturesApi(projects.junitJupiterApi)
23-
testFixturesImplementation(libs.groovy4) {
24-
because("it provides convenience methods to handle process output")
25-
}
26-
testFixturesImplementation(libs.commons.io) {
27-
because("it uses TeeOutputStream")
28-
}
2923
}
3024

3125
tasks {

platform-tests/platform-tests.gradle.kts

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
import junitbuild.extensions.capitalized
13
import org.gradle.api.tasks.PathSensitivity.NONE
24
import org.gradle.api.tasks.PathSensitivity.RELATIVE
35
import org.gradle.internal.os.OperatingSystem
@@ -9,6 +11,18 @@ plugins {
911
id("junitbuild.jmh-conventions")
1012
}
1113

14+
val processStarter by sourceSets.creating {
15+
java {
16+
srcDir("src/processStarter/java")
17+
}
18+
}
19+
20+
java {
21+
registerFeature(processStarter.name) {
22+
usingSourceSet(processStarter)
23+
}
24+
}
25+
1226
dependencies {
1327
// --- Things we are testing --------------------------------------------------
1428
testImplementation(projects.junitPlatformCommons)
@@ -37,16 +51,32 @@ dependencies {
3751
testImplementation(libs.bundles.xmlunit)
3852
testImplementation(testFixtures(projects.junitJupiterApi))
3953
testImplementation(testFixtures(projects.junitPlatformReporting))
54+
testImplementation(projects.platformTests) {
55+
capabilities {
56+
requireFeature("process-starter")
57+
}
58+
}
4059

4160
// --- Test run-time dependencies ---------------------------------------------
4261
testRuntimeOnly(projects.junitVintageEngine)
4362
testRuntimeOnly(libs.groovy4) {
4463
because("`ReflectionUtilsTests.findNestedClassesWithInvalidNestedClassFile` needs it")
4564
}
4665

47-
// --- https://openjdk.java.net/projects/code-tools/jmh/ -----------------------
66+
// --- https://openjdk.java.net/projects/code-tools/jmh/ ----------------------
4867
jmh(projects.junitJupiterApi)
4968
jmh(libs.junit4)
69+
70+
// --- ProcessStarter dependencies --------------------------------------------
71+
processStarter.implementationConfigurationName(libs.groovy4) {
72+
because("it provides convenience methods to handle process output")
73+
}
74+
processStarter.implementationConfigurationName(libs.commons.io) {
75+
because("it uses TeeOutputStream")
76+
}
77+
processStarter.implementationConfigurationName(libs.opentest4j) {
78+
because("it throws TestAbortedException")
79+
}
5080
}
5181

5282
jmh {
@@ -80,6 +110,9 @@ tasks {
80110
includeTags("junit4")
81111
}
82112
}
113+
named<Checkstyle>("checkstyle${processStarter.name.capitalized()}").configure {
114+
config = resources.text.fromFile(checkstyle.configDirectory.file("checkstyleMain.xml"))
115+
}
83116
}
84117

85118
eclipse {

junit-platform-reporting/src/testFixtures/java/org/junit/platform/reporting/process/ProcessResult.java renamed to platform-tests/src/processStarter/java/org/junit/platform/tests/process/ProcessResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://www.eclipse.org/legal/epl-v20.html
99
*/
1010

11-
package org.junit.platform.reporting.process;
11+
package org.junit.platform.tests.process;
1212

1313
import java.util.List;
1414

junit-platform-reporting/src/testFixtures/java/org/junit/platform/reporting/process/ProcessStarter.java renamed to platform-tests/src/processStarter/java/org/junit/platform/tests/process/ProcessStarter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://www.eclipse.org/legal/epl-v20.html
99
*/
1010

11-
package org.junit.platform.reporting.process;
11+
package org.junit.platform.tests.process;
1212

1313
import java.io.ByteArrayOutputStream;
1414
import java.io.IOException;

junit-platform-reporting/src/testFixtures/java/org/junit/platform/reporting/process/WatchedOutput.java renamed to platform-tests/src/processStarter/java/org/junit/platform/tests/process/WatchedOutput.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://www.eclipse.org/legal/epl-v20.html
99
*/
1010

11-
package org.junit.platform.reporting.process;
11+
package org.junit.platform.tests.process;
1212

1313
import java.io.ByteArrayOutputStream;
1414
import java.nio.charset.Charset;

junit-platform-reporting/src/testFixtures/java/org/junit/platform/reporting/process/WatchedProcess.java renamed to platform-tests/src/processStarter/java/org/junit/platform/tests/process/WatchedProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* https://www.eclipse.org/legal/epl-v20.html
99
*/
1010

11-
package org.junit.platform.reporting.process;
11+
package org.junit.platform.tests.process;
1212

1313
public class WatchedProcess {
1414

junit-platform-reporting/src/testFixtures/java/org/junit/platform/reporting/process/package-info.java renamed to platform-tests/src/processStarter/java/org/junit/platform/tests/process/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* @since 1.12
55
*/
66

7-
package org.junit.platform.reporting.process;
7+
package org.junit.platform.tests.process;

platform-tests/src/test/java/org/junit/platform/reporting/open/xml/OpenTestReportGeneratingListenerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
import org.junit.platform.engine.UniqueId;
3737
import org.junit.platform.engine.reporting.ReportEntry;
3838
import org.junit.platform.engine.support.hierarchical.DemoHierarchicalTestEngine;
39-
import org.junit.platform.reporting.process.ProcessResult;
40-
import org.junit.platform.reporting.process.ProcessStarter;
39+
import org.junit.platform.tests.process.ProcessResult;
40+
import org.junit.platform.tests.process.ProcessStarter;
4141
import org.opentest4j.reporting.schema.Namespace;
4242
import org.opentest4j.reporting.tooling.core.validator.DefaultValidator;
4343
import org.opentest4j.reporting.tooling.core.validator.ValidationResult;

platform-tooling-support-tests/platform-tooling-support-tests.gradle.kts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ dependencies {
4747
implementation(libs.commons.io) {
4848
because("moving/deleting directory trees")
4949
}
50-
implementation(testFixtures(projects.junitPlatformReporting)) {
51-
because("it uses ProcessStarter")
50+
implementation(projects.platformTests) {
51+
capabilities {
52+
requireFeature("process-starter")
53+
}
54+
}
55+
implementation(projects.junitJupiterApi) {
56+
because("it uses the OS enum to support Windows")
5257
}
5358

5459
testImplementation(libs.archunit) {

platform-tooling-support-tests/src/main/java/platform/tooling/support/ProcessStarters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import java.util.Optional;
1515

1616
import org.junit.jupiter.api.condition.OS;
17-
import org.junit.platform.reporting.process.ProcessStarter;
17+
import org.junit.platform.tests.process.ProcessStarter;
1818
import org.opentest4j.TestAbortedException;
1919

2020
public class ProcessStarters {

0 commit comments

Comments
 (0)