diff --git a/.travis.yml b/.travis.yml index 7ffc2210d6eb..cfefd290ec33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,21 @@ language: java + sudo: false dist: trusty jdk: - - oraclejdk8 + - oraclejdk9 addons: apt: packages: - - oracle-java8-installer + - oracle-java9-installer # Display Gradle version instead of letting Travis execute './gradlew assemble' by default install: +# With jdk-9-b163 available on Travis, use export JDK_JAVA_OPTIONS='--permit-illegal-access' + - export JDK_JAVA_OPTIONS='--add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED' - ./gradlew -version script: - - ./gradlew check --scan + - ./gradlew -Dorg.gradle.parallel=true check --scan diff --git a/build.gradle b/build.gradle index 7cb83004e9bf..6629f380923e 100644 --- a/build.gradle +++ b/build.gradle @@ -95,6 +95,7 @@ allprojects { subproj -> // mavenLocal() mavenCentral() maven { url 'https://oss.sonatype.org/content/repositories/snapshots' } + maven { url "https://jitpack.io" } } tasks.withType(Test) { task -> @@ -127,7 +128,7 @@ allprojects { subproj -> '-Xlint:unchecked', '-Xlint:varargs', '-Xlint:-options', - '-Werror' + // '-Werror' // allow warnings with jdk-9 ] // See: http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCJCABJ diff --git a/junit-jupiter-engine/junit-jupiter-engine.gradle b/junit-jupiter-engine/junit-jupiter-engine.gradle index 833cd0aaa18d..13781f77701f 100644 --- a/junit-jupiter-engine/junit-jupiter-engine.gradle +++ b/junit-jupiter-engine/junit-jupiter-engine.gradle @@ -24,7 +24,7 @@ dependencies { testImplementation(project(':junit-platform-launcher')) testImplementation(project(':junit-platform-runner')) testImplementation(project(path: ':junit-platform-engine', configuration: 'testArtifacts')) - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") testImplementation("org.mockito:mockito-core:${mockitoVersion}") // Include junit-platform-console so that the JUnit Gradle plugin diff --git a/junit-jupiter-migration-support/junit-jupiter-migration-support.gradle b/junit-jupiter-migration-support/junit-jupiter-migration-support.gradle index a5db1b13182d..8c8940d249ed 100644 --- a/junit-jupiter-migration-support/junit-jupiter-migration-support.gradle +++ b/junit-jupiter-migration-support/junit-jupiter-migration-support.gradle @@ -25,7 +25,7 @@ dependencies { testImplementation(project(':junit-platform-launcher')) testImplementation(project(':junit-platform-runner')) testImplementation(project(path: ':junit-platform-engine', configuration: 'testArtifacts')) - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") testImplementation("org.mockito:mockito-core:${mockitoVersion}") // Include junit-platform-console so that the JUnit Gradle plugin diff --git a/junit-jupiter-params/junit-jupiter-params.gradle b/junit-jupiter-params/junit-jupiter-params.gradle index 597b82206efb..684ce37cdeec 100644 --- a/junit-jupiter-params/junit-jupiter-params.gradle +++ b/junit-jupiter-params/junit-jupiter-params.gradle @@ -25,7 +25,7 @@ dependencies { shadow('com.univocity:univocity-parsers:2.4.1') - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") testImplementation("org.mockito:mockito-core:${mockitoVersion}") testImplementation(project(path: ':junit-platform-engine', configuration: 'testArtifacts')) testImplementation(project(':junit-jupiter-engine')) diff --git a/junit-platform-engine/junit-platform-engine.gradle b/junit-platform-engine/junit-platform-engine.gradle index 788c02a05752..65739d45b7d4 100644 --- a/junit-platform-engine/junit-platform-engine.gradle +++ b/junit-platform-engine/junit-platform-engine.gradle @@ -15,5 +15,5 @@ dependencies { api(project(':junit-platform-commons')) api("org.opentest4j:opentest4j:${ota4jVersion}") - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") } diff --git a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java index d4b0934d1fdf..3ef4e15ff207 100644 --- a/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java +++ b/junit-platform-launcher/src/main/java/org/junit/platform/launcher/core/ServiceLoaderTestEngineRegistry.java @@ -13,6 +13,8 @@ import java.util.ArrayList; import java.util.List; import java.util.ServiceLoader; +import java.util.Set; +import java.util.TreeSet; import java.util.logging.Logger; import org.junit.platform.commons.util.ReflectionUtils; @@ -29,7 +31,20 @@ public Iterable loadTestEngines() { Iterable testEngines = ServiceLoader.load(TestEngine.class, ReflectionUtils.getDefaultClassLoader()); LOG.config(() -> createDiscoveredTestEnginesMessage(testEngines)); - return testEngines; + + // filter duplicates, jdk-9 bug: https://bugs.openjdk.java.net/browse/JDK-8177139 + List pruned = new ArrayList<>(); + Set set = new TreeSet<>(); + for (TestEngine engine : testEngines) { + String className = engine.getClass().getName(); + if (set.contains(className)) { + LOG.warning("Test engine already loaded: " + engine); + continue; + } + set.add(className); + pruned.add(engine); + } + return pruned; } private String createDiscoveredTestEnginesMessage(Iterable testEngines) { @@ -48,6 +63,8 @@ private List computeAttributes(TestEngine engine) { engine.getGroupId().ifPresent(groupId -> attributes.add("group ID: " + groupId)); engine.getArtifactId().ifPresent(artifactId -> attributes.add("artifact ID: " + artifactId)); engine.getVersion().ifPresent(version -> attributes.add("version: " + version)); + // TODO Include JAR (module) location of the engine? + // attributes.add("location: " + engine.getClass().getProtectionDomain().getCodeSource().getLocation()); return attributes; } diff --git a/junit-platform-surefire-provider/junit-platform-surefire-provider.gradle b/junit-platform-surefire-provider/junit-platform-surefire-provider.gradle index bd34da0b5963..cf20a515ff47 100644 --- a/junit-platform-surefire-provider/junit-platform-surefire-provider.gradle +++ b/junit-platform-surefire-provider/junit-platform-surefire-provider.gradle @@ -19,7 +19,7 @@ dependencies { testImplementation(project(':junit-platform-runner')) testImplementation(project(':junit-jupiter-engine')) testImplementation("org.mockito:mockito-core:${mockitoVersion}") - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") // Include junit-platform-console so that the JUnit Gradle plugin // uses the local version of the ConsoleLauncher. diff --git a/junit-vintage-engine/junit-vintage-engine.gradle b/junit-vintage-engine/junit-vintage-engine.gradle index cb34fabf71b2..57190432f458 100644 --- a/junit-vintage-engine/junit-vintage-engine.gradle +++ b/junit-vintage-engine/junit-vintage-engine.gradle @@ -25,7 +25,7 @@ dependencies { testImplementation(project(':junit-jupiter-api')) testImplementation(project(':junit-platform-runner')) testImplementation(project(path: ':junit-platform-engine', configuration: 'testArtifacts')) - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") testImplementation("org.mockito:mockito-core:${mockitoVersion}") // Include junit-platform-console so that the JUnit Gradle plugin diff --git a/platform-tests/platform-tests.gradle b/platform-tests/platform-tests.gradle index 2904c4fe09e4..43948235ec78 100644 --- a/platform-tests/platform-tests.gradle +++ b/platform-tests/platform-tests.gradle @@ -21,7 +21,7 @@ dependencies { testImplementation(project(':junit-jupiter-api')) testImplementation(project(':junit-platform-runner')) testImplementation(project(path: ':junit-platform-engine', configuration: 'testArtifacts')) - testImplementation("org.assertj:assertj-core:${assertJVersion}") + testImplementation("com.github.joel-costigliola:assertj-core:master-SNAPSHOT") testImplementation("org.mockito:mockito-core:${mockitoVersion}") // --- Test run-time dependencies ---------------------------------------------