From a6567c7d472e319b85f6d612a64c07863daa07b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 6 Aug 2024 10:35:03 +0200 Subject: [PATCH 1/3] Disable Infinispan tests on Java 23 Infinispan 14 does not work on Java 23, an upgrade to 15 is required. This commit therefore disables those tests when running against a Java version higher than 22. Unfortunately, the version of JUnit that we use has no value for Java 23, so we have to use OTHER for that purpose. --- .../cache/CacheAutoConfigurationTests.java | 10 +++++++++- .../spring-boot-smoke-test-cache/build.gradle | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index 9a84e99eb3d..adecac29b75 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2023 the original author or authors. + * Copyright 2012-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,8 @@ import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.jcache.embedded.JCachingProvider; import org.infinispan.spring.embedded.provider.SpringEmbeddedCacheManager; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.config.BeanPostProcessor; @@ -567,6 +569,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { } @Test + @DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23") void infinispanCacheWithConfig() { this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class) .withPropertyValues("spring.cache.type=infinispan", "spring.cache.infinispan.config=infinispan.xml") @@ -577,6 +580,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { } @Test + @DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23") void infinispanCacheWithCustomizers() { this.contextRunner.withUserConfiguration(DefaultCacheAndCustomizersConfiguration.class) .withPropertyValues("spring.cache.type=infinispan") @@ -584,6 +588,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { } @Test + @DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23") void infinispanCacheWithCaches() { this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class) .withPropertyValues("spring.cache.type=infinispan", "spring.cache.cacheNames[0]=foo", @@ -593,6 +598,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { } @Test + @DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23") void infinispanCacheWithCachesAndCustomConfig() { this.contextRunner.withUserConfiguration(InfinispanCustomConfiguration.class) .withPropertyValues("spring.cache.type=infinispan", "spring.cache.cacheNames[0]=foo", @@ -605,6 +611,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { } @Test + @DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23") void infinispanAsJCacheWithCaches() { String cachingProviderClassName = JCachingProvider.class.getName(); this.contextRunner.withUserConfiguration(DefaultCacheConfiguration.class) @@ -615,6 +622,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { } @Test + @DisabledOnJre(value = JRE.OTHER, disabledReason = "Infinispan 14 does not work on Java 23") void infinispanAsJCacheWithConfig() { String cachingProviderClassName = JCachingProvider.class.getName(); String configLocation = "infinispan.xml"; diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle index fd51155fdf0..db06fa7c815 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-cache/build.gradle @@ -86,6 +86,7 @@ def testHazelcast = tasks.register("testHazelcast", Test) { } def testInfinispan = tasks.register("testInfinispan", Test) { + enabled = (toolchain.javaVersion == null || toolchain.javaVersion.asInt() < 23) description = "Runs the tests against Infinispan" classpath = sourceSets.test.runtimeClasspath + configurations.infinispan systemProperties = ["spring.cache.jcache.config" : "classpath:infinispan.xml"] From 1246cab30bece2f66e1793d58c9664ab2fc366b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Tue, 6 Aug 2024 11:44:25 +0200 Subject: [PATCH 2/3] Disable Artemis tests on Java 23 Artemis does not work on Java 23, this commit therefore disables those tests when running against a Java version higher than 22. See https://issues.apache.org/jira/browse/ARTEMIS-4975 Unfortunately, the version of JUnit that we use has no value for Java 23, so we have to use OTHER for that purpose. --- .../jms/artemis/ArtemisAutoConfigurationTests.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java index ec0c32031e7..a4acbbb8395 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jms/artemis/ArtemisAutoConfigurationTests.java @@ -41,6 +41,8 @@ import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl; import org.apache.activemq.artemis.jms.server.config.impl.JMSQueueConfigurationImpl; import org.apache.activemq.artemis.jms.server.config.impl.TopicConfigurationImpl; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.io.TempDir; import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; @@ -63,6 +65,7 @@ import static org.assertj.core.api.Assertions.assertThat; * @author EddĂș MelĂ©ndez * @author Stephane Nicoll */ +@DisabledOnJre(value = JRE.OTHER, disabledReason = "https://issues.apache.org/jira/browse/ARTEMIS-4975") class ArtemisAutoConfigurationTests { private final ApplicationContextRunner contextRunner = new ApplicationContextRunner() From 7273a4bc26eab2eb928affe310846322bbdfc426 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Wed, 7 Aug 2024 17:34:56 +0200 Subject: [PATCH 3/3] Enable Java 23-ea on CI See gh-41698 --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb11ce3762b..17555929ebf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ jobs: toolchain: true - version: 22 toolchain: true + - version: 23-ea + distribution: temurin + toolchain: true exclude: - os: name: Linux