From e534200f9ad94003a5864ee56968f29d53e0b20d Mon Sep 17 00:00:00 2001
From: Mikhail Petrov <32207922+ololo3000@users.noreply.github.com>
Date: Thu, 27 Jan 2022 10:20:24 +0300
Subject: [PATCH] IGNITE-15753 Adds Spring version compatibility tests for
cache and tx integrations. (#80)
---
modules/spring-cache-ext/pom.xml | 36 +++
.../test/java/config/ignite-client-node.xml | 59 ++++
.../IgniteSpringCacheCompatibilityTest.java | 277 ++++++++++++++++++
.../IgniteSpringCacheTestSuite.java | 4 +-
modules/spring-tx-ext/pom.xml | 43 +++
.../test/java/config/ignite-client-node.xml | 53 ++++
.../IgniteSpringTransactionsTestSuite.java | 4 +-
...teSpringTransactionsCompatibilityTest.java | 265 +++++++++++++++++
8 files changed, 739 insertions(+), 2 deletions(-)
create mode 100644 modules/spring-cache-ext/src/test/java/config/ignite-client-node.xml
create mode 100644 modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/IgniteSpringCacheCompatibilityTest.java
create mode 100644 modules/spring-tx-ext/src/test/java/config/ignite-client-node.xml
create mode 100644 modules/spring-tx-ext/src/test/java/org/apache/ignite/transactions/spring/IgniteSpringTransactionsCompatibilityTest.java
diff --git a/modules/spring-cache-ext/pom.xml b/modules/spring-cache-ext/pom.xml
index c7c399ed..37a1441a 100644
--- a/modules/spring-cache-ext/pom.xml
+++ b/modules/spring-cache-ext/pom.xml
@@ -68,6 +68,14 @@
provided
+
+ org.apache.ignite
+ ignite-compatibility
+ ${ignite.version}
+ test-jar
+ test
+
+
org.apache.ignite
ignite-log4j
@@ -91,7 +99,35 @@
+
+
+
+ maven-redhat-repo-id
+ maven-redhat-repo-name
+ https://origin-maven.repository.redhat.com/ga
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ false
+ 1
+
+
+
+
src/test/java
diff --git a/modules/spring-cache-ext/src/test/java/config/ignite-client-node.xml b/modules/spring-cache-ext/src/test/java/config/ignite-client-node.xml
new file mode 100644
index 00000000..58198812
--- /dev/null
+++ b/modules/spring-cache-ext/src/test/java/config/ignite-client-node.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 127.0.0.1:47500..47509
+
+
+
+
+
+
+
+
diff --git a/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/IgniteSpringCacheCompatibilityTest.java b/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/IgniteSpringCacheCompatibilityTest.java
new file mode 100644
index 00000000..81f08290
--- /dev/null
+++ b/modules/spring-cache-ext/src/test/java/org/apache/ignite/cache/spring/IgniteSpringCacheCompatibilityTest.java
@@ -0,0 +1,277 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.cache.spring;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import org.apache.ignite.Ignite;
+import org.apache.ignite.IgniteCache;
+import org.apache.ignite.Ignition;
+import org.apache.ignite.client.ClientCache;
+import org.apache.ignite.client.IgniteClient;
+import org.apache.ignite.compatibility.testframework.junits.Dependency;
+import org.apache.ignite.compatibility.testframework.junits.IgniteCompatibilityAbstractTest;
+import org.apache.ignite.configuration.BinaryConfiguration;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.configuration.ClientConfiguration;
+import org.apache.ignite.configuration.IgniteConfiguration;
+import org.apache.ignite.internal.util.GridJavaProcess;
+import org.apache.ignite.internal.util.typedef.F;
+import org.jetbrains.annotations.NotNull;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.springframework.cache.annotation.CachingConfigurerSupport;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.interceptor.KeyGenerator;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import static org.apache.ignite.compatibility.IgniteReleasedVersion.VER_2_11_0;
+import static org.apache.ignite.compatibility.IgniteReleasedVersion.since;
+import static org.apache.ignite.configuration.ClientConnectorConfiguration.DFLT_PORT;
+import static org.apache.ignite.internal.IgniteVersionUtils.VER_STR;
+import static org.apache.ignite.testframework.GridTestUtils.cartesianProduct;
+import static org.apache.ignite.testframework.GridTestUtils.waitForCondition;
+
+/** */
+@RunWith(Parameterized.class)
+public class IgniteSpringCacheCompatibilityTest extends IgniteCompatibilityAbstractTest {
+ /** */
+ private static final Collection TEST_SPRING_VERSIONS = Arrays.asList(
+ "4.3.0.RELEASE",
+ "5.0.0.RELEASE",
+ "5.1.0.RELEASE",
+ "5.2.0.RELEASE",
+ "5.3.0"
+ );
+
+ /** */
+ private static final String TEST_CACHE_NAME = "testCache";
+
+ /** */
+ @Parameterized.Parameters(name = "Ignite Version {0}, Spring Version {1}")
+ public static Iterable