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

Upgrade to Quarkus 3.3.1 #5236

Merged
merged 11 commits into from
Aug 31, 2023
2 changes: 1 addition & 1 deletion docs/antora.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ asciidoc:
# Project versions
camel-version: 4.0.0 # replace ${camel.version}
camel-docs-version: 4.0.x # replace ${camel.docs.components.version}
quarkus-version: 3.2.5.Final # replace ${quarkus.version}
quarkus-version: 3.3.1 # replace ${quarkus.version}
graalvm-version: 23.0.1 # replace ${graalvm.version}
graalvm-docs-version: 22.3
mapstruct-version: 1.5.5.Final # replace ${mapstruct.version}
Expand Down
5 changes: 5 additions & 0 deletions integration-tests/debezium/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<!-- You are required to accept an EULA for SQL container image. We cannot do it by default for legal reasons. -->
<!-- See https://camel.apache.org/camel-quarkus/latest/extensions/debezium-sqlserver.html#_integration-testing for more details -->
<sqlserver.EULA>src/test/resources/container-license-acceptance.txt</sqlserver.EULA>

<!-- TODO: https://github.com/apache/camel-quarkus/issues/5110 -->
<skipTests>true</skipTests>
</properties>

<dependencies>
Expand Down Expand Up @@ -128,6 +131,7 @@


<profiles>
<!-- TODO: https://github.com/apache/camel-quarkus/issues/5110
<profile>
<id>native</id>
<activation>
Expand Down Expand Up @@ -155,6 +159,7 @@
</plugins>
</build>
</profile>
-->
<profile>
<id>mysqlDriver</id>
<activation>
Expand Down
55 changes: 4 additions & 51 deletions integration-tests/groovy-dsl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
<name>Camel Quarkus :: Integration Tests :: Groovy DSL</name>
<description>Integration tests for Camel Groovy DSL extension</description>

<properties>
<quarkus.runner>${project.build.directory}/quarkus-app/quarkus-run.jar</quarkus.runner>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
Expand Down Expand Up @@ -70,18 +67,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-integration-tests-process-executor-support</artifactId>
<scope>test</scope>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
</dependency>
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -185,7 +176,6 @@
</activation>
<properties>
<quarkus.package.type>native</quarkus.package.type>
<quarkus.runner>${project.build.directory}/${project.artifactId}-${project.version}-runner</quarkus.runner>
</properties>
<build>
<plugins>
Expand All @@ -200,43 +190,6 @@
</goals>
</execution>
</executions>
<configuration>
<systemPropertyVariables>
<quarkus.runner>${quarkus.runner}</quarkus.runner>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>full</id>
<activation>
<property>
<name>!quickly</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<!-- Move surefire:test to integration-test phase to be able to run
java -jar target/*runner.jar from a test -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>default-test</id>
<goals>
<goal>test</goal>
</goals>
<phase>integration-test</phase>
<configuration>
<systemPropertyVariables>
<quarkus.runner>${quarkus.runner}</quarkus.runner>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,151 +16,64 @@
*/
package org.apache.camel.quarkus.dsl.groovy;

import java.util.concurrent.TimeUnit;

import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.apache.camel.dsl.groovy.GroovyRoutesBuilderLoader;
import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;
import org.awaitility.Awaitility;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.hamcrest.CoreMatchers;
import org.junit.jupiter.api.Test;
import org.zeroturnaround.exec.StartedProcess;

import static org.assertj.core.api.Assertions.assertThat;

@QuarkusTest
class GroovyDslTest {

private static int port;
private static StartedProcess process;

@BeforeAll
static void start() throws Exception {
// Need to use an external process to test the extension because of a CL issue that happens only on test mode
// due to the fact that groovy is defined as a parent first artifact
QuarkusProcessExecutor quarkusProcessExecutor = new QuarkusProcessExecutor();
process = quarkusProcessExecutor.start();
port = quarkusProcessExecutor.getHttpPort();
awaitStartup();
}

@AfterAll
static void stop() {
if (process != null && process.getProcess().isAlive()) {
process.getProcess().destroy();
}
}

private static String toAbsolutePath(String relativePath) {
return String.format("http://localhost:%d/%s", port, relativePath);
}

private static void awaitStartup() {
Awaitility.await().atMost(10, TimeUnit.SECONDS).pollDelay(1, TimeUnit.SECONDS).until(() -> {
HttpUriRequest request = new HttpGet(toAbsolutePath("/groovy-dsl"));
try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
HttpResponse httpResponse = client.execute(request);
return httpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
} catch (Exception e) {
return false;
}
});
}

@Test
void groovyHello() throws Exception {
try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
// Given
HttpPost httpPost = new HttpPost(toAbsolutePath("/groovy-dsl/hello"));
httpPost.setEntity(new StringEntity("John Smith", ContentType.TEXT_PLAIN));

// When
HttpResponse httpResponse = client.execute(httpPost);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEqualTo("Hello John Smith from Groovy!");
}
void groovyHello() {
RestAssured.given()
.body("John Smith")
.post("/groovy-dsl/hello")
.then()
.statusCode(200)
.body(CoreMatchers.is("Hello John Smith from Groovy!"));
}

@Test
void testMainInstanceWithJavaRoutes() throws Exception {
try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
// Given
HttpUriRequest request = new HttpGet(toAbsolutePath("/groovy-dsl/main/groovyRoutesBuilderLoader"));

// When
HttpResponse httpResponse = client.execute(request);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEqualTo(GroovyRoutesBuilderLoader.class.getName());

// Given
request = new HttpGet(toAbsolutePath("/groovy-dsl/main/routeBuilders"));

// When
httpResponse = client.execute(request);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEmpty();

// Given
request = new HttpGet(toAbsolutePath("/groovy-dsl/main/routes"));

// When
httpResponse = client.execute(request);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEqualTo(
"my-groovy-route,routes-with-components-configuration,routes-with-dataformats-configuration,routes-with-eip-body,routes-with-eip-exchange,routes-with-eip-message,routes-with-eip-process,routes-with-eip-setBody,routes-with-endpoint-dsl,routes-with-error-handler,routes-with-languages-configuration,routes-with-rest,routes-with-rest-dsl-get,routes-with-rest-dsl-post,routes-with-rest-get,routes-with-rest-post");

// Given
request = new HttpGet(toAbsolutePath("/groovy-dsl/main/successful/routes"));

// When
httpResponse = client.execute(request);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEqualTo("10");
}
void testMainInstanceWithJavaRoutes() {
RestAssured.given()
.get("/groovy-dsl/main/groovyRoutesBuilderLoader")
.then()
.statusCode(200)
.body(CoreMatchers.is(GroovyRoutesBuilderLoader.class.getName()));

RestAssured.given()
.get("/groovy-dsl/main/routeBuilders")
.then()
.statusCode(200)
.body(CoreMatchers.is(""));

RestAssured.given()
.get("/groovy-dsl/main/routes")
.then()
.statusCode(200)
.body(CoreMatchers.is(
"my-groovy-route,routes-with-components-configuration,routes-with-dataformats-configuration,routes-with-eip-body,routes-with-eip-exchange,routes-with-eip-message,routes-with-eip-process,routes-with-eip-setBody,routes-with-endpoint-dsl,routes-with-error-handler,routes-with-languages-configuration,routes-with-rest,routes-with-rest-dsl-get,routes-with-rest-dsl-post,routes-with-rest-get,routes-with-rest-post"));
RestAssured.given()
.get("/groovy-dsl/main/successful/routes")
.then()
.statusCode(200)
.body(CoreMatchers.is("10"));
}

@Test
void testRestEndpoints() throws Exception {
try (CloseableHttpClient client = HttpClientBuilder.create().build()) {
// Given
final HttpGet httpGet = new HttpGet(toAbsolutePath("/root/my/path/get"));

// When
HttpResponse httpResponse = client.execute(httpGet);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEqualTo("Hello World");

// Given
HttpPost httpPost = new HttpPost(toAbsolutePath("/root/post"));
httpPost.setEntity(new StringEntity("Will", ContentType.TEXT_PLAIN));

// When
httpResponse = client.execute(httpPost);

// Then
assertThat(httpResponse.getStatusLine().getStatusCode()).isEqualTo(HttpStatus.SC_OK);
assertThat(EntityUtils.toString(httpResponse.getEntity())).isEqualTo("Hello Will");
}
void testRestEndpoints() {
RestAssured.given()
.get("/root/my/path/get")
.then()
.statusCode(200)
.body(CoreMatchers.is("Hello World"));
RestAssured.given()
.body("Will")
.post("/root/post")
.then()
.statusCode(200)
.body(CoreMatchers.is("Hello Will"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* limitations under the License.
*/

import java.util.HashMap;
import java.util.Map;

import jakarta.inject.Named;
Expand All @@ -36,7 +37,8 @@ public class InfinispanRoutes extends InfinispanCommonRoutes {
@Produces
@Named("additionalConfig")
Map<String, String> additionalInfinispanConfig() {
Map<String, String> config = Map.of(MARSHALLER, ProtoStreamMarshaller.class.getName());
Map<String, String> config = new HashMap<>();
config.put(MARSHALLER, ProtoStreamMarshaller.class.getName());
if (OS.getCurrentOs().equals(OS.MAC_OS) || OS.getCurrentOs().equals(OS.WINDOWS)) {
config.put(CLIENT_INTELLIGENCE, "BASIC");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
package org.apache.camel.quarkus.component.opentelemetry.it;

import io.quarkus.test.junit.QuarkusIntegrationTest;
import org.junit.jupiter.api.Disabled;

@QuarkusIntegrationTest
@Disabled //https://github.com/apache/camel-quarkus/issues/5240
class OpenTelemetryIT extends OpenTelemetryTest {

}
4 changes: 2 additions & 2 deletions integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
<module>headersmap</module>
<module>hl7</module>
<module>http-grouped</module>
<module>infinispan</module>
<!-- <module>infinispan</module> https://github.com/apache/camel-quarkus/issues/5237 -->
<module>infinispan-common</module>
<module>infinispan-quarkus-client</module>
<!-- <module>infinispan-quarkus-client</module> https://github.com/apache/camel-quarkus/issues/5237 -->
<module>influxdb</module>
<module>jackson-avro</module>
<module>jackson-protobuf</module>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
package org.apache.camel.quarkus.component.quartz.it;

import io.quarkus.test.junit.QuarkusIntegrationTest;
import org.junit.jupiter.api.Disabled;

@QuarkusIntegrationTest
@Disabled // https://github.com/apache/camel-quarkus/issues/5241
class QuartzClusteredIT extends QuartzClusteredTest {

}
Loading