diff --git a/metadata/index.json b/metadata/index.json
index 1918ec6b3..68601db54 100644
--- a/metadata/index.json
+++ b/metadata/index.json
@@ -102,6 +102,10 @@
"directory": "org.flywaydb/flyway-core",
"module": "org.flywaydb:flyway-core"
},
+ {
+ "directory": "javax.cache/cache-api",
+ "module": "javax.cache:cache-api"
+ },
{
"directory": "com.sun.mail/jakarta.mail",
"module": "com.sun.mail:jakarta.mail"
diff --git a/metadata/javax.cache/cache-api/1.1.1/index.json b/metadata/javax.cache/cache-api/1.1.1/index.json
new file mode 100644
index 000000000..1b4d2be8b
--- /dev/null
+++ b/metadata/javax.cache/cache-api/1.1.1/index.json
@@ -0,0 +1,4 @@
+[
+ "resource-config.json",
+ "serialization-config.json"
+]
diff --git a/metadata/javax.cache/cache-api/1.1.1/resource-config.json b/metadata/javax.cache/cache-api/1.1.1/resource-config.json
new file mode 100644
index 000000000..c7dfc4b68
--- /dev/null
+++ b/metadata/javax.cache/cache-api/1.1.1/resource-config.json
@@ -0,0 +1,13 @@
+{
+ "resources": {
+ "includes": [
+ {
+ "condition": {
+ "typeReachable": "javax.cache.Caching$CachingProviderRegistry$1"
+ },
+ "pattern": "\\QMETA-INF/services/javax.cache.spi.CachingProvider\\E"
+ }
+ ]
+ },
+ "bundles": []
+}
diff --git a/metadata/javax.cache/cache-api/1.1.1/serialization-config.json b/metadata/javax.cache/cache-api/1.1.1/serialization-config.json
new file mode 100644
index 000000000..83208720c
--- /dev/null
+++ b/metadata/javax.cache/cache-api/1.1.1/serialization-config.json
@@ -0,0 +1,48 @@
+{
+ "lambdaCapturingTypes": [],
+ "proxies": [],
+ "types": [
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "javax.cache.configuration.FactoryBuilder$SingletonFactory"
+ },
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "javax.cache.expiry.AccessedExpiryPolicy"
+ },
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "javax.cache.expiry.Duration"
+ },
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "javax.cache.expiry.EternalExpiryPolicy"
+ },
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "java.lang.String"
+ },
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "java.lang.Number"
+ },
+ {
+ "condition": {
+ "typeReachable": "java.lang.Object"
+ },
+ "name": "java.lang.Integer"
+ }
+ ]
+}
diff --git a/metadata/javax.cache/cache-api/index.json b/metadata/javax.cache/cache-api/index.json
new file mode 100644
index 000000000..4debe9dba
--- /dev/null
+++ b/metadata/javax.cache/cache-api/index.json
@@ -0,0 +1,10 @@
+[
+ {
+ "latest": true,
+ "metadata-version": "1.1.1",
+ "module": "javax.cache:cache-api",
+ "tested-versions": [
+ "1.1.1"
+ ]
+ }
+]
diff --git a/tests/src/index.json b/tests/src/index.json
index ae4f5be50..a8c20350c 100644
--- a/tests/src/index.json
+++ b/tests/src/index.json
@@ -252,6 +252,17 @@
}
]
},
+ {
+ "test-project-path": "javax.cache/cache-api/1.1.1",
+ "libraries": [
+ {
+ "name": "javax.cache:cache-api",
+ "versions": [
+ "1.1.1"
+ ]
+ }
+ ]
+ },
{
"test-project-path": "com.sun.mail/jakarta.mail/2.0.1",
"libraries": [
diff --git a/tests/src/javax.cache/cache-api/1.1.1/.gitignore b/tests/src/javax.cache/cache-api/1.1.1/.gitignore
new file mode 100644
index 000000000..c98c7875b
--- /dev/null
+++ b/tests/src/javax.cache/cache-api/1.1.1/.gitignore
@@ -0,0 +1,4 @@
+gradlew.bat
+gradlew
+gradle/
+build/
diff --git a/tests/src/javax.cache/cache-api/1.1.1/build.gradle b/tests/src/javax.cache/cache-api/1.1.1/build.gradle
new file mode 100644
index 000000000..d628f0e23
--- /dev/null
+++ b/tests/src/javax.cache/cache-api/1.1.1/build.gradle
@@ -0,0 +1,34 @@
+/*
+ * Copyright and related rights waived via CC0
+ *
+ * You should have received a copy of the CC0 legalcode along with this
+ * work. If not, see .
+ */
+
+plugins {
+ id "org.graalvm.internal.tck"
+}
+
+String libraryVersion = tck.testedLibraryVersion.get()
+
+dependencies {
+ testImplementation "javax.cache:cache-api:$libraryVersion"
+ testImplementation 'org.assertj:assertj-core:3.22.0'
+ testImplementation "org.jsr107.ri:cache-ri-impl:$libraryVersion"
+}
+
+graalvmNative {
+ agent {
+ defaultMode = "conditional"
+ modes {
+ conditional {
+ userCodeFilterPath = "user-code-filter.json"
+ }
+ }
+ metadataCopy {
+ mergeWithExisting = true
+ inputTaskNames.add("test")
+ outputDirectories.add("src/test/resources/META-INF/native-image/javax.cache/cache-api")
+ }
+ }
+}
diff --git a/tests/src/javax.cache/cache-api/1.1.1/gradle.properties b/tests/src/javax.cache/cache-api/1.1.1/gradle.properties
new file mode 100644
index 000000000..b0f8d0a69
--- /dev/null
+++ b/tests/src/javax.cache/cache-api/1.1.1/gradle.properties
@@ -0,0 +1,2 @@
+library.version = 1.1.1
+metadata.dir = javax.cache/cache-api/1.1.1/
diff --git a/tests/src/javax.cache/cache-api/1.1.1/settings.gradle b/tests/src/javax.cache/cache-api/1.1.1/settings.gradle
new file mode 100644
index 000000000..726635e55
--- /dev/null
+++ b/tests/src/javax.cache/cache-api/1.1.1/settings.gradle
@@ -0,0 +1,13 @@
+pluginManagement {
+ def tckPath = Objects.requireNonNullElse(
+ System.getenv("GVM_TCK_TCKDIR"),
+ "../../../../tck-build-logic"
+ )
+ includeBuild(tckPath)
+}
+
+plugins {
+ id "org.graalvm.internal.tck-settings" version "1.0.0-SNAPSHOT"
+}
+
+rootProject.name = 'javax.cache.cache-api_tests'
diff --git a/tests/src/javax.cache/cache-api/1.1.1/src/test/java/javax_cache/cache_api/core/CacheTest.java b/tests/src/javax.cache/cache-api/1.1.1/src/test/java/javax_cache/cache_api/core/CacheTest.java
new file mode 100644
index 000000000..b87524e5f
--- /dev/null
+++ b/tests/src/javax.cache/cache-api/1.1.1/src/test/java/javax_cache/cache_api/core/CacheTest.java
@@ -0,0 +1,102 @@
+/*
+ * 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 javax_cache.cache_api.core;
+
+import org.junit.jupiter.api.Test;
+
+import javax.cache.Cache;
+import javax.cache.CacheManager;
+import javax.cache.Caching;
+import javax.cache.configuration.Configuration;
+import javax.cache.configuration.MutableConfiguration;
+import javax.cache.expiry.AccessedExpiryPolicy;
+
+import static javax.cache.expiry.Duration.ONE_HOUR;
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNull;
+
+public class CacheTest {
+ @Test
+ public void simpleCache() {
+ CacheManager manager = Caching.getCachingProvider().getCacheManager();
+ Configuration configuration = new MutableConfiguration().setTypes(Integer.class, String.class);
+ assertThat(manager.getCache("simpleCache22")).isNull();
+ Cache simpleCache = manager.createCache("simpleCache22", configuration);
+ simpleCache.put(2, "value");
+ assertThat(simpleCache.get(2)).isEqualTo("value");
+ }
+
+ @Test
+ public void simpleAPITypeEnforcement() {
+ CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
+ MutableConfiguration config = new MutableConfiguration()
+ .setStoreByValue(true).setTypes(String.class, Integer.class)
+ .setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR)).setStatisticsEnabled(true);
+ cacheManager.createCache("simpleCache", config);
+ Cache cache = Caching.getCache("simpleCache", String.class, Integer.class);
+ cache.put("key", 1);
+ assertEquals(1, cache.get("key"));
+ cache.remove("key");
+ assertNull(cache.get("key"));
+ }
+
+ @Test
+ public void simpleAPITypeEnforcementUsingCaching() {
+ CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
+ MutableConfiguration config = new MutableConfiguration<>();
+ config.setTypes(String.class, Integer.class).setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR)).setStatisticsEnabled(true);
+ cacheManager.createCache("simpleCache2", config);
+ Cache cache = Caching.getCache("simpleCache2", String.class, Integer.class);
+ cache.put("key", 1);
+ assertEquals(1, cache.get("key"));
+ cache.remove("key");
+ assertNull(cache.get("key"));
+ }
+
+ @Test
+ public void simpleAPIWithGenericsAndNoTypeEnforcement() {
+ CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
+ MutableConfiguration config = new MutableConfiguration<>();
+ config.setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(ONE_HOUR)).setStatisticsEnabled(true);
+ cacheManager.createCache("sampleCache3", config);
+ Cache cache = cacheManager.getCache("sampleCache3");
+ cache.put("key", 1);
+ assertThat(cache.get("key")).isEqualTo(1);
+ cache.remove("key");
+ assertNull(cache.get("key"));
+ }
+
+
+ @Test
+ public void simpleAPINoGenericsAndNoTypeEnforcement() {
+ CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
+ String cacheName = "sampleCache";
+ MutableConfiguration