Skip to content

Commit ff6e8d5

Browse files
hjohnkevinrushforth
authored andcommitted
8274274: Update JUnit to version 5.8.1
Reviewed-by: kcr, mstrauss, jvos
1 parent 4f9b047 commit ff6e8d5

File tree

5 files changed

+158
-10
lines changed

5 files changed

+158
-10
lines changed

build.gradle

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,7 +1946,18 @@ allprojects {
19461946
// By default all of our projects require junit for testing so we can just
19471947
// setup this dependency here.
19481948
dependencies {
1949-
testImplementation group: "junit", name: "junit", version: "4.8.2"
1949+
testImplementation group: "junit", name: "junit", version: "4.13.2"
1950+
testImplementation group: "org.hamcrest", name: "hamcrest-core", version: "1.3"
1951+
testImplementation group: "org.junit.jupiter", name: "junit-jupiter", version: "5.8.1"
1952+
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.8.1"
1953+
testRuntimeOnly group: "org.apiguardian", name: "apiguardian-api", version: "1.1.2"
1954+
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.8.1"
1955+
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-params", version: "5.8.1"
1956+
testRuntimeOnly group: "org.junit.platform", name: "junit-platform-commons", version: "1.8.1"
1957+
testRuntimeOnly group: "org.junit.platform", name: "junit-platform-engine", version: "1.8.1"
1958+
testRuntimeOnly group: "org.junit.vintage", name: "junit-vintage-engine", version: "5.8.1"
1959+
testRuntimeOnly group: "org.opentest4j", name: "opentest4j", version: "1.2.0"
1960+
19501961
if (BUILD_CLOSED && DO_JCOV) {
19511962
testImplementation name: "jcov"
19521963
}
@@ -1961,6 +1972,8 @@ allprojects {
19611972
// Java 7 but when we switch to 8 this will be needed, and probably again when
19621973
// we start building with Java 9.
19631974
test {
1975+
useJUnitPlatform();
1976+
19641977
executable = JAVA;
19651978
enableAssertions = true;
19661979
testLogging.exceptionFormat = "full";
@@ -2035,7 +2048,6 @@ project(":base") {
20352048
}
20362049

20372050
dependencies {
2038-
testImplementation group: "junit", name: "junit", version: "4.8.2"
20392051
testImplementation sourceSets.main.output
20402052
testImplementation sourceSets.shims.output
20412053
}
@@ -2111,8 +2123,6 @@ project(":graphics") {
21112123
}
21122124

21132125
dependencies {
2114-
stubImplementation group: "junit", name: "junit", version: "4.8.2"
2115-
21162126
antlr group: "org.antlr", name: "antlr4", version: "4.7.2", classifier: "complete"
21172127
testImplementation project(":base").sourceSets.test.output
21182128
implementation project(':base')

buildSrc/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ repositories {
7474
}
7575

7676
dependencies {
77-
testImplementation group: "junit", name: "junit", version: "4.8.2"
77+
testImplementation group: "junit", name: "junit", version: "4.13.2"
78+
testImplementation group: "org.hamcrest", name: "hamcrest-core", version: "1.3"
7879
}
7980

8081
// At the moment the ASM library shipped with Gradle that is used to

gradle/verification-metadata.xml

Lines changed: 98 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@
111111
<sha256 value="c80313e6c26c0b9e0c241504718e2d8bbc2798b73429933adf03fdc6d84f0e70" origin="Generated by Gradle"/>
112112
</artifact>
113113
</component>
114-
<component group="junit" name="junit" version="4.8.2">
115-
<artifact name="junit-4.8.2.jar">
116-
<sha256 value="a2aa2c3bb2b72da76c3e6a71531f1eefdc350494819baf2b1d80d7146e020f9e" origin="Generated by Gradle"/>
114+
<component group="junit" name="junit" version="4.13.2">
115+
<artifact name="junit-4.13.2.jar">
116+
<sha256 value="8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3" origin="Generated by Gradle"/>
117117
</artifact>
118-
<artifact name="junit-4.8.2.pom">
119-
<sha256 value="df39d34d1f5830b2d8a92790c66b5798358b0b3e01452dc85b3722a881ad923e" origin="Generated by Gradle"/>
118+
<artifact name="junit-4.13.2.pom">
119+
<sha256 value="569b6977ee4603c965c1c46c3058fa6e969291b0160eb6964dd092cd89eadd94" origin="Generated by Gradle"/>
120120
</artifact>
121121
</component>
122122
<component group="net.java" name="jvnet-parent" version="3">
@@ -229,6 +229,14 @@
229229
<sha256 value="3a2837580ca76af36af7dfe2dc1d334fc6ff5f26d10f24899db7770ad7cfd9fe" origin="Generated by Gradle"/>
230230
</artifact>
231231
</component>
232+
<component group="org.apiguardian" name="apiguardian-api" version="1.1.2">
233+
<artifact name="apiguardian-api-1.1.2.jar">
234+
<sha256 value="b509448ac506d607319f182537f0b35d71007582ec741832a1f111e5b5b70b38" origin="Generated by Gradle"/>
235+
</artifact>
236+
<artifact name="apiguardian-api-1.1.2.module">
237+
<sha256 value="e08028131375b357d1d28734e9a4fb4216da84b240641cb3ef7e7c7d628223fc" origin="Generated by Gradle"/>
238+
</artifact>
239+
</component>
232240
<component group="org.glassfish" name="javax.json" version="1.0.4">
233241
<artifact name="javax.json-1.0.4.jar">
234242
<sha256 value="0e1dec40a1ede965941251eda968aeee052cc4f50378bc316cc48e8159bdbeb4" origin="Generated by Gradle"/>
@@ -242,6 +250,91 @@
242250
<sha256 value="6d7c68423115f921718d944f859924b4c685217ec03a49f70455a8b2caa972e6" origin="Generated by Gradle"/>
243251
</artifact>
244252
</component>
253+
<component group="org.hamcrest" name="hamcrest-core" version="1.3">
254+
<artifact name="hamcrest-core-1.3.jar">
255+
<sha256 value="66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9" origin="Generated by Gradle"/>
256+
</artifact>
257+
<artifact name="hamcrest-core-1.3.pom">
258+
<sha256 value="fde386a7905173a1b103de6ab820727584b50d0e32282e2797787c20a64ffa93" origin="Generated by Gradle"/>
259+
</artifact>
260+
</component>
261+
<component group="org.hamcrest" name="hamcrest-parent" version="1.3">
262+
<artifact name="hamcrest-parent-1.3.pom">
263+
<sha256 value="6d535f94efb663bdb682c9f27a50335394688009642ba7a9677504bc1be4129b" origin="Generated by Gradle"/>
264+
</artifact>
265+
</component>
266+
<component group="org.junit" name="junit-bom" version="5.8.1">
267+
<artifact name="junit-bom-5.8.1.pom">
268+
<sha256 value="ef7dc47f8e4a16864f4779728e87ed78539819e4fb892768a9da6b8ef903f863" origin="Generated by Gradle"/>
269+
</artifact>
270+
<artifact name="junit-bom-5.8.1.module">
271+
<sha256 value="6b82cba52a134b13c1982f0cf9622c6d485371d40b989246f3124e3b0a5b1854" origin="Generated by Gradle"/>
272+
</artifact>
273+
</component>
274+
<component group="org.junit.jupiter" name="junit-jupiter" version="5.8.1">
275+
<artifact name="junit-jupiter-5.8.1.jar">
276+
<sha256 value="8f1049ee24b34a10b60cd810048099f781c2658cde2181e831496ab30a982985" origin="Generated by Gradle"/>
277+
</artifact>
278+
<artifact name="junit-jupiter-5.8.1.module">
279+
<sha256 value="2e34ba4c858c38cd0a365afffecc932a7196ce9385e2eb5405942e581c15ff5c" origin="Generated by Gradle"/>
280+
</artifact>
281+
</component>
282+
<component group="org.junit.jupiter" name="junit-jupiter-api" version="5.8.1">
283+
<artifact name="junit-jupiter-api-5.8.1.jar">
284+
<sha256 value="ce3374a7efba605e2d2b69a3fef90134032bab3ecc3ed8579a4871b1c2c4729c" origin="Generated by Gradle"/>
285+
</artifact>
286+
<artifact name="junit-jupiter-api-5.8.1.module">
287+
<sha256 value="0d69dbc236b7dcaab4ca7369aa560e9b0a9bbef7f958882ffb48533cbba7c09d" origin="Generated by Gradle"/>
288+
</artifact>
289+
</component>
290+
<component group="org.junit.jupiter" name="junit-jupiter-engine" version="5.8.1">
291+
<artifact name="junit-jupiter-engine-5.8.1.jar">
292+
<sha256 value="4689bc902255a19fe98277683ba3231c094d107c54c8d35f2b6f9c97d226418e" origin="Generated by Gradle"/>
293+
</artifact>
294+
<artifact name="junit-jupiter-engine-5.8.1.module">
295+
<sha256 value="68790fec33f97b0ec840cf47ac40ee0c72e056f122ca0f3c6646743349937699" origin="Generated by Gradle"/>
296+
</artifact>
297+
</component>
298+
<component group="org.junit.jupiter" name="junit-jupiter-params" version="5.8.1">
299+
<artifact name="junit-jupiter-params-5.8.1.jar">
300+
<sha256 value="389b8d13a8d8872fcbd4f0eba7b2c46afc628419f9a1b2a3a9f93241a06a7218" origin="Generated by Gradle"/>
301+
</artifact>
302+
<artifact name="junit-jupiter-params-5.8.1.module">
303+
<sha256 value="124d603c6d8033366d8ca471636b446e38b9cc1bd010f329542358187afa865e" origin="Generated by Gradle"/>
304+
</artifact>
305+
</component>
306+
<component group="org.junit.platform" name="junit-platform-commons" version="1.8.1">
307+
<artifact name="junit-platform-commons-1.8.1.jar">
308+
<sha256 value="fa4fa68c8bd54dd0cb49c3fcbe9b2e42f4da6bedbe7e7ccf2a05f1a1e609b593" origin="Generated by Gradle"/>
309+
</artifact>
310+
<artifact name="junit-platform-commons-1.8.1.module">
311+
<sha256 value="698fd0541acb7effc6659848fd0c7dd5010a49f15f0c1cba43e535807f90f66b" origin="Generated by Gradle"/>
312+
</artifact>
313+
</component>
314+
<component group="org.junit.platform" name="junit-platform-engine" version="1.8.1">
315+
<artifact name="junit-platform-engine-1.8.1.jar">
316+
<sha256 value="702868ed7e86b9b4672ede0f1e185e905baca9afab57746a7c650be3c7bca047" origin="Generated by Gradle"/>
317+
</artifact>
318+
<artifact name="junit-platform-engine-1.8.1.module">
319+
<sha256 value="d9f420a64539a3edf60f80df0c6fd722b750725744c79ca40f7d25ae56ca4ba4" origin="Generated by Gradle"/>
320+
</artifact>
321+
</component>
322+
<component group="org.junit.vintage" name="junit-vintage-engine" version="5.8.1">
323+
<artifact name="junit-vintage-engine-5.8.1.jar">
324+
<sha256 value="176b53cd1bdbf9233e96c8b0c7a9e5b864282fbbdeba43b5ceafdedb29a49156" origin="Generated by Gradle"/>
325+
</artifact>
326+
<artifact name="junit-vintage-engine-5.8.1.module">
327+
<sha256 value="9ce9fa2e4ee6a740d610102530462a71ce0fa9d2f1418522e4b2bdb6072f679a" origin="Generated by Gradle"/>
328+
</artifact>
329+
</component>
330+
<component group="org.opentest4j" name="opentest4j" version="1.2.0">
331+
<artifact name="opentest4j-1.2.0.jar">
332+
<sha256 value="58812de60898d976fb81ef3b62da05c6604c18fd4a249f5044282479fc286af2" origin="Generated by Gradle"/>
333+
</artifact>
334+
<artifact name="opentest4j-1.2.0.pom">
335+
<sha256 value="a96e671816c1ff8803bdec74c9241f025bdfb277da5d2b4ee02266405936f994" origin="Generated by Gradle"/>
336+
</artifact>
337+
</component>
245338
<component group="org.sonatype.oss" name="oss-parent" version="7">
246339
<artifact name="oss-parent-7.pom">
247340
<sha256 value="b51f8867c92b6a722499557fc3a1fdea77bdf9ef574722fe90ce436a29559454" origin="Generated by Gradle"/>

modules/javafx.base/.classpath

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
<attribute name="test" value="true"/>
2121
</attributes>
2222
</classpathentry>
23+
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
24+
<attributes>
25+
<attribute name="test" value="true"/>
26+
</attributes>
27+
</classpathentry>
2328
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
2429
<attributes>
2530
<attribute name="module" value="true"/>
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
package test;
27+
28+
import static org.junit.jupiter.api.Assertions.assertNotNull;
29+
30+
import org.junit.jupiter.api.Test;
31+
32+
public class JUnit5Test {
33+
34+
@Test
35+
void junit5ShouldWork() {
36+
System.err.println("JUnit 5 test working!");
37+
assertNotNull(this);
38+
}
39+
}

0 commit comments

Comments
 (0)