From dda761ffc2fc85cac5729e3973e53583243682d5 Mon Sep 17 00:00:00 2001 From: Sebastian Sdorra Date: Fri, 18 Dec 2020 14:23:36 +0100 Subject: [PATCH] Fix unit tests on Java 11 (#1483) The unit test I18nServlet and MultiParentClassLoaderTest are failing on Java 11. This is because they mock ClassLoaders which cause a jvm error. The following tickets describe the problem in more detail: - https://bugs.openjdk.java.net/browse/JDK-8254969 - https://github.com/mockito/mockito/issues/2043 - https://github.com/mockito/mockito/issues/1696 --- Jenkinsfile | 2 +- build/Dockerfile | 2 +- build/Makefile | 2 +- pom.xml | 2 +- .../java/sonia/scm/web/i18n/I18nServlet.java | 1 - .../plugin/MultiParentClassLoaderTest.java | 195 +++++------ .../sonia/scm/web/i18n/I18nServletTest.java | 308 ++++++++++-------- 7 files changed, 282 insertions(+), 230 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 362fc1ea6a..9acca06822 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -204,7 +204,7 @@ String developmentBranch String mainBranch Maven setupMavenBuild() { - MavenWrapperInDocker mvn = new MavenWrapperInDocker(this, "scmmanager/java-build:8u275-b01") + MavenWrapperInDocker mvn = new MavenWrapperInDocker(this, "scmmanager/java-build:11.0.9_11.1") mvn.enableDockerHost = true // disable logging durring the build diff --git a/build/Dockerfile b/build/Dockerfile index ab9b395cc6..b5b2585c2b 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -22,7 +22,7 @@ # SOFTWARE. # -FROM adoptopenjdk/openjdk8:x86_64-debian-jdk8u275-b01 +FROM adoptopenjdk/openjdk11:x86_64-debian-jdk-11.0.9_11.1 ENV DOCKER_VERSION=19.03.8 \ DOCKER_CHANNEL=stable \ diff --git a/build/Makefile b/build/Makefile index 58c2d7cd19..8aa8cefc1d 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,4 +1,4 @@ -VERSION:=8u275-b01 +VERSION:=11.0.9_11.1 .PHONY:build build: diff --git a/pom.xml b/pom.xml index 796888372f..9e1fcdd0dd 100644 --- a/pom.xml +++ b/pom.xml @@ -608,7 +608,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.22.0 + 3.0.0-M5