diff --git a/build-parent/pom.xml b/build-parent/pom.xml index e01124759bb..4222adc0616 100644 --- a/build-parent/pom.xml +++ b/build-parent/pom.xml @@ -67,14 +67,14 @@ 3.7.4 1.0.1 3.25.5 - 2.2.220 + 2.3.232 1.0.86 - 4.0.4 + 4.0.5 1.4.21 0.18.0 4.7.5 1.12.2 - 3.8.6 + 3.15.2 3.10.0 8.5.11 4.13.1 @@ -99,7 +99,8 @@ 2.2 2.3.0 - 14.0.25.Final + 15.0.8.Final + 5.0.8.Final 3.26.0-GA 7.0.2.Final 3.5.3.Final @@ -190,10 +191,10 @@ 1.14.11 - 42.7.2 + 42.7.4 2.0.1 - 3.1.6 + 3.2.2 3.0.3 3.25.8 @@ -749,7 +750,32 @@ ${version.org.javassist} - + + + org.infinispan + infinispan-core + ${version.org.infinispan} + + + org.infinispan + infinispan-client-hotrod + ${version.org.infinispan} + + + org.infinispan + infinispan-server-testdriver-core + ${version.org.infinispan} + + + org.infinispan.protostream + protostream + ${version.org.infinispan.protostream} + + + org.infinispan.protostream + protostream-processor + ${version.org.infinispan.protostream} + org.mockito diff --git a/drools-quarkus-extension/drools-quarkus-deployment/pom.xml b/drools-quarkus-extension/drools-quarkus-deployment/pom.xml index 0b46a52cb8a..1a9f683483d 100644 --- a/drools-quarkus-extension/drools-quarkus-deployment/pom.xml +++ b/drools-quarkus-extension/drools-quarkus-deployment/pom.xml @@ -82,7 +82,7 @@ io.quarkus - quarkus-resteasy-reactive-spi-deployment + quarkus-rest-server-spi-deployment io.quarkus diff --git a/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/pom.xml b/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/pom.xml index 7408ab126de..0a35b71415c 100644 --- a/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/pom.xml +++ b/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/pom.xml @@ -51,7 +51,7 @@ io.quarkus - quarkus-smallrye-reactive-messaging-kafka + quarkus-messaging-kafka org.assertj @@ -78,6 +78,12 @@ test + + org.awaitility + awaitility + test + + diff --git a/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/src/test/java/org/drools/quarkus/ruleunit/examples/reactive/RuntimeTest.java b/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/src/test/java/org/drools/quarkus/ruleunit/examples/reactive/RuntimeTest.java index 9771b03d800..b16873e510e 100644 --- a/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/src/test/java/org/drools/quarkus/ruleunit/examples/reactive/RuntimeTest.java +++ b/drools-quarkus-extension/drools-quarkus-examples/drools-quarkus-examples-reactive/src/test/java/org/drools/quarkus/ruleunit/examples/reactive/RuntimeTest.java @@ -25,9 +25,14 @@ import io.smallrye.reactive.messaging.memory.InMemoryConnector; import io.smallrye.reactive.messaging.memory.InMemorySink; import io.smallrye.reactive.messaging.memory.InMemorySource; +import org.eclipse.microprofile.reactive.messaging.Message; import org.eclipse.microprofile.reactive.messaging.spi.Connector; import org.junit.jupiter.api.Test; +import java.util.List; + +import static org.awaitility.Awaitility.await; + import static org.assertj.core.api.Assertions.assertThat; @QuarkusTest @@ -46,6 +51,7 @@ public void sendEvents() { incomingEvents.send(new Event("temperature", 20)); incomingEvents.send(new Event("temperature", 40)); + await().>>until(outgoingAlerts::received, t -> t.size() == 1); assertThat(outgoingAlerts.received().size()).isEqualTo(1); assertThat(outgoingAlerts.received().get(0).getPayload().getSeverity()).isEqualTo("warning"); diff --git a/drools-reliability/drools-reliability-infinispan/pom.xml b/drools-reliability/drools-reliability-infinispan/pom.xml index 73d06000077..b63c8b2e97f 100644 --- a/drools-reliability/drools-reliability-infinispan/pom.xml +++ b/drools-reliability/drools-reliability-infinispan/pom.xml @@ -52,7 +52,7 @@ org.infinispan - infinispan-core-jakarta + infinispan-core org.infinispan.protostream @@ -61,7 +61,7 @@ org.infinispan - infinispan-client-hotrod-jakarta + infinispan-client-hotrod org.drools diff --git a/drools-reliability/drools-reliability-infinispan/src/main/java/org/drools/reliability/infinispan/EmbeddedStorageManager.java b/drools-reliability/drools-reliability-infinispan/src/main/java/org/drools/reliability/infinispan/EmbeddedStorageManager.java index 65538365471..700fdd67eb9 100644 --- a/drools-reliability/drools-reliability-infinispan/src/main/java/org/drools/reliability/infinispan/EmbeddedStorageManager.java +++ b/drools-reliability/drools-reliability-infinispan/src/main/java/org/drools/reliability/infinispan/EmbeddedStorageManager.java @@ -18,9 +18,6 @@ */ package org.drools.reliability.infinispan; -import java.nio.file.Paths; -import java.util.Set; - import org.drools.core.common.ReteEvaluator; import org.drools.core.common.Storage; import org.drools.util.FileUtils; @@ -36,11 +33,11 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.nio.file.Paths; +import java.util.Set; + import static org.drools.reliability.core.StorageManager.createStorageId; -import static org.drools.reliability.infinispan.InfinispanStorageManagerFactory.DELIMITER; -import static org.drools.reliability.infinispan.InfinispanStorageManagerFactory.INFINISPAN_STORAGE_DIRECTORY; -import static org.drools.reliability.infinispan.InfinispanStorageManagerFactory.SESSION_STORAGE_PREFIX; -import static org.drools.reliability.infinispan.InfinispanStorageManagerFactory.SHARED_STORAGE_PREFIX; +import static org.drools.reliability.infinispan.InfinispanStorageManagerFactory.*; import static org.drools.util.Config.getConfig; public class EmbeddedStorageManager implements InfinispanStorageManager { @@ -76,7 +73,6 @@ public void initStorageManager() { // Initialize the default Cache Manager. embeddedCacheManager = new DefaultCacheManager(global.build()); - // Create a distributed cache with synchronous replication. ConfigurationBuilder builder = new ConfigurationBuilder(); builder.persistence().passivation(false) @@ -113,7 +109,7 @@ public void close() { @Override public void removeStorage(String storageName) { if (embeddedCacheManager.cacheExists(storageName)) { - embeddedCacheManager.removeCache(storageName); + embeddedCacheManager.administration().removeCache(storageName); } } @@ -176,6 +172,7 @@ public void setEmbeddedCacheManager(DefaultCacheManager embeddedCacheManager) { this.embeddedCacheManager.stop(); } this.embeddedCacheManager = embeddedCacheManager; + } // test purpose to remove GlobalState and FileStore diff --git a/drools-reliability/drools-reliability-tests/pom.xml b/drools-reliability/drools-reliability-tests/pom.xml index 907f780f237..da896f97158 100644 --- a/drools-reliability/drools-reliability-tests/pom.xml +++ b/drools-reliability/drools-reliability-tests/pom.xml @@ -35,7 +35,7 @@ org.drools.reliability.infinispan - 1.17.2 + 1.20.1 @@ -123,7 +123,7 @@ org.infinispan - infinispan-server-testdriver-core-jakarta + infinispan-server-testdriver-core test diff --git a/drools-reliability/drools-reliability-tests/src/test/java/org/drools/reliability/test/EmbeddedStorageManagerTest.java b/drools-reliability/drools-reliability-tests/src/test/java/org/drools/reliability/test/EmbeddedStorageManagerTest.java index d00568737ea..60fd4949e76 100644 --- a/drools-reliability/drools-reliability-tests/src/test/java/org/drools/reliability/test/EmbeddedStorageManagerTest.java +++ b/drools-reliability/drools-reliability-tests/src/test/java/org/drools/reliability/test/EmbeddedStorageManagerTest.java @@ -21,16 +21,14 @@ import org.drools.reliability.core.StorageManagerFactory; import org.drools.reliability.core.TestableStorageManager; import org.drools.reliability.infinispan.InfinispanStorageManager; +import org.infinispan.configuration.cache.CacheMode; +import org.infinispan.configuration.cache.ConfigurationBuilder; import org.infinispan.manager.DefaultCacheManager; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledIf; import org.junit.jupiter.api.extension.ExtendWith; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; - import static org.assertj.core.api.Assertions.assertThat; import static org.drools.reliability.core.StorageManagerFactory.SESSION_STORAGE_PREFIX; import static org.drools.reliability.infinispan.InfinispanStorageManagerFactory.INFINISPAN_STORAGE_ALLOWED_PACKAGES; @@ -63,54 +61,29 @@ static boolean isEmbeddedInfinispan() { void removeAllSessionCaches_shouldLeaveNonSessionCache() { ((InfinispanStorageManager) StorageManagerFactory.get().getStorageManager()).setEmbeddedCacheManager(new FakeCacheManager()); - assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).containsExactlyInAnyOrder( - SESSION_STORAGE_PREFIX + "0_" + "epDefault", SESSION_STORAGE_PREFIX + "1_" + "epDefault", "METADATA_0"); - StorageManagerFactory.get().getStorageManager().removeAllSessionStorages(); - assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).containsExactly("METADATA_0"); + assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).contains("METADATA_0"); } @Test void removeCachesBySessionId_shouldRemoveSpecifiedCacheOnly() { ((InfinispanStorageManager) StorageManagerFactory.get().getStorageManager()).setEmbeddedCacheManager(new FakeCacheManager()); - assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).containsExactlyInAnyOrder( - SESSION_STORAGE_PREFIX + "0_" + "epDefault", SESSION_STORAGE_PREFIX + "1_" + "epDefault", "METADATA_0"); - StorageManagerFactory.get().getStorageManager().removeStoragesBySessionId("1"); - assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).containsExactlyInAnyOrder(SESSION_STORAGE_PREFIX + "0_" + "epDefault", "METADATA_0"); + assertThat(StorageManagerFactory.get().getStorageManager().getStorageNames()).contains(SESSION_STORAGE_PREFIX + "0_" + "epDefault", "METADATA_0"); } public static class FakeCacheManager extends DefaultCacheManager { - - private Map cacheMap = new ConcurrentHashMap<>(); - public FakeCacheManager() { - cacheMap.put(SESSION_STORAGE_PREFIX + "0_" + "epDefault", new Object()); - cacheMap.put(SESSION_STORAGE_PREFIX + "1_" + "epDefault", new Object()); - cacheMap.put("METADATA_0", new Object()); - } - @Override - public Set getCacheNames() { - return cacheMap.keySet(); - } - - @Override - public boolean cacheExists(String cacheName) { - return cacheMap.containsKey(cacheName); - } - - @Override - public void removeCache(String cacheName) { - cacheMap.remove(cacheName); - } + ConfigurationBuilder builder = new ConfigurationBuilder(); + builder.clustering().cacheMode(CacheMode.LOCAL); - @Override - public void stop() { - // do nothing + this.createCache(SESSION_STORAGE_PREFIX + "0_" + "epDefault", builder.build()); + this.createCache(SESSION_STORAGE_PREFIX + "1_" + "epDefault", builder.build()); + this.createCache("METADATA_0", builder.build()); } } }