Skip to content

Commit

Permalink
8274274: Update JUnit to version 5.8.1
Browse files Browse the repository at this point in the history
Backport-of: ff6e8d5
  • Loading branch information
kevinrushforth committed May 10, 2022
1 parent 62ab00b commit 2ab0e82
Show file tree
Hide file tree
Showing 5 changed files with 158 additions and 10 deletions.
18 changes: 14 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,18 @@ allprojects {
// By default all of our projects require junit for testing so we can just
// setup this dependency here.
dependencies {
testImplementation group: "junit", name: "junit", version: "4.8.2"
testImplementation group: "junit", name: "junit", version: "4.13.2"
testImplementation group: "org.hamcrest", name: "hamcrest-core", version: "1.3"
testImplementation group: "org.junit.jupiter", name: "junit-jupiter", version: "5.8.1"
testImplementation group: "org.junit.jupiter", name: "junit-jupiter-api", version: "5.8.1"
testRuntimeOnly group: "org.apiguardian", name: "apiguardian-api", version: "1.1.2"
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-engine", version: "5.8.1"
testRuntimeOnly group: "org.junit.jupiter", name: "junit-jupiter-params", version: "5.8.1"
testRuntimeOnly group: "org.junit.platform", name: "junit-platform-commons", version: "1.8.1"
testRuntimeOnly group: "org.junit.platform", name: "junit-platform-engine", version: "1.8.1"
testRuntimeOnly group: "org.junit.vintage", name: "junit-vintage-engine", version: "5.8.1"
testRuntimeOnly group: "org.opentest4j", name: "opentest4j", version: "1.2.0"

if (BUILD_CLOSED && DO_JCOV) {
testImplementation name: "jcov"
}
Expand All @@ -1960,6 +1971,8 @@ allprojects {
// Java 7 but when we switch to 8 this will be needed, and probably again when
// we start building with Java 9.
test {
useJUnitPlatform();

executable = JAVA;
enableAssertions = true;
testLogging.exceptionFormat = "full";
Expand Down Expand Up @@ -2034,7 +2047,6 @@ project(":base") {
}

dependencies {
testImplementation group: "junit", name: "junit", version: "4.8.2"
testImplementation sourceSets.main.output
testImplementation sourceSets.shims.output
}
Expand Down Expand Up @@ -2110,8 +2122,6 @@ project(":graphics") {
}

dependencies {
stubImplementation group: "junit", name: "junit", version: "4.8.2"

antlr group: "org.antlr", name: "antlr4", version: "4.7.2", classifier: "complete"
testImplementation project(":base").sourceSets.test.output
implementation project(':base')
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ repositories {
}

dependencies {
testImplementation group: "junit", name: "junit", version: "4.8.2"
testImplementation group: "junit", name: "junit", version: "4.13.2"
testImplementation group: "org.hamcrest", name: "hamcrest-core", version: "1.3"
}

// At the moment the ASM library shipped with Gradle that is used to
Expand Down
103 changes: 98 additions & 5 deletions gradle/verification-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@
<sha256 value="c80313e6c26c0b9e0c241504718e2d8bbc2798b73429933adf03fdc6d84f0e70" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="junit" name="junit" version="4.8.2">
<artifact name="junit-4.8.2.jar">
<sha256 value="a2aa2c3bb2b72da76c3e6a71531f1eefdc350494819baf2b1d80d7146e020f9e" origin="Generated by Gradle"/>
<component group="junit" name="junit" version="4.13.2">
<artifact name="junit-4.13.2.jar">
<sha256 value="8e495b634469d64fb8acfa3495a065cbacc8a0fff55ce1e31007be4c16dc57d3" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-4.8.2.pom">
<sha256 value="df39d34d1f5830b2d8a92790c66b5798358b0b3e01452dc85b3722a881ad923e" origin="Generated by Gradle"/>
<artifact name="junit-4.13.2.pom">
<sha256 value="569b6977ee4603c965c1c46c3058fa6e969291b0160eb6964dd092cd89eadd94" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="net.java" name="jvnet-parent" version="3">
Expand Down Expand Up @@ -229,6 +229,14 @@
<sha256 value="3a2837580ca76af36af7dfe2dc1d334fc6ff5f26d10f24899db7770ad7cfd9fe" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.apiguardian" name="apiguardian-api" version="1.1.2">
<artifact name="apiguardian-api-1.1.2.jar">
<sha256 value="b509448ac506d607319f182537f0b35d71007582ec741832a1f111e5b5b70b38" origin="Generated by Gradle"/>
</artifact>
<artifact name="apiguardian-api-1.1.2.module">
<sha256 value="e08028131375b357d1d28734e9a4fb4216da84b240641cb3ef7e7c7d628223fc" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.glassfish" name="javax.json" version="1.0.4">
<artifact name="javax.json-1.0.4.jar">
<sha256 value="0e1dec40a1ede965941251eda968aeee052cc4f50378bc316cc48e8159bdbeb4" origin="Generated by Gradle"/>
Expand All @@ -242,6 +250,91 @@
<sha256 value="6d7c68423115f921718d944f859924b4c685217ec03a49f70455a8b2caa972e6" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hamcrest" name="hamcrest-core" version="1.3">
<artifact name="hamcrest-core-1.3.jar">
<sha256 value="66fdef91e9739348df7a096aa384a5685f4e875584cce89386a7a47251c4d8e9" origin="Generated by Gradle"/>
</artifact>
<artifact name="hamcrest-core-1.3.pom">
<sha256 value="fde386a7905173a1b103de6ab820727584b50d0e32282e2797787c20a64ffa93" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.hamcrest" name="hamcrest-parent" version="1.3">
<artifact name="hamcrest-parent-1.3.pom">
<sha256 value="6d535f94efb663bdb682c9f27a50335394688009642ba7a9677504bc1be4129b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit" name="junit-bom" version="5.8.1">
<artifact name="junit-bom-5.8.1.pom">
<sha256 value="ef7dc47f8e4a16864f4779728e87ed78539819e4fb892768a9da6b8ef903f863" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-bom-5.8.1.module">
<sha256 value="6b82cba52a134b13c1982f0cf9622c6d485371d40b989246f3124e3b0a5b1854" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.jupiter" name="junit-jupiter" version="5.8.1">
<artifact name="junit-jupiter-5.8.1.jar">
<sha256 value="8f1049ee24b34a10b60cd810048099f781c2658cde2181e831496ab30a982985" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-jupiter-5.8.1.module">
<sha256 value="2e34ba4c858c38cd0a365afffecc932a7196ce9385e2eb5405942e581c15ff5c" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.jupiter" name="junit-jupiter-api" version="5.8.1">
<artifact name="junit-jupiter-api-5.8.1.jar">
<sha256 value="ce3374a7efba605e2d2b69a3fef90134032bab3ecc3ed8579a4871b1c2c4729c" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-jupiter-api-5.8.1.module">
<sha256 value="0d69dbc236b7dcaab4ca7369aa560e9b0a9bbef7f958882ffb48533cbba7c09d" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.jupiter" name="junit-jupiter-engine" version="5.8.1">
<artifact name="junit-jupiter-engine-5.8.1.jar">
<sha256 value="4689bc902255a19fe98277683ba3231c094d107c54c8d35f2b6f9c97d226418e" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-jupiter-engine-5.8.1.module">
<sha256 value="68790fec33f97b0ec840cf47ac40ee0c72e056f122ca0f3c6646743349937699" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.jupiter" name="junit-jupiter-params" version="5.8.1">
<artifact name="junit-jupiter-params-5.8.1.jar">
<sha256 value="389b8d13a8d8872fcbd4f0eba7b2c46afc628419f9a1b2a3a9f93241a06a7218" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-jupiter-params-5.8.1.module">
<sha256 value="124d603c6d8033366d8ca471636b446e38b9cc1bd010f329542358187afa865e" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.platform" name="junit-platform-commons" version="1.8.1">
<artifact name="junit-platform-commons-1.8.1.jar">
<sha256 value="fa4fa68c8bd54dd0cb49c3fcbe9b2e42f4da6bedbe7e7ccf2a05f1a1e609b593" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-platform-commons-1.8.1.module">
<sha256 value="698fd0541acb7effc6659848fd0c7dd5010a49f15f0c1cba43e535807f90f66b" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.platform" name="junit-platform-engine" version="1.8.1">
<artifact name="junit-platform-engine-1.8.1.jar">
<sha256 value="702868ed7e86b9b4672ede0f1e185e905baca9afab57746a7c650be3c7bca047" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-platform-engine-1.8.1.module">
<sha256 value="d9f420a64539a3edf60f80df0c6fd722b750725744c79ca40f7d25ae56ca4ba4" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.junit.vintage" name="junit-vintage-engine" version="5.8.1">
<artifact name="junit-vintage-engine-5.8.1.jar">
<sha256 value="176b53cd1bdbf9233e96c8b0c7a9e5b864282fbbdeba43b5ceafdedb29a49156" origin="Generated by Gradle"/>
</artifact>
<artifact name="junit-vintage-engine-5.8.1.module">
<sha256 value="9ce9fa2e4ee6a740d610102530462a71ce0fa9d2f1418522e4b2bdb6072f679a" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.opentest4j" name="opentest4j" version="1.2.0">
<artifact name="opentest4j-1.2.0.jar">
<sha256 value="58812de60898d976fb81ef3b62da05c6604c18fd4a249f5044282479fc286af2" origin="Generated by Gradle"/>
</artifact>
<artifact name="opentest4j-1.2.0.pom">
<sha256 value="a96e671816c1ff8803bdec74c9241f025bdfb277da5d2b4ee02266405936f994" origin="Generated by Gradle"/>
</artifact>
</component>
<component group="org.sonatype.oss" name="oss-parent" version="7">
<artifact name="oss-parent-7.pom">
<sha256 value="b51f8867c92b6a722499557fc3a1fdea77bdf9ef574722fe90ce436a29559454" origin="Generated by Gradle"/>
Expand Down
5 changes: 5 additions & 0 deletions modules/javafx.base/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
Expand Down
39 changes: 39 additions & 0 deletions modules/javafx.base/src/test/java/test/JUnit5Test.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

package test;

import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.Test;

public class JUnit5Test {

@Test
void junit5ShouldWork() {
System.err.println("JUnit 5 test working!");
assertNotNull(this);
}
}

1 comment on commit 2ab0e82

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.