From 0bec2c9c8decc350412f0793e4e27047598f8851 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Tue, 10 Jan 2023 01:56:13 +0800 Subject: [PATCH] Update nativeBuildTools and junit version --- gradle/libs.versions.toml | 6 +- .../hazelcast/5.2.1/build.gradle | 4 -- .../hazelcast/HazelcastTest.java | 19 +++++++ .../com_hazelcast/hazelcast/JCacheTest.java | 57 ------------------- 4 files changed, 22 insertions(+), 64 deletions(-) delete mode 100644 tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/JCacheTest.java diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index aee73cfa8..e69f069dd 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,10 +1,10 @@ [versions] # Project versions -nativeBuildTools = "0.9.16" +nativeBuildTools = "0.9.19" # External dependencies -junitPlatform = "1.8.1" -junitJupiter = "5.8.1" +junitPlatform = "1.9.1" +junitJupiter = "5.9.1" groovy = "3.0.8" [libraries] diff --git a/tests/src/com.hazelcast/hazelcast/5.2.1/build.gradle b/tests/src/com.hazelcast/hazelcast/5.2.1/build.gradle index dd8782832..458e93429 100644 --- a/tests/src/com.hazelcast/hazelcast/5.2.1/build.gradle +++ b/tests/src/com.hazelcast/hazelcast/5.2.1/build.gradle @@ -17,10 +17,6 @@ dependencies { testImplementation 'javax.cache:cache-api:1.1.1' } -test { - jvmArgs = Arrays.asList("-Xmx4g") -} - graalvmNative { agent { defaultMode = "conditional" diff --git a/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/HazelcastTest.java b/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/HazelcastTest.java index 97c75b7af..caa615845 100644 --- a/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/HazelcastTest.java +++ b/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/HazelcastTest.java @@ -35,9 +35,11 @@ import javax.cache.Cache; import javax.cache.CacheManager; import javax.cache.Caching; +import javax.cache.configuration.CompleteConfiguration; import javax.cache.configuration.MutableConfiguration; import javax.cache.expiry.AccessedExpiryPolicy; import javax.cache.expiry.Duration; +import javax.cache.spi.CachingProvider; import java.util.Collection; import java.util.List; import java.util.Set; @@ -256,4 +258,21 @@ void testTopic() { IntStream.range(0, 3).mapToObj(i -> "Hello to distributed world").forEach(topic::publish); client.shutdown(); } + + @Test + void testJCacheOrigin() { + CachingProvider cachingProvider = Caching.getCachingProvider(HazelcastCachingProvider.class.getName()); + CacheManager cacheManager = cachingProvider.getCacheManager(); + CompleteConfiguration config = new MutableConfiguration() + .setTypes(String.class, String.class) + .setStatisticsEnabled(true) + .setReadThrough(false) + .setManagementEnabled(true) + .setStoreByValue(false) + .setWriteThrough(false); + Cache cache = cacheManager.createCache("example", config); + cache.put("world", "Hello World"); + assertThat(cache.get("world")).isEqualTo("Hello World"); + assertThat(cacheManager.getCache("example", String.class, String.class)).isNotNull(); + } } diff --git a/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/JCacheTest.java b/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/JCacheTest.java deleted file mode 100644 index e950946a6..000000000 --- a/tests/src/com.hazelcast/hazelcast/5.2.1/src/test/java/com_hazelcast/hazelcast/JCacheTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright and related rights waived via CC0 - * - * You should have received a copy of the CC0 legalcode along with this - * work. If not, see . - */ -package com_hazelcast.hazelcast; - -import com.hazelcast.cache.HazelcastCachingProvider; -import com.hazelcast.config.Config; -import com.hazelcast.core.Hazelcast; -import com.hazelcast.core.HazelcastInstance; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - -import javax.cache.Cache; -import javax.cache.CacheManager; -import javax.cache.Caching; -import javax.cache.configuration.CompleteConfiguration; -import javax.cache.configuration.MutableConfiguration; -import javax.cache.spi.CachingProvider; - -import static org.assertj.core.api.Assertions.assertThat; - -public class JCacheTest { - static HazelcastInstance hazelcastInstance; - - @BeforeAll - static void beforeAll() { - hazelcastInstance = Hazelcast.newHazelcastInstance(); - } - - @AfterAll - static void afterAll() { - hazelcastInstance.shutdown(); - } - - @Test - void testJCacheOrigin() { - HazelcastInstance hazelcastInstance = Hazelcast.newHazelcastInstance(new Config()); - CachingProvider cachingProvider = Caching.getCachingProvider(HazelcastCachingProvider.class.getName()); - CacheManager cacheManager = cachingProvider.getCacheManager(); - CompleteConfiguration config = new MutableConfiguration() - .setTypes(String.class, String.class) - .setStatisticsEnabled(true) - .setReadThrough(false) - .setManagementEnabled(true) - .setStoreByValue(false) - .setWriteThrough(false); - Cache cache = cacheManager.createCache("example", config); - cache.put("world", "Hello World"); - assertThat(cache.get("world")).isEqualTo("Hello World"); - assertThat(cacheManager.getCache("example", String.class, String.class)).isNotNull(); - hazelcastInstance.shutdown(); - } -}