Skip to content

Commit a2813e9

Browse files
committed
Updates for 16.0
1 parent bc5f22a commit a2813e9

File tree

14 files changed

+92
-128
lines changed

14 files changed

+92
-128
lines changed

.github/workflows/pull_requests.yml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
push:
55
branches:
66
- main
7+
- 15.0.x
78
- development
8-
- 14.0.x
99
pull_request:
1010
branches:
1111
- main
12+
- 15.0.x
1213
- development
13-
- 14.0.x
1414

1515
jobs:
1616
test:
@@ -26,26 +26,32 @@ jobs:
2626
cache: maven
2727

2828
- if: github.base_ref == 'main' || github.ref_name == 'main'
29-
name: Start Infinispan Server Latest Version
29+
name: Start Infinispan Server Latest Stable Version
3030
run: |
31-
docker run -d -p 11222:11222 -e USER="admin" -e PASS="password" quay.io/infinispan/server:15.0
31+
docker run -d -p 11222:11222 -e USER="admin" -e PASS="password" quay.io/infinispan/server:15.2 -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
32+
docker run -d -p 31223:11222 -e USER="admin" -e PASS="password" quay.io/infinispan/server:15.2 -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666
3233
# Wait for server to startup
3334
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/container/health/status > /dev/null
35+
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31223/rest/v2/container/health/status > /dev/null
3436
3537
- if: github.base_ref == 'development' || github.ref_name == 'development'
36-
name: Start Infinispan Server Latest Version
38+
name: Start Infinispan Server Latest Development Version
3739
run: |
38-
docker run -d -p 11222:11222 -e USER="admin" -e PASS="password" quay.io/infinispan-test/server:main
40+
docker run -d -p 11222:11222 -e USER="admin" -e PASS="password" quay.io/infinispan-test/server:main -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
41+
docker run -d -p 31223:11222 -e USER="admin" -e PASS="password" quay.io/infinispan-test/server:main -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666
42+
3943
# Wait for server to startup
4044
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/container/health/status > /dev/null
45+
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31223/rest/v2/container/health/status > /dev/null
4146
42-
- if: github.base_ref == '14.0.x' || github.ref_name == '14.0.x'
43-
name: Start Infinispan Server Latest Version
47+
- if: github.base_ref == '15.0.x' || github.ref_name == '15.0.x'
48+
name: Start Infinispan Server Latest 15.0 LTS Version
4449
run: |
45-
docker run -d -p 11222:11222 -e USER="admin" -e PASS="password" quay.io/infinispan/server:14.0
50+
docker run -d -p 11222:11222 -e USER="admin" -e PASS="password" quay.io/infinispan/server:15.0 -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
51+
docker run -d -p 31223:11222 -e USER="admin" -e PASS="password" quay.io/infinispan/server:15.0 -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666
4652
# Wait for server to startup
47-
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/cache-managers/default/health/status > /dev/null
48-
53+
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:11222/rest/v2/container/health/status > /dev/null
54+
curl --fail --silent --show-error --retry-all-errors --retry 240 --retry-delay 1 http://localhost:31223/rest/v2/container/health/status > /dev/null
4955
5056
- name: JDK 17 Tests
5157
run: ./mvnw -B clean install -Dmaven.test.failure.ignore=true

infinispan-remote/connect-to-infinispan-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<dependency>
2525
<groupId>org.testcontainers</groupId>
2626
<artifactId>testcontainers</artifactId>
27-
<version>1.20.4</version>
27+
<version>${testcontainers.version}</version>
2828
</dependency>
2929
</dependencies>
3030
</project>

infinispan-remote/connect-to-infinispan-server/src/main/java/org/infinispan/tutorial/simple/connect/TutorialsConnectorHelper.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.infinispan.client.hotrod.RemoteCacheManager;
55
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
66
import org.infinispan.client.hotrod.impl.ConfigurationProperties;
7+
import org.infinispan.commons.util.Version;
78
import org.infinispan.server.test.core.InfinispanContainer;
89

910
/**
@@ -23,7 +24,6 @@ public class TutorialsConnectorHelper {
2324
"<distributed-cache name=\"CACHE_NAME\" statistics=\"true\">\n"
2425
+ " <encoding media-type=\"application/x-protostream\"/>\n"
2526
+ "</distributed-cache>";
26-
2727
/**
2828
* Returns the configuration builder with the connection information
2929
*
@@ -104,13 +104,19 @@ public static InfinispanContainer startInfinispanContainer() {
104104

105105
public static InfinispanContainer startInfinispanContainer(long millis) {
106106
try {
107-
INFINISPAN_CONTAINER = new InfinispanContainer();
107+
if (Version.getUnbrandedVersion().contains("SNAPSHOT")) {
108+
// we are using an Infinispan Dev version, use the latest build of the image
109+
INFINISPAN_CONTAINER = new InfinispanContainer("quay.io/infinispan-test/server:main");
110+
} else {
111+
INFINISPAN_CONTAINER = new InfinispanContainer();
112+
}
108113
INFINISPAN_CONTAINER.withUser(USER);
109114
INFINISPAN_CONTAINER.withPassword(PASSWORD);
110115
INFINISPAN_CONTAINER.start();
111116
Thread.sleep(millis);
112117
} catch (Exception ex) {
113118
System.out.println("Unable to start Infinispan container");
119+
stopInfinispanContainer();
114120
return null;
115121
}
116122
return INFINISPAN_CONTAINER;

infinispan-remote/continuous-query/pom.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,6 @@
4343
<artifactId>connect-to-infinispan-server</artifactId>
4444
<version>${project.version}</version>
4545
</dependency>
46-
<dependency>
47-
<groupId>org.infinispan</groupId>
48-
<artifactId>infinispan-client-hotrod</artifactId>
49-
</dependency>
50-
<dependency>
51-
<groupId>org.infinispan</groupId>
52-
<artifactId>infinispan-remote-query-client</artifactId>
53-
</dependency>
54-
<dependency>
55-
<groupId>org.infinispan</groupId>
56-
<artifactId>infinispan-query-dsl</artifactId>
57-
</dependency>
5846
<dependency>
5947
<groupId>org.infinispan.protostream</groupId>
6048
<artifactId>protostream-processor</artifactId>

infinispan-remote/cross-site-replication/docker-compose/docker-compose.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ networks:
55
driver: bridge
66
services:
77
infinispan-server-lon-1:
8-
image: quay.io/infinispan/server:15.0
8+
image: quay.io/infinispan-test/server-main
99
ports:
1010
- "11222:11222"
1111
container_name: ispn-lon-1
@@ -14,9 +14,9 @@ services:
1414
PASS: password
1515
networks:
1616
- mynetwork
17-
command: -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
17+
# command: -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
1818
infinispan-server-lon-2:
19-
image: quay.io/infinispan/server:15.0
19+
image: quay.io/infinispan/server:15.2
2020
ports:
2121
- "11221:11222"
2222
container_name: ispn-lon-2
@@ -25,26 +25,26 @@ services:
2525
PASS: password
2626
networks:
2727
- mynetwork
28-
command: -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
29-
infinispan-server-nyc-1:
30-
image: quay.io/infinispan/server:15.0
31-
ports:
32-
- "31222:11222"
33-
container_name: ispn-nyc-1
34-
environment:
35-
USER: admin
36-
PASS: password
37-
networks:
38-
- mynetwork
39-
command: -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666
40-
infinispan-server-nyc-2:
41-
image: quay.io/infinispan/server:15.0
42-
ports:
43-
- "31223:11222"
44-
container_name: ispn-nyc-2
45-
environment:
46-
USER: admin
47-
PASS: password
48-
networks:
49-
- mynetwork
50-
command: -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666
28+
# command: -c infinispan-xsite.xml -Dinfinispan.site.name=LON -Djgroups.mcast_port=46656
29+
# infinispan-server-nyc-1:
30+
# image: quay.io/infinispan/server:15.0
31+
# ports:
32+
# - "31222:11222"
33+
# container_name: ispn-nyc-1
34+
# environment:
35+
# USER: admin
36+
# PASS: password
37+
# networks:
38+
# - mynetwork
39+
# command: -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666
40+
# infinispan-server-nyc-2:
41+
# image: quay.io/infinispan/server:15.0
42+
# ports:
43+
# - "31223:11222"
44+
# container_name: ispn-nyc-2
45+
# environment:
46+
# USER: admin
47+
# PASS: password
48+
# networks:
49+
# - mynetwork
50+
# command: -c infinispan-xsite.xml -Dinfinispan.site.name=NYC -Djgroups.mcast_port=46666

infinispan-remote/cross-site-replication/src/main/java/org/infinispan/tutorial/simple/remote/xsite/InfinispanRemoteSwitchCluster.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ static void manipulateCacheAndSwitchCluster() {
3333
cache.put("hello", "world");
3434
printCluster("LON", cache);
3535
System.out.println("hello " + cache.get("hello") + " from LON");
36-
client.switchToCluster("NYC");
3736
printCluster("NYC", cache);
3837
System.out.println("hello " + cache.get("hello") + " from NYC");
3938
cache.put("hello-nyc", "world");
@@ -56,7 +55,9 @@ public static void connectToInfinispan() {
5655
cache = client.administration()
5756
// this cache should exist if you start with docker-compose and run the create-data.sh script
5857
.getOrCreateCache(XSITE_CACHE, new StringConfiguration("<distributed-cache/>"));
59-
58+
client.switchToCluster("NYC");
59+
client.administration().getOrCreateCache(XSITE_CACHE, new StringConfiguration("<distributed-cache/>"));
60+
client.switchToDefaultCluster();
6061
}
6162

6263
public static void disconnect(boolean removeCache) {

infinispan-remote/junit5/pom.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,4 @@
2222
<scope>test</scope>
2323
</dependency>
2424
</dependencies>
25-
<build>
26-
<plugins>
27-
<!-- JUnit 5 requires Surefire version 2.22.1 or higher -->
28-
<plugin>
29-
<artifactId>maven-surefire-plugin</artifactId>
30-
<version>3.5.2</version>
31-
</plugin>
32-
</plugins>
33-
</build>
3425
</project>

infinispan-remote/junit5/src/test/java/org/infinispan/tutorial/simple/remote/junit5/CachingServiceTest.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import org.infinispan.client.hotrod.RemoteCache;
44
import org.infinispan.client.hotrod.RemoteCacheManager;
5+
import org.infinispan.commons.util.Version;
6+
import org.infinispan.server.test.core.ServerRunMode;
7+
import org.infinispan.server.test.core.TestSystemPropertyNames;
58
import org.infinispan.server.test.junit5.InfinispanServerExtension;
69
import org.infinispan.server.test.junit5.InfinispanServerExtensionBuilder;
710
import org.junit.jupiter.api.Test;
@@ -16,7 +19,21 @@
1619
public class CachingServiceTest {
1720

1821
@RegisterExtension
19-
static InfinispanServerExtension infinispanServerExtension = InfinispanServerExtensionBuilder.server();
22+
static InfinispanServerExtension infinispanServerExtension = buildExtension();
23+
24+
static InfinispanServerExtension buildExtension() {
25+
if (Version.getUnbrandedVersion().contains("SNAPSHOT")) {
26+
// In our dev branch, we need to build with the latest main branch image.
27+
return InfinispanServerExtensionBuilder
28+
.config()
29+
.numServers(1)
30+
.runMode(ServerRunMode.CONTAINER)
31+
.property(TestSystemPropertyNames.INFINISPAN_TEST_SERVER_BASE_IMAGE_NAME, "quay.io/infinispan-test/server:main")
32+
.build();
33+
}
34+
35+
return InfinispanServerExtensionBuilder.server();
36+
}
2037

2138
@Test
2239
public void testUsingRemoteCacheManager(){

infinispan-remote/per-cache-configuration/src/main/java/org/infinispan/tutorial/simple/remote/percache/InfinispanRemotePerCache.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package org.infinispan.tutorial.simple.remote.percache;
22

3-
import org.infinispan.client.hotrod.DefaultTemplate;
43
import org.infinispan.client.hotrod.RemoteCache;
54
import org.infinispan.client.hotrod.RemoteCacheManager;
65
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
6+
import org.infinispan.commons.configuration.StringConfiguration;
77
import org.infinispan.tutorial.simple.connect.TutorialsConnectorHelper;
88

99
/**
@@ -24,6 +24,7 @@ public class InfinispanRemotePerCache {
2424
public static final String MY_CACHE = "my-cache";
2525
public static final String ANOTHER_CACHE = "another-cache";
2626
public static final String URI_CACHE = "uri-cache";
27+
public static final String MY_CUSTOM_TEMPLATE = "my-custom-template";
2728
static RemoteCacheManager cacheManager;
2829
static RemoteCache<String, String> cache;
2930
static RemoteCache<String, String> anotherCache;
@@ -64,7 +65,9 @@ public static void connectToInfinispan() throws Exception {
6465

6566
//Add per-cache configuration that uses an org.infinispan cache template.
6667
builder.remoteCache(MY_CACHE)
67-
.templateName(DefaultTemplate.DIST_SYNC);
68+
// we can declare a template, even if the template does not exist yet.
69+
// however, the template has to be present on first access to create the cache.
70+
.templateName(MY_CUSTOM_TEMPLATE);
6871
//Add per-cache configuration with a cache definition in XML format.
6972
builder.remoteCache(ANOTHER_CACHE)
7073
.configuration("<distributed-cache name=\"another-cache\"><encoding media-type=\"application/x-protostream\"/></distributed-cache>");
@@ -73,6 +76,9 @@ public static void connectToInfinispan() throws Exception {
7376
InfinispanRemotePerCache.class.getClassLoader().getResource("cacheConfig.xml").toURI());
7477

7578
cacheManager = TutorialsConnectorHelper.connect(builder);
79+
// create the template that is used to create MY-CACHE on first access
80+
cacheManager.administration().removeTemplate(MY_CUSTOM_TEMPLATE);
81+
cacheManager.administration().createTemplate(MY_CUSTOM_TEMPLATE, new StringConfiguration("<distributed-cache><encoding media-type=\"application/x-protostream\"/></distributed-cache>"));
7682
}
7783

7884
public static void disconnect(boolean removeCaches) {

infinispan-remote/persistence/sql-store/pom.xml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@
2626
<artifactId>connect-to-infinispan-server</artifactId>
2727
<version>${project.version}</version>
2828
</dependency>
29-
<dependency>
30-
<groupId>org.infinispan</groupId>
31-
<artifactId>infinispan-client-hotrod</artifactId>
32-
</dependency>
33-
<dependency>
34-
<groupId>org.infinispan</groupId>
35-
<artifactId>infinispan-remote-query-client</artifactId>
36-
</dependency>
3729
<dependency>
3830
<groupId>org.infinispan.protostream</groupId>
3931
<artifactId>protostream-processor</artifactId>
@@ -58,14 +50,6 @@
5850

5951
<build>
6052
<plugins>
61-
<plugin>
62-
<artifactId>maven-compiler-plugin</artifactId>
63-
<version>3.8.1</version>
64-
</plugin>
65-
<plugin>
66-
<artifactId>maven-surefire-plugin</artifactId>
67-
<version>3.5.2</version>
68-
</plugin>
6953
<plugin>
7054
<groupId>org.codehaus.mojo</groupId>
7155
<artifactId>exec-maven-plugin</artifactId>

0 commit comments

Comments
 (0)