diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e3fb0018ea..98bd186382 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,23 +46,22 @@ jobs: - template: build-templates/gradle-common.yml@templates parameters: - vmImage: 'windows-latest' jdkVersion: '1.8' - jobName: 'WindowsJava8' + options: '-PtestVM=java21Home' + jobName: 'LinuxJava21' gradleTasks: 'check -x dependencyCheckAggregate' - template: build-templates/gradle-common.yml@templates parameters: vmImage: 'windows-latest' jdkVersion: '1.8' - options: '-PtestVM=java11Home' - jobName: 'WindowsJava11' + jobName: 'WindowsJava8' gradleTasks: 'check -x dependencyCheckAggregate' - template: build-templates/gradle-common.yml@templates parameters: vmImage: 'windows-latest' jdkVersion: '1.8' - options: '-PtestVM=java17Home' - jobName: 'WindowsJava17' + options: '-PtestVM=java21Home' + jobName: 'WindowsJava21' gradleTasks: 'check -x dependencyCheckAggregate' diff --git a/build-logic/src/main/java/org/ehcache/build/conventions/JacocoConvention.java b/build-logic/src/main/java/org/ehcache/build/conventions/JacocoConvention.java index 08e6487783..1be256d031 100644 --- a/build-logic/src/main/java/org/ehcache/build/conventions/JacocoConvention.java +++ b/build-logic/src/main/java/org/ehcache/build/conventions/JacocoConvention.java @@ -15,7 +15,7 @@ public void apply(Project project) { project.getPlugins().apply(JacocoPlugin.class); project.getExtensions().configure(JacocoPluginExtension.class, jacoco -> { - jacoco.setToolVersion("0.8.8"); + jacoco.setToolVersion("0.8.11"); }); project.getTasks().withType(JacocoReport.class).configureEach(jacocoReport -> { diff --git a/clustered/ehcache-client/src/test/java/org/ehcache/clustered/common/internal/store/operations/LazyValueHolderTest.java b/clustered/ehcache-client/src/test/java/org/ehcache/clustered/common/internal/store/operations/LazyValueHolderTest.java index 2058d9c56a..b631d7dba6 100644 --- a/clustered/ehcache-client/src/test/java/org/ehcache/clustered/common/internal/store/operations/LazyValueHolderTest.java +++ b/clustered/ehcache-client/src/test/java/org/ehcache/clustered/common/internal/store/operations/LazyValueHolderTest.java @@ -42,7 +42,7 @@ public class LazyValueHolderTest { @Test public void testGetValueDecodeOnlyOnce() throws Exception { Date date = mock(Date.class); - ByteBuffer buffer = mock(ByteBuffer.class); + ByteBuffer buffer = ByteBuffer.allocate(0); doReturn(date).when(serializer).read(buffer); LazyValueHolder valueHolder = new LazyValueHolder<>(buffer, serializer); @@ -56,7 +56,7 @@ public void testGetValueDecodeOnlyOnce() throws Exception { @Test public void testEncodeEncodesOnlyOnce() throws Exception { Date date = mock(Date.class); - ByteBuffer buffer = mock(ByteBuffer.class); + ByteBuffer buffer = ByteBuffer.allocate(0); doReturn(buffer).when(serializer).serialize(date); LazyValueHolder valueHolder = new LazyValueHolder<>(date); diff --git a/ehcache-impl/src/test/java/org/ehcache/impl/internal/copy/SerializingCopierTest.java b/ehcache-impl/src/test/java/org/ehcache/impl/internal/copy/SerializingCopierTest.java index f6616a55cc..92aa1212af 100644 --- a/ehcache-impl/src/test/java/org/ehcache/impl/internal/copy/SerializingCopierTest.java +++ b/ehcache-impl/src/test/java/org/ehcache/impl/internal/copy/SerializingCopierTest.java @@ -36,7 +36,7 @@ public class SerializingCopierTest { public void testCopy() throws Exception { Serializer serializer = uncheckedGenericMock(Serializer.class); String in = new String("foo"); - ByteBuffer buff = mock(ByteBuffer.class); + ByteBuffer buff = ByteBuffer.allocate(0); when(serializer.serialize(in)).thenReturn(buff); when(serializer.read(buff)).thenReturn(new String("foo")); diff --git a/ehcache-xml/build.gradle b/ehcache-xml/build.gradle index 4766e78001..6093eb2b0f 100644 --- a/ehcache-xml/build.gradle +++ b/ehcache-xml/build.gradle @@ -153,6 +153,11 @@ tasks.register('lowerBoundTest', Test) { classpath -= configurations.testRuntimeClasspath //add the classpath we want classpath += configurations.lowerBoundTestRuntimeClasspath + + if (testJava.javaVersion.isJava9Compatible()) { + // Older JAXB versions do reflection on java.lang.ClassLoader + jvmArgs += '--add-opens=java.base/java.lang=ALL-UNNAMED' + } } tasks.register('jakartaTest', Test) {