Skip to content

Commit

Permalink
8280275: JUnit5 tests using Assumptions API fail to compile in some c…
Browse files Browse the repository at this point in the history
…ases

Backport-of: 94807b6
  • Loading branch information
kevinrushforth committed May 10, 2022
1 parent be207dd commit c8eafd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -1951,13 +1951,13 @@ allprojects {
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"
testImplementation group: "org.opentest4j", name: "opentest4j", version: "1.2.0"
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 Down
5 changes: 4 additions & 1 deletion modules/javafx.base/src/test/java/test/JUnit5Test.java
Expand Up @@ -26,14 +26,17 @@
package test;

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

import org.junit.jupiter.api.Test;

public class JUnit5Test {

@Test
void junit5ShouldWork() {
System.err.println("JUnit 5 test working!");
assumeTrue(this != null);

assertNotNull(this);
System.err.println("JUnit 5 test working!");
}
}

1 comment on commit c8eafd8

@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.