diff --git a/infinispan-remote/connect-to-infinispan-server/pom.xml b/infinispan-remote/connect-to-infinispan-server/pom.xml index 3ccf1e99..53083dd8 100644 --- a/infinispan-remote/connect-to-infinispan-server/pom.xml +++ b/infinispan-remote/connect-to-infinispan-server/pom.xml @@ -24,7 +24,7 @@ org.testcontainers testcontainers - 1.20.4 + ${testcontainers.version} diff --git a/infinispan-remote/connect-to-infinispan-server/src/main/java/org/infinispan/tutorial/simple/connect/TutorialsConnectorHelper.java b/infinispan-remote/connect-to-infinispan-server/src/main/java/org/infinispan/tutorial/simple/connect/TutorialsConnectorHelper.java index e1ea6971..f6e5cb76 100644 --- a/infinispan-remote/connect-to-infinispan-server/src/main/java/org/infinispan/tutorial/simple/connect/TutorialsConnectorHelper.java +++ b/infinispan-remote/connect-to-infinispan-server/src/main/java/org/infinispan/tutorial/simple/connect/TutorialsConnectorHelper.java @@ -4,6 +4,7 @@ import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.client.hotrod.configuration.ConfigurationBuilder; import org.infinispan.client.hotrod.impl.ConfigurationProperties; +import org.infinispan.commons.util.Version; import org.infinispan.server.test.core.InfinispanContainer; /** @@ -23,7 +24,6 @@ public class TutorialsConnectorHelper { "\n" + " \n" + ""; - /** * Returns the configuration builder with the connection information * @@ -104,13 +104,19 @@ public static InfinispanContainer startInfinispanContainer() { public static InfinispanContainer startInfinispanContainer(long millis) { try { - INFINISPAN_CONTAINER = new InfinispanContainer(); + if (Version.getUnbrandedVersion().contains("SNAPSHOT")) { + // we are using an Infinispan Dev version, use the latest build of the image + INFINISPAN_CONTAINER = new InfinispanContainer("quay.io/infinispan-test/server:main"); + } else { + INFINISPAN_CONTAINER = new InfinispanContainer(); + } INFINISPAN_CONTAINER.withUser(USER); INFINISPAN_CONTAINER.withPassword(PASSWORD); INFINISPAN_CONTAINER.start(); Thread.sleep(millis); } catch (Exception ex) { System.out.println("Unable to start Infinispan container"); + stopInfinispanContainer(); return null; } return INFINISPAN_CONTAINER; diff --git a/infinispan-remote/continuous-query/pom.xml b/infinispan-remote/continuous-query/pom.xml index b21ea6a7..97b9138d 100644 --- a/infinispan-remote/continuous-query/pom.xml +++ b/infinispan-remote/continuous-query/pom.xml @@ -43,18 +43,6 @@ connect-to-infinispan-server ${project.version} - - org.infinispan - infinispan-client-hotrod - - - org.infinispan - infinispan-remote-query-client - - - org.infinispan - infinispan-query-dsl - org.infinispan.protostream protostream-processor diff --git a/infinispan-remote/junit5/pom.xml b/infinispan-remote/junit5/pom.xml index 9b2df21d..8181989c 100644 --- a/infinispan-remote/junit5/pom.xml +++ b/infinispan-remote/junit5/pom.xml @@ -22,13 +22,4 @@ test - - - - - maven-surefire-plugin - 3.5.2 - - - diff --git a/infinispan-remote/junit5/src/test/java/org/infinispan/tutorial/simple/remote/junit5/CachingServiceTest.java b/infinispan-remote/junit5/src/test/java/org/infinispan/tutorial/simple/remote/junit5/CachingServiceTest.java index bafba607..3b60c057 100644 --- a/infinispan-remote/junit5/src/test/java/org/infinispan/tutorial/simple/remote/junit5/CachingServiceTest.java +++ b/infinispan-remote/junit5/src/test/java/org/infinispan/tutorial/simple/remote/junit5/CachingServiceTest.java @@ -2,6 +2,9 @@ import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCacheManager; +import org.infinispan.commons.util.Version; +import org.infinispan.server.test.core.ServerRunMode; +import org.infinispan.server.test.core.TestSystemPropertyNames; import org.infinispan.server.test.junit5.InfinispanServerExtension; import org.infinispan.server.test.junit5.InfinispanServerExtensionBuilder; import org.junit.jupiter.api.Test; @@ -16,7 +19,21 @@ public class CachingServiceTest { @RegisterExtension - static InfinispanServerExtension infinispanServerExtension = InfinispanServerExtensionBuilder.server(); + static InfinispanServerExtension infinispanServerExtension = buildExtension(); + + static InfinispanServerExtension buildExtension() { + if (Version.getUnbrandedVersion().contains("SNAPSHOT")) { + // In our dev branch, we need to build with the latest main branch image. + return InfinispanServerExtensionBuilder + .config() + .numServers(1) + .runMode(ServerRunMode.CONTAINER) + .property(TestSystemPropertyNames.INFINISPAN_TEST_SERVER_BASE_IMAGE_NAME, "quay.io/infinispan-test/server:main") + .build(); + } + + return InfinispanServerExtensionBuilder.server(); + } @Test public void testUsingRemoteCacheManager(){ diff --git a/infinispan-remote/per-cache-configuration/src/main/java/org/infinispan/tutorial/simple/remote/percache/InfinispanRemotePerCache.java b/infinispan-remote/per-cache-configuration/src/main/java/org/infinispan/tutorial/simple/remote/percache/InfinispanRemotePerCache.java index 059978c3..5f1e1139 100644 --- a/infinispan-remote/per-cache-configuration/src/main/java/org/infinispan/tutorial/simple/remote/percache/InfinispanRemotePerCache.java +++ b/infinispan-remote/per-cache-configuration/src/main/java/org/infinispan/tutorial/simple/remote/percache/InfinispanRemotePerCache.java @@ -1,9 +1,9 @@ package org.infinispan.tutorial.simple.remote.percache; -import org.infinispan.client.hotrod.DefaultTemplate; import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCacheManager; import org.infinispan.client.hotrod.configuration.ConfigurationBuilder; +import org.infinispan.commons.configuration.StringConfiguration; import org.infinispan.tutorial.simple.connect.TutorialsConnectorHelper; /** @@ -24,6 +24,7 @@ public class InfinispanRemotePerCache { public static final String MY_CACHE = "my-cache"; public static final String ANOTHER_CACHE = "another-cache"; public static final String URI_CACHE = "uri-cache"; + public static final String MY_CUSTOM_TEMPLATE = "my-custom-template"; static RemoteCacheManager cacheManager; static RemoteCache cache; static RemoteCache anotherCache; @@ -64,7 +65,9 @@ public static void connectToInfinispan() throws Exception { //Add per-cache configuration that uses an org.infinispan cache template. builder.remoteCache(MY_CACHE) - .templateName(DefaultTemplate.DIST_SYNC); + // we can declare a template, even if the template does not exist yet. + // however, the template has to be present on first access to create the cache. + .templateName(MY_CUSTOM_TEMPLATE); //Add per-cache configuration with a cache definition in XML format. builder.remoteCache(ANOTHER_CACHE) .configuration(""); @@ -73,6 +76,9 @@ public static void connectToInfinispan() throws Exception { InfinispanRemotePerCache.class.getClassLoader().getResource("cacheConfig.xml").toURI()); cacheManager = TutorialsConnectorHelper.connect(builder); + // create the template that is used to create MY-CACHE on first access + cacheManager.administration().removeTemplate(MY_CUSTOM_TEMPLATE); + cacheManager.administration().createTemplate(MY_CUSTOM_TEMPLATE, new StringConfiguration("")); } public static void disconnect(boolean removeCaches) { diff --git a/infinispan-remote/persistence/sql-store/pom.xml b/infinispan-remote/persistence/sql-store/pom.xml index 47a9fa77..a7facc1f 100644 --- a/infinispan-remote/persistence/sql-store/pom.xml +++ b/infinispan-remote/persistence/sql-store/pom.xml @@ -26,14 +26,6 @@ connect-to-infinispan-server ${project.version} - - org.infinispan - infinispan-client-hotrod - - - org.infinispan - infinispan-remote-query-client - org.infinispan.protostream protostream-processor @@ -58,14 +50,6 @@ - - maven-compiler-plugin - 3.8.1 - - - maven-surefire-plugin - 3.5.2 - org.codehaus.mojo exec-maven-plugin diff --git a/infinispan-remote/programmatic-protostream-marshalling/pom.xml b/infinispan-remote/programmatic-protostream-marshalling/pom.xml index 06df17ca..319decf8 100644 --- a/infinispan-remote/programmatic-protostream-marshalling/pom.xml +++ b/infinispan-remote/programmatic-protostream-marshalling/pom.xml @@ -42,29 +42,6 @@ connect-to-infinispan-server ${project.version} - - - org.infinispan - infinispan-api - - - org.infinispan - infinispan-client-hotrod - - - - org.infinispan - infinispan-remote-query-client - - - org.infinispan - infinispan-query-dsl - - - org.infinispan.protostream - protostream-processor - ${version.protostream} - org.junit.jupiter junit-jupiter diff --git a/infinispan-remote/query/pom.xml b/infinispan-remote/query/pom.xml index f1e03aa6..dded1808 100644 --- a/infinispan-remote/query/pom.xml +++ b/infinispan-remote/query/pom.xml @@ -42,24 +42,6 @@ connect-to-infinispan-server ${project.version} - - - org.infinispan - infinispan-api - - - org.infinispan - infinispan-client-hotrod - - - - org.infinispan - infinispan-remote-query-client - - - org.infinispan - infinispan-query-dsl - org.infinispan.protostream protostream-processor diff --git a/infinispan-remote/spatial-queries/pom.xml b/infinispan-remote/spatial-queries/pom.xml index 461ab3d8..6b9d31a0 100644 --- a/infinispan-remote/spatial-queries/pom.xml +++ b/infinispan-remote/spatial-queries/pom.xml @@ -17,6 +17,11 @@ connect-to-infinispan-server ${project.version} + + org.infinispan.protostream + protostream-processor + ${version.protostream} + org.junit.jupiter junit-jupiter @@ -25,7 +30,7 @@ org.assertj assertj-core - 3.27.3 + ${assertj.version} test diff --git a/pom.xml b/pom.xml index 0d4349e3..21ac972f 100644 --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,8 @@ Infinispan Tutorial: Simple tutorials - 1.19.1 + 1.20.6 + 3.27.3 @@ -56,7 +57,7 @@ org.apache.maven.plugins maven-compiler-plugin - ${version.maven-compiler-plugin} + ${version.maven.compiler} ${maven.compiler.source} ${maven.compiler.target} @@ -74,7 +75,7 @@ org.apache.maven.plugins maven-enforcer-plugin - ${version.enforcer.plugin} + ${version.maven.enforcer} enforce-java