Skip to content

Updates for 16.0 #356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion infinispan-remote/connect-to-infinispan-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>1.20.4</version>
<version>${testcontainers.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -23,7 +24,6 @@ public class TutorialsConnectorHelper {
"<distributed-cache name=\"CACHE_NAME\" statistics=\"true\">\n"
+ " <encoding media-type=\"application/x-protostream\"/>\n"
+ "</distributed-cache>";

/**
* Returns the configuration builder with the connection information
*
Expand Down Expand Up @@ -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;
Expand Down
12 changes: 0 additions & 12 deletions infinispan-remote/continuous-query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@
<artifactId>connect-to-infinispan-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream-processor</artifactId>
Expand Down
9 changes: 0 additions & 9 deletions infinispan-remote/junit5/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,4 @@
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- JUnit 5 requires Surefire version 2.22.1 or higher -->
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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(){
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

/**
Expand All @@ -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<String, String> cache;
static RemoteCache<String, String> anotherCache;
Expand Down Expand Up @@ -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("<distributed-cache name=\"another-cache\"><encoding media-type=\"application/x-protostream\"/></distributed-cache>");
Expand All @@ -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("<distributed-cache><encoding media-type=\"application/x-protostream\"/></distributed-cache>"));
}

public static void disconnect(boolean removeCaches) {
Expand Down
16 changes: 0 additions & 16 deletions infinispan-remote/persistence/sql-store/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@
<artifactId>connect-to-infinispan-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream-processor</artifactId>
Expand All @@ -58,14 +50,6 @@

<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.2</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
Expand Down
23 changes: 0 additions & 23 deletions infinispan-remote/programmatic-protostream-marshalling/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,6 @@
<artifactId>connect-to-infinispan-server</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-api</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream-processor</artifactId>
<version>${version.protostream}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down
18 changes: 0 additions & 18 deletions infinispan-remote/query/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,6 @@
<artifactId>connect-to-infinispan-server</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-api</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-remote-query-client</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-query-dsl</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream-processor</artifactId>
Expand Down
7 changes: 6 additions & 1 deletion infinispan-remote/spatial-queries/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<artifactId>connect-to-infinispan-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream-processor</artifactId>
<version>${version.protostream}</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
Expand All @@ -25,7 +30,7 @@
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.3</version>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

<name>Infinispan Tutorial: Simple tutorials</name>
<properties>
<testcontainers.version>1.19.1</testcontainers.version>
<testcontainers.version>1.20.6</testcontainers.version>
<assertj.version>3.27.3</assertj.version>
</properties>
<repositories>
<repository>
Expand Down Expand Up @@ -56,7 +57,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven-compiler-plugin}</version>
<version>${version.maven.compiler}</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
Expand All @@ -74,7 +75,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${version.enforcer.plugin}</version>
<version>${version.maven.enforcer}</version>
<executions>
<execution>
<id>enforce-java</id>
Expand Down
Loading