Skip to content

Commit 692b606

Browse files
committed
Test migration support and runner against 4.12 and 4.13
1 parent 52bf072 commit 692b606

File tree

4 files changed

+39
-40
lines changed

4 files changed

+39
-40
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
val junit_4_12 by configurations.creating {
6+
extendsFrom(configurations.testRuntimeClasspath.get())
7+
}
8+
9+
dependencies {
10+
constraints {
11+
api("junit:junit:[${Versions.junit4Min},)") {
12+
version {
13+
prefer(Versions.junit4)
14+
}
15+
}
16+
}
17+
junit_4_12("junit:junit") {
18+
version {
19+
strictly("4.12")
20+
}
21+
}
22+
testRuntimeOnly("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:4.12_1")
23+
}
24+
25+
tasks {
26+
val test_4_12 by registering(Test::class) {
27+
classpath -= configurations.testRuntimeClasspath.get()
28+
classpath += junit_4_12
29+
}
30+
check {
31+
dependsOn(test_4_12)
32+
}
33+
}

junit-jupiter-migrationsupport/junit-jupiter-migrationsupport.gradle.kts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import aQute.bnd.gradle.BundleTaskConvention;
22

33
plugins {
44
`java-library-conventions`
5+
`junit4-compatibility`
56
}
67

78
apply(from = "$rootDir/gradle/testing.gradle.kts")
@@ -11,11 +12,7 @@ description = "JUnit Jupiter Migration Support"
1112
dependencies {
1213
api(platform(project(":junit-bom")))
1314

14-
api("junit:junit:[${Versions.junit4Min},)") {
15-
version {
16-
prefer(Versions.junit4)
17-
}
18-
}
15+
api("junit:junit")
1916
api("org.apiguardian:apiguardian-api:${Versions.apiGuardian}")
2017

2118
api(project(":junit-jupiter-api"))
@@ -24,8 +21,6 @@ dependencies {
2421
testImplementation(project(":junit-platform-launcher"))
2522
testImplementation(project(":junit-platform-runner"))
2623
testImplementation(project(":junit-platform-testkit"))
27-
28-
testRuntimeOnly("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:4.12_1")
2924
}
3025

3126
tasks.jar {

junit-platform-runner/junit-platform-runner.gradle.kts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import aQute.bnd.gradle.BundleTaskConvention;
22

33
plugins {
44
`java-library-conventions`
5+
`junit4-compatibility`
56
}
67

78
apply(from = "$rootDir/gradle/testing.gradle.kts")
@@ -11,17 +12,12 @@ description = "JUnit Platform Runner"
1112
dependencies {
1213
api(platform(project(":junit-bom")))
1314

14-
api("junit:junit:[${Versions.junit4Min},)") {
15-
version {
16-
prefer(Versions.junit4)
17-
}
18-
}
15+
api("junit:junit")
1916
api("org.apiguardian:apiguardian-api:${Versions.apiGuardian}")
2017

2118
api(project(":junit-platform-launcher"))
2219
api(project(":junit-platform-suite-api"))
2320

24-
testRuntimeOnly("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:4.12_1")
2521
testImplementation(testFixtures(project(":junit-platform-engine")))
2622
testImplementation(testFixtures(project(":junit-platform-launcher")))
2723
}

junit-vintage-engine/junit-vintage-engine.gradle.kts

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,23 @@ import aQute.bnd.gradle.BundleTaskConvention;
22

33
plugins {
44
`java-library-conventions`
5+
`junit4-compatibility`
56
}
67

78
apply(from = "$rootDir/gradle/testing.gradle.kts")
89

910
description = "JUnit Vintage Engine"
1011

11-
val junit_4_12 by configurations.creating {
12-
extendsFrom(configurations.testRuntimeClasspath.get())
13-
}
14-
1512
dependencies {
1613
api(platform(project(":junit-bom")))
1714

1815
api("org.apiguardian:apiguardian-api:${Versions.apiGuardian}")
1916
api(project(":junit-platform-engine"))
20-
api("junit:junit:[${Versions.junit4Min},)") {
21-
version {
22-
prefer(Versions.junit4)
23-
}
24-
}
17+
api("junit:junit")
2518

2619
testImplementation(project(":junit-platform-launcher"))
2720
testImplementation(project(":junit-platform-runner"))
2821
testImplementation(project(":junit-platform-testkit"))
29-
30-
junit_4_12("junit:junit") {
31-
version {
32-
strictly("4.12")
33-
}
34-
}
35-
36-
testRuntimeOnly("org.apache.servicemix.bundles:org.apache.servicemix.bundles.junit:4.12_1")
37-
}
38-
39-
tasks {
40-
val test_4_12 by registering(Test::class) {
41-
classpath -= configurations.testRuntimeClasspath.get()
42-
classpath += junit_4_12
43-
}
44-
check {
45-
dependsOn(test_4_12)
46-
}
4722
}
4823

4924
tasks.jar {

0 commit comments

Comments
 (0)