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

[incubator-kie-issues#1575] Upgrade quarkus to 3.15 #6131

Open
wants to merge 4 commits into
base: main
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
40 changes: 33 additions & 7 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@
<version.com.miglayout>3.7.4</version.com.miglayout>
<version.domino-slf4j-logger>1.0.1</version.domino-slf4j-logger>
<version.com.google.protobuf>3.25.5</version.com.google.protobuf>
<version.com.h2database>2.2.220</version.com.h2database>
<version.com.h2database>2.3.232</version.com.h2database>
<version.com.networknt.json-schema-validator>1.0.86</version.com.networknt.json-schema-validator>
<version.com.sun.xml.bind>4.0.4</version.com.sun.xml.bind>
<version.com.sun.xml.bind>4.0.5</version.com.sun.xml.bind>
<version.com.thoughtworks.xstream>1.4.21</version.com.thoughtworks.xstream>
<version.guru.nidi>0.18.0</version.guru.nidi>
<version.info.picocli>4.7.5</version.info.picocli>
<version.io.micrometer>1.12.2</version.io.micrometer>
<version.io.quarkus>3.8.6</version.io.quarkus>
<version.io.quarkus>3.15.2</version.io.quarkus>
<version.io.smallrye.openapi.core>3.10.0</version.io.smallrye.openapi.core>
<version.it.unimi.dsi.fastutil>8.5.11</version.it.unimi.dsi.fastutil>
<version.junit>4.13.1</version.junit>
Expand All @@ -99,7 +99,8 @@
<!--This needs to be in sync with JUnit-->
<version.org.hamcrest>2.2</version.org.hamcrest>
<version.org.hsqldb>2.3.0</version.org.hsqldb>
<version.org.infinispan>14.0.25.Final</version.org.infinispan>
<version.org.infinispan>15.0.8.Final</version.org.infinispan>
<version.org.infinispan.protostream>5.0.8.Final</version.org.infinispan.protostream>
<version.org.javassist>3.26.0-GA</version.org.javassist>
<version.org.jboss.narayana.tomcat>7.0.2.Final</version.org.jboss.narayana.tomcat>
<version.org.jboss.logging>3.5.3.Final</version.org.jboss.logging>
Expand Down Expand Up @@ -190,10 +191,10 @@

<version.net.byte-buddy>1.14.11</version.net.byte-buddy>

<version.org.postgresql>42.7.2</version.org.postgresql>
<version.org.postgresql>42.7.4</version.org.postgresql>

<version.ch.obermuhlner>2.0.1</version.ch.obermuhlner>
<version.io.smallrye.jandex>3.1.6</version.io.smallrye.jandex>
<version.io.smallrye.jandex>3.2.2</version.io.smallrye.jandex>
<version.org.eclipse.yasson>3.0.3</version.org.eclipse.yasson>

<version.com.github.javaparser>3.25.8</version.com.github.javaparser>
Expand Down Expand Up @@ -749,7 +750,32 @@
<version>${version.org.javassist}</version>
</dependency>


<!-- infinispan -->
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core</artifactId>
<version>${version.org.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod</artifactId>
<version>${version.org.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-testdriver-core</artifactId>
<version>${version.org.infinispan}</version>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream</artifactId>
<version>${version.org.infinispan.protostream}</version>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
<artifactId>protostream-processor</artifactId>
<version>${version.org.infinispan.protostream}</version>
</dependency>
<!-- Do not add mockito-all as it is uberjar! -->
<dependency>
<groupId>org.mockito</groupId>
Expand Down
2 changes: 1 addition & 1 deletion drools-quarkus-extension/drools-quarkus-deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive-spi-deployment</artifactId>
<artifactId>quarkus-rest-server-spi-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
<artifactId>quarkus-messaging-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
Expand All @@ -78,6 +78,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<scope>test</scope>
</dependency>

<!-- this is used implicitly by quarkus tests so let's make Maven aware
of it -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -46,6 +51,7 @@ public void sendEvents() {
incomingEvents.send(new Event("temperature", 20));
incomingEvents.send(new Event("temperature", 40));

await().<List<? extends Message<Alert>>>until(outgoingAlerts::received, t -> t.size() == 1);
assertThat(outgoingAlerts.received().size()).isEqualTo(1);
assertThat(outgoingAlerts.received().get(0).getPayload().getSeverity()).isEqualTo("warning");

Expand Down
4 changes: 2 additions & 2 deletions drools-reliability/drools-reliability-infinispan/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<dependencies>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-core-jakarta</artifactId>
<artifactId>infinispan-core</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan.protostream</groupId>
Expand All @@ -61,7 +61,7 @@
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-client-hotrod-jakarta</artifactId>
<artifactId>infinispan-client-hotrod</artifactId>
</dependency>
<dependency>
<groupId>org.drools</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -113,7 +109,7 @@ public void close() {
@Override
public void removeStorage(String storageName) {
if (embeddedCacheManager.cacheExists(storageName)) {
embeddedCacheManager.removeCache(storageName);
embeddedCacheManager.administration().removeCache(storageName);
}
}

Expand Down Expand Up @@ -176,6 +172,7 @@ public void setEmbeddedCacheManager(DefaultCacheManager embeddedCacheManager) {
this.embeddedCacheManager.stop();
}
this.embeddedCacheManager = embeddedCacheManager;

}

// test purpose to remove GlobalState and FileStore
Expand Down
4 changes: 2 additions & 2 deletions drools-reliability/drools-reliability-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

<properties>
<java.module.name>org.drools.reliability.infinispan</java.module.name>
<version.testcontainers>1.17.2</version.testcontainers>
<version.testcontainers>1.20.1</version.testcontainers>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -123,7 +123,7 @@

<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-testdriver-core-jakarta</artifactId>
<artifactId>infinispan-server-testdriver-core</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String, Object> 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<String> 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());
}
}
}
Loading