You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2024/03/12 15:55:57 UTC

(camel-quarkus) branch main updated: Move main-xml-io-with-beans tests into main-xml-io

This is an automated email from the ASF dual-hosted git repository.

jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git


The following commit(s) were added to refs/heads/main by this push:
     new ba5d6006e2 Move main-xml-io-with-beans tests into main-xml-io
ba5d6006e2 is described below

commit ba5d6006e2470564374fbdbf9e1d3929b1fffc80
Author: James Netherton <ja...@gmail.com>
AuthorDate: Tue Mar 12 10:49:09 2024 +0000

    Move main-xml-io-with-beans tests into main-xml-io
---
 integration-tests/main-xml-io-with-beans/pom.xml   | 152 ---------------------
 .../main/CoreMainXmlIoWithBeansResource.java       |  52 -------
 .../src/main/resources/application.properties      |  29 ----
 .../quarkus/main/CoreMainXmlIoWithBeansIT.java     |  23 ----
 .../quarkus/main/CoreMainXmlIoWithBeansTest.java   |  39 ------
 integration-tests/main-xml-io/pom.xml              |  17 +++
 .../java/org/apache/camel/quarkus/main/MyBean.java |   0
 .../src/main/resources/application.properties      |   2 +-
 .../resources/routes/my-route-with-beanType.xml    |   0
 .../camel/quarkus/main/CoreMainXmlIoTest.java      |  10 ++
 integration-tests/pom.xml                          |   1 -
 tooling/scripts/test-categories.yaml               |   1 -
 12 files changed, 28 insertions(+), 298 deletions(-)

diff --git a/integration-tests/main-xml-io-with-beans/pom.xml b/integration-tests/main-xml-io-with-beans/pom.xml
deleted file mode 100644
index 39e4d9004b..0000000000
--- a/integration-tests/main-xml-io-with-beans/pom.xml
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.camel.quarkus</groupId>
-        <artifactId>camel-quarkus-build-parent-it</artifactId>
-        <version>3.9.0-SNAPSHOT</version>
-        <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
-    </parent>
-
-    <artifactId>camel-quarkus-integration-test-main-xml-io-with-beans</artifactId>
-    <name>Camel Quarkus :: Integration Tests :: Main XML Io With Beans :: Tests</name>
-    <description>The camel integration tests</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-xml-io-dsl</artifactId>
-       </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-bean</artifactId>
-       </dependency>
-        <dependency>
-            <groupId>org.apache.camel.quarkus</groupId>
-            <artifactId>camel-quarkus-direct</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy</artifactId>
-        </dependency>
-
-        <!-- test dependencies -->
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-junit5</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.rest-assured</groupId>
-            <artifactId>rest-assured</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.assertj</groupId>
-            <artifactId>assertj-core</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-    </dependencies>
-
-
-    <profiles>
-        <profile>
-            <id>native</id>
-            <activation>
-                <property>
-                    <name>native</name>
-                </property>
-            </activation>
-            <properties>
-                <quarkus.package.type>native</quarkus.package.type>
-            </properties>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-failsafe-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <goals>
-                                    <goal>integration-test</goal>
-                                    <goal>verify</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <profile>
-            <id>virtualDependencies</id>
-            <activation>
-                <property>
-                    <name>!noVirtualDependencies</name>
-                </property>
-            </activation>
-            <dependencies>
-                <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
-                <dependency>
-                    <groupId>org.apache.camel.quarkus</groupId>
-                    <artifactId>camel-quarkus-xml-io-dsl-deployment</artifactId>
-                    <version>${project.version}</version>
-                    <type>pom</type>
-                    <scope>test</scope>
-                    <exclusions>
-                        <exclusion>
-                            <groupId>*</groupId>
-                            <artifactId>*</artifactId>
-                        </exclusion>
-                    </exclusions>
-                </dependency>
-                <dependency>
-                    <groupId>org.apache.camel.quarkus</groupId>
-                    <artifactId>camel-quarkus-bean-deployment</artifactId>
-                    <version>${project.version}</version>
-                    <type>pom</type>
-                    <scope>test</scope>
-                    <exclusions>
-                        <exclusion>
-                            <groupId>*</groupId>
-                            <artifactId>*</artifactId>
-                        </exclusion>
-                    </exclusions>
-                </dependency>
-                <dependency>
-                    <groupId>org.apache.camel.quarkus</groupId>
-                    <artifactId>camel-quarkus-direct-deployment</artifactId>
-                    <version>${project.version}</version>
-                    <type>pom</type>
-                    <scope>test</scope>
-                    <exclusions>
-                        <exclusion>
-                            <groupId>*</groupId>
-                            <artifactId>*</artifactId>
-                        </exclusion>
-                    </exclusions>
-                </dependency>
-            </dependencies>
-        </profile>
-    </profiles>
-
-
-</project>
diff --git a/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java b/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java
deleted file mode 100644
index 2cb837359e..0000000000
--- a/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansResource.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.main;
-
-import java.util.AbstractMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.stream.Collectors;
-
-import jakarta.enterprise.context.ApplicationScoped;
-import jakarta.inject.Inject;
-import jakarta.ws.rs.Consumes;
-import jakarta.ws.rs.POST;
-import jakarta.ws.rs.Path;
-import jakarta.ws.rs.PathParam;
-import jakarta.ws.rs.Produces;
-import jakarta.ws.rs.core.Context;
-import jakarta.ws.rs.core.MediaType;
-import jakarta.ws.rs.core.UriInfo;
-import org.apache.camel.ProducerTemplate;
-
-@Path("/xml-io-with-beans")
-@ApplicationScoped
-public class CoreMainXmlIoWithBeansResource {
-    @Inject
-    ProducerTemplate producerTemplate;
-
-    @Path("/route/{route}")
-    @POST
-    @Consumes(MediaType.TEXT_PLAIN)
-    @Produces(MediaType.TEXT_PLAIN)
-    public String route(String body, @PathParam("route") String route, @Context UriInfo uriInfo) {
-        final Map<String, Object> headers = uriInfo.getQueryParameters().entrySet().stream()
-                .map(e -> new AbstractMap.SimpleImmutableEntry<String, Object>(e.getKey(), e.getValue().get(0)))
-                .collect(Collectors.toMap(Entry::getKey, Entry::getValue));
-        return producerTemplate.requestBodyAndHeaders("direct:" + route, body, headers, String.class);
-    }
-}
diff --git a/integration-tests/main-xml-io-with-beans/src/main/resources/application.properties b/integration-tests/main-xml-io-with-beans/src/main/resources/application.properties
deleted file mode 100644
index ba1ed3554e..0000000000
--- a/integration-tests/main-xml-io-with-beans/src/main/resources/application.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-## ---------------------------------------------------------------------------
-## Licensed to the Apache Software Foundation (ASF) under one or more
-## contributor license agreements.  See the NOTICE file distributed with
-## this work for additional information regarding copyright ownership.
-## The ASF licenses this file to You under the Apache License, Version 2.0
-## (the "License"); you may not use this file except in compliance with
-## the License.  You may obtain a copy of the License at
-##
-##      http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing, software
-## distributed under the License is distributed on an "AS IS" BASIS,
-## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-## See the License for the specific language governing permissions and
-## limitations under the License.
-## ---------------------------------------------------------------------------
-
-#
-# Quarkus
-#
-
-#
-# Camel
-#
-
-#
-# Main
-#
-camel.main.routes-include-pattern = routes/my-route-with-beanType.xml
diff --git a/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java b/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java
deleted file mode 100644
index cb6c749be6..0000000000
--- a/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansIT.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.main;
-
-import io.quarkus.test.junit.QuarkusIntegrationTest;
-
-@QuarkusIntegrationTest
-public class CoreMainXmlIoWithBeansIT extends CoreMainXmlIoWithBeansTest {
-}
diff --git a/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java b/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java
deleted file mode 100644
index 3f195efb88..0000000000
--- a/integration-tests/main-xml-io-with-beans/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoWithBeansTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.quarkus.main;
-
-import io.quarkus.test.junit.QuarkusTest;
-import io.restassured.RestAssured;
-import io.restassured.http.ContentType;
-import org.hamcrest.Matchers;
-import org.junit.jupiter.api.Test;
-
-@QuarkusTest
-public class CoreMainXmlIoWithBeansTest {
-
-    @Test
-    public void beanTypeShouldSucceed() {
-        RestAssured.given()
-                .contentType(ContentType.TEXT)
-                .body("beanTypeShouldSucceed")
-                .post("/xml-io-with-beans/route/withBeanType")
-                .then()
-                .statusCode(200)
-                .body(Matchers.is("beanTypeShouldSucceed-handled-by-MyBean"));
-    }
-
-}
diff --git a/integration-tests/main-xml-io/pom.xml b/integration-tests/main-xml-io/pom.xml
index d73591ce54..a2bb1f2dcf 100644
--- a/integration-tests/main-xml-io/pom.xml
+++ b/integration-tests/main-xml-io/pom.xml
@@ -35,6 +35,10 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-xml-io-dsl</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-bean</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-direct</artifactId>
@@ -122,6 +126,19 @@
             </activation>
             <dependencies>
                 <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
+                <dependency>
+                    <groupId>org.apache.camel.quarkus</groupId>
+                    <artifactId>camel-quarkus-bean-deployment</artifactId>
+                    <version>${project.version}</version>
+                    <type>pom</type>
+                    <scope>test</scope>
+                    <exclusions>
+                        <exclusion>
+                            <groupId>*</groupId>
+                            <artifactId>*</artifactId>
+                        </exclusion>
+                    </exclusions>
+                </dependency>
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-direct-deployment</artifactId>
diff --git a/integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/MyBean.java b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/MyBean.java
similarity index 100%
rename from integration-tests/main-xml-io-with-beans/src/main/java/org/apache/camel/quarkus/main/MyBean.java
rename to integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/MyBean.java
diff --git a/integration-tests/main-xml-io/src/main/resources/application.properties b/integration-tests/main-xml-io/src/main/resources/application.properties
index dc6c310269..58f52b443c 100644
--- a/integration-tests/main-xml-io/src/main/resources/application.properties
+++ b/integration-tests/main-xml-io/src/main/resources/application.properties
@@ -29,4 +29,4 @@ camel.rest.component = platform-http
 #
 # Main
 #
-camel.main.routes-include-pattern = routes/my-routes.xml,routes/my-routes-iso_8859_15.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
+camel.main.routes-include-pattern = routes/my-routes.xml,routes/my-routes-iso_8859_15.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml,routes/my-route-with-beanType.xml
diff --git a/integration-tests/main-xml-io-with-beans/src/main/resources/routes/my-route-with-beanType.xml b/integration-tests/main-xml-io/src/main/resources/routes/my-route-with-beanType.xml
similarity index 100%
rename from integration-tests/main-xml-io-with-beans/src/main/resources/routes/my-route-with-beanType.xml
rename to integration-tests/main-xml-io/src/main/resources/routes/my-route-with-beanType.xml
diff --git a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
index 4c1189adb5..f575a55670 100644
--- a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
+++ b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/main/CoreMainXmlIoTest.java
@@ -108,4 +108,14 @@ public class CoreMainXmlIoTest {
                 .body(Matchers.is("Hello World from ISO-8859-15 encoded route containing € symbol !"));
     }
 
+    @Test
+    public void beanTypeShouldSucceed() {
+        RestAssured.given()
+                .contentType(ContentType.TEXT)
+                .body("beanTypeShouldSucceed")
+                .post("/xml-io/route/withBeanType")
+                .then()
+                .statusCode(200)
+                .body(Matchers.is("beanTypeShouldSucceed-handled-by-MyBean"));
+    }
 }
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index 1c4744b6a4..4b1248122c 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -45,7 +45,6 @@
         <module>main-discovery-disabled</module>
         <module>main-xml-jaxb</module>
         <module>main-xml-io</module>
-        <module>main-xml-io-with-beans</module>
         <module>main-collector</module>
         <module>main-command-mode</module>
         <module>main-unknown-args-fail</module>
diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml
index 797ff70c64..403a15ab71 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -62,7 +62,6 @@ group-03:
   - main-devmode
   - main-discovery-disabled
   - main-xml-io
-  - main-xml-io-with-beans
   - main-xml-jaxb
   - main-yaml
   - shiro