Skip to content
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

[7.67.x-blue] Update infinispan to 14.0.27.Final. #1419

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.infinispan.client.hotrod.configuration.SaslQop;
import org.infinispan.client.hotrod.exceptions.HotRodClientException;
import org.infinispan.client.hotrod.impl.RemoteCacheImpl;
import org.infinispan.client.hotrod.impl.operations.PingResponse;
import org.infinispan.client.hotrod.marshall.ProtoStreamMarshaller;
import org.infinispan.commons.CacheConfigurationException;
import org.infinispan.protostream.BaseMarshaller;
Expand Down Expand Up @@ -390,7 +391,7 @@ public boolean isAlive() {
RemoteCacheImpl remoteCache = (RemoteCacheImpl) this.cacheManager.getCache();

try {
boolean isStarted = remoteCache.ping().isSuccess();
boolean isStarted = ((PingResponse) remoteCache.ping().toCompletableFuture().get()).isSuccess();
if (logger.isDebugEnabled()) {
logger.debug("Infinispan server is not started");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import org.infinispan.client.hotrod.RemoteCacheManager;
import org.infinispan.client.hotrod.impl.RemoteCacheImpl;
import org.infinispan.client.hotrod.impl.operations.PingResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -44,7 +45,7 @@ public InfinispanPingService(RemoteCacheImpl remoteCache) {
this.executor.submit(() -> {
while (!stop) {
try {
this.alive = remoteCache.ping().isSuccess();
this.alive = ((PingResponse) remoteCache.ping().toCompletableFuture().get()).isSuccess();
} catch (Exception e) {
if (logger.isDebugEnabled()) {
logger.error("Infinispan server is not started");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
package org.uberfire.ext.metadata.backend.infinispan.provider;

import org.infinispan.client.hotrod.impl.RemoteCacheImpl;
import org.infinispan.client.hotrod.impl.operations.PingResponse;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

import java.util.concurrent.ExecutionException;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
Expand All @@ -37,20 +40,20 @@ public class InfinispanPingServiceTest {
private RemoteCacheImpl remoteCache;

@Before
public void setUp() {
when(remoteCache.ping().isSuccess()).thenReturn(true);
public void setUp() throws ExecutionException, InterruptedException {
when(((PingResponse) remoteCache.ping().toCompletableFuture().get()).isSuccess()).thenReturn(true);
}

@Test
public void testPingSuccess() {
public void testPingSuccess() throws ExecutionException, InterruptedException {
{
InfinispanPingService service = spy(new InfinispanPingService(remoteCache));
assertTrue(service.ping());
service.stop();
}

{
when(remoteCache.ping().isSuccess()).thenReturn(false);
when(((PingResponse) remoteCache.ping().toCompletableFuture().get()).isSuccess()).thenReturn(false);
InfinispanPingService service = spy(new InfinispanPingService(remoteCache));
assertFalse(service.ping());
service.stop();
Expand Down
Loading