camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lburgazz...@apache.org
Subject [camel-quarkus] branch master updated: Drop the Jaxb based XMLRoutesDefinitionLoader #1291
Date Mon, 01 Jun 2020 17:03:34 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 498d6b5  Drop the Jaxb based XMLRoutesDefinitionLoader #1291
498d6b5 is described below

commit 498d6b568484684ed5a0e6356e89e5b9184db07a
Author: lburgazzoli <lburgazzoli@gmail.com>
AuthorDate: Mon Jun 1 14:20:54 2020 +0200

    Drop the Jaxb based XMLRoutesDefinitionLoader #1291
---
 .../core/DisabledXMLRoutesDefinitionLoader.java    |  6 +--
 extensions-core/xml-io/deployment/pom.xml          | 47 ++++++++++++++++++++++
 .../xml/io}/deployment/CamelDevModeTest.java       |  2 +-
 .../xml/io}/deployment/CamelSupportResource.java   |  2 +-
 .../deployment/src/test/resources/routes.1         |  0
 .../deployment/src/test/resources/routes.2         |  0
 extensions-core/xml-jaxb/deployment/pom.xml        | 46 ---------------------
 .../xml/jaxb/deployment/XmlJaxbProcessor.java      |  7 ----
 .../component/xml/jaxb/XmlJaxbRecorder.java        |  6 ---
 integration-tests/dataformats-json/pom.xml         |  4 ++
 .../camel/quarkus/core/CoreMainXmlIoResource.java  |  7 +---
 .../camel/quarkus/core/CoreMainXmlIoTest.java      |  1 +
 integration-tests/main-xml-jaxb/pom.xml            |  4 ++
 .../quarkus/core/CoreMainXmlJaxbResource.java      |  7 +---
 .../camel/quarkus/core/CoreMainXmlJaxbTest.java    |  5 ++-
 15 files changed, 66 insertions(+), 78 deletions(-)

diff --git a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
index 8adaf8d..904d50d 100644
--- a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
+++ b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/core/DisabledXMLRoutesDefinitionLoader.java
@@ -25,16 +25,16 @@ import org.apache.camel.spi.XMLRoutesDefinitionLoader;
 public class DisabledXMLRoutesDefinitionLoader implements XMLRoutesDefinitionLoader {
     @Override
     public Object loadRoutesDefinition(CamelContext context, InputStream inputStream) throws
Exception {
-        throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-jaxb
or camel-quarkus-xml-io");
+        throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io");
     }
 
     @Override
     public Object loadRestsDefinition(CamelContext context, InputStream inputStream) throws
Exception {
-        throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-jaxb
or camel-quarkus-xml-io");
+        throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io");
     }
 
     @Override
     public <T extends NamedNode> T createModelFromXml(CamelContext context, String
xml, Class<T> type) throws Exception {
-        throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-jaxb
or camel-quarkus-xml-io");
+        throw new UnsupportedOperationException("Please add a dependency to camel-quarkus-xml-io");
     }
 }
diff --git a/extensions-core/xml-io/deployment/pom.xml b/extensions-core/xml-io/deployment/pom.xml
index 13a3af7..25cd12e 100644
--- a/extensions-core/xml-io/deployment/pom.xml
+++ b/extensions-core/xml-io/deployment/pom.xml
@@ -50,6 +50,53 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-xml-io</artifactId>
         </dependency>
+
+
+        <!-- test dependencies -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-direct</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy-deployment</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-resteasy-jsonb-deployment</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>io.quarkus</groupId>
+            <artifactId>quarkus-junit5-internal</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>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.hamcrest</groupId>
+                    <artifactId>hamcrest-core</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
     </dependencies>
 
     <build>
diff --git a/extensions-core/xml-jaxb/deployment/src/test/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/CamelDevModeTest.java
b/extensions-core/xml-io/deployment/src/test/java/org/apache/camel/quarkus/component/xml/io/deployment/CamelDevModeTest.java
similarity index 98%
rename from extensions-core/xml-jaxb/deployment/src/test/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/CamelDevModeTest.java
rename to extensions-core/xml-io/deployment/src/test/java/org/apache/camel/quarkus/component/xml/io/deployment/CamelDevModeTest.java
index 752b032..63dc6f2 100644
--- a/extensions-core/xml-jaxb/deployment/src/test/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/CamelDevModeTest.java
+++ b/extensions-core/xml-io/deployment/src/test/java/org/apache/camel/quarkus/component/xml/io/deployment/CamelDevModeTest.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.xml.jaxb.deployment;
+package org.apache.camel.quarkus.component.xml.io.deployment;
 
 import java.io.File;
 import java.io.IOException;
diff --git a/extensions-core/xml-jaxb/deployment/src/test/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/CamelSupportResource.java
b/extensions-core/xml-io/deployment/src/test/java/org/apache/camel/quarkus/component/xml/io/deployment/CamelSupportResource.java
similarity index 96%
rename from extensions-core/xml-jaxb/deployment/src/test/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/CamelSupportResource.java
rename to extensions-core/xml-io/deployment/src/test/java/org/apache/camel/quarkus/component/xml/io/deployment/CamelSupportResource.java
index 1aa33fc..4f008c0 100644
--- a/extensions-core/xml-jaxb/deployment/src/test/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/CamelSupportResource.java
+++ b/extensions-core/xml-io/deployment/src/test/java/org/apache/camel/quarkus/component/xml/io/deployment/CamelSupportResource.java
@@ -14,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.camel.quarkus.component.xml.jaxb.deployment;
+package org.apache.camel.quarkus.component.xml.io.deployment;
 
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
diff --git a/extensions-core/xml-jaxb/deployment/src/test/resources/routes.1 b/extensions-core/xml-io/deployment/src/test/resources/routes.1
similarity index 100%
rename from extensions-core/xml-jaxb/deployment/src/test/resources/routes.1
rename to extensions-core/xml-io/deployment/src/test/resources/routes.1
diff --git a/extensions-core/xml-jaxb/deployment/src/test/resources/routes.2 b/extensions-core/xml-io/deployment/src/test/resources/routes.2
similarity index 100%
rename from extensions-core/xml-jaxb/deployment/src/test/resources/routes.2
rename to extensions-core/xml-io/deployment/src/test/resources/routes.2
diff --git a/extensions-core/xml-jaxb/deployment/pom.xml b/extensions-core/xml-jaxb/deployment/pom.xml
index 1722bf5..54ebf46 100644
--- a/extensions-core/xml-jaxb/deployment/pom.xml
+++ b/extensions-core/xml-jaxb/deployment/pom.xml
@@ -58,52 +58,6 @@
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-jaxb-deployment</artifactId>
         </dependency>
-
-        <!-- test dependencies -->
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-direct</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy-deployment</artifactId>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-resteasy-jsonb-deployment</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>io.quarkus</groupId>
-            <artifactId>quarkus-junit5-internal</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>
-        <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <scope>test</scope>
-            <exclusions>
-                <exclusion>
-                    <groupId>org.hamcrest</groupId>
-                    <artifactId>hamcrest-core</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
     </dependencies>
 
     <build>
diff --git a/extensions-core/xml-jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/XmlJaxbProcessor.java
b/extensions-core/xml-jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/XmlJaxbProcessor.java
index 9aa2ff4..01e3d45 100644
--- a/extensions-core/xml-jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/XmlJaxbProcessor.java
+++ b/extensions-core/xml-jaxb/deployment/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/deployment/XmlJaxbProcessor.java
@@ -28,7 +28,6 @@ import io.quarkus.jaxb.deployment.JaxbFileRootBuildItem;
 import org.apache.camel.quarkus.component.xml.jaxb.XmlJaxbRecorder;
 import org.apache.camel.quarkus.core.deployment.spi.CamelModelJAXBContextFactoryBuildItem;
 import org.apache.camel.quarkus.core.deployment.spi.CamelModelToXMLDumperBuildItem;
-import org.apache.camel.quarkus.core.deployment.spi.CamelRoutesLoaderBuildItems;
 import org.apache.camel.quarkus.core.deployment.util.CamelSupport;
 import org.apache.camel.quarkus.support.common.CamelCapabilities;
 
@@ -61,12 +60,6 @@ class XmlJaxbProcessor {
 
     @BuildStep
     @Record(value = ExecutionTime.STATIC_INIT, optional = true)
-    CamelRoutesLoaderBuildItems.Xml xmlLoader(XmlJaxbRecorder recorder) {
-        return new CamelRoutesLoaderBuildItems.Xml(recorder.newJaxbXMLRoutesDefinitionLoader());
-    }
-
-    @BuildStep
-    @Record(value = ExecutionTime.STATIC_INIT, optional = true)
     CamelModelToXMLDumperBuildItem xmlModelDumper(XmlJaxbRecorder recorder) {
         return new CamelModelToXMLDumperBuildItem(recorder.newJaxbModelToXMLDumper());
     }
diff --git a/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
b/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
index 260da00..65ce5ba 100644
--- a/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
+++ b/extensions-core/xml-jaxb/runtime/src/main/java/org/apache/camel/quarkus/component/xml/jaxb/XmlJaxbRecorder.java
@@ -23,10 +23,8 @@ import io.quarkus.runtime.annotations.Recorder;
 import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.ModelJAXBContextFactory;
 import org.apache.camel.spi.ModelToXMLDumper;
-import org.apache.camel.spi.XMLRoutesDefinitionLoader;
 import org.apache.camel.xml.jaxb.DefaultModelJAXBContextFactory;
 import org.apache.camel.xml.jaxb.JaxbModelToXMLDumper;
-import org.apache.camel.xml.jaxb.JaxbXMLRoutesDefinitionLoader;
 import org.graalvm.nativeimage.ImageInfo;
 
 @Recorder
@@ -44,10 +42,6 @@ public class XmlJaxbRecorder {
         return new RuntimeValue<>(factory);
     }
 
-    public RuntimeValue<XMLRoutesDefinitionLoader> newJaxbXMLRoutesDefinitionLoader()
{
-        return new RuntimeValue<>(new JaxbXMLRoutesDefinitionLoader());
-    }
-
     public RuntimeValue<ModelToXMLDumper> newJaxbModelToXMLDumper() {
         return new RuntimeValue<>(new JaxbModelToXMLDumper());
     }
diff --git a/integration-tests/dataformats-json/pom.xml b/integration-tests/dataformats-json/pom.xml
index fdeca22..d0d2620 100644
--- a/integration-tests/dataformats-json/pom.xml
+++ b/integration-tests/dataformats-json/pom.xml
@@ -42,6 +42,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-xml-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-xml-jaxb</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlIoResource.java
b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlIoResource.java
index a26a354..f1f85db 100644
--- a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlIoResource.java
+++ b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlIoResource.java
@@ -27,19 +27,13 @@ import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
-import org.apache.camel.spi.Registry;
 
 @Path("/test")
 @ApplicationScoped
 public class CoreMainXmlIoResource {
     @Inject
     CamelMain main;
-    @Inject
-    Registry registry;
-    @Inject
-    CamelContext context;
 
     @Path("/main/describe")
     @GET
@@ -67,6 +61,7 @@ public class CoreMainXmlIoResource {
         return Json.createObjectBuilder()
                 .add("xml-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName())
                 .add("xml-model-dumper", camelContext.getModelToXMLDumper().getClass().getName())
+                .add("xml-model-factory", camelContext.getModelJAXBContextFactory().getClass().getName())
                 .add("routes-collector", collector)
                 .add("listeners", listeners)
                 .add("routeBuilders", routeBuilders)
diff --git a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlIoTest.java
b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlIoTest.java
index d89395d..6f5102f 100644
--- a/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlIoTest.java
+++ b/integration-tests/main-xml-io/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlIoTest.java
@@ -41,6 +41,7 @@ public class CoreMainXmlIoTest {
 
         assertThat(p.getString("xml-loader")).isEqualTo(ModelParserXMLRoutesDefinitionLoader.class.getName());
         assertThat(p.getString("xml-model-dumper")).isEqualTo(DisabledModelToXMLDumper.class.getName());
+        assertThat(p.getString("xml-model-factory")).isEqualTo(DisabledModelJAXBContextFactory.class.getName());
 
         assertThat(p.getList("routeBuilders", String.class))
                 .isEmpty();
diff --git a/integration-tests/main-xml-jaxb/pom.xml b/integration-tests/main-xml-jaxb/pom.xml
index b227bc7..3bb7e81 100644
--- a/integration-tests/main-xml-jaxb/pom.xml
+++ b/integration-tests/main-xml-jaxb/pom.xml
@@ -42,6 +42,10 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
+            <artifactId>camel-quarkus-xml-io</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-xml-jaxb</artifactId>
         </dependency>
         <dependency>
diff --git a/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbResource.java
b/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbResource.java
index 4919bed..5b28650 100644
--- a/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbResource.java
+++ b/integration-tests/main-xml-jaxb/src/main/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbResource.java
@@ -27,19 +27,13 @@ import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 import javax.ws.rs.core.MediaType;
 
-import org.apache.camel.CamelContext;
 import org.apache.camel.ExtendedCamelContext;
-import org.apache.camel.spi.Registry;
 
 @Path("/test")
 @ApplicationScoped
 public class CoreMainXmlJaxbResource {
     @Inject
     CamelMain main;
-    @Inject
-    Registry registry;
-    @Inject
-    CamelContext context;
 
     @Path("/main/describe")
     @GET
@@ -67,6 +61,7 @@ public class CoreMainXmlJaxbResource {
         return Json.createObjectBuilder()
                 .add("xml-loader", camelContext.getXMLRoutesDefinitionLoader().getClass().getName())
                 .add("xml-model-dumper", camelContext.getModelToXMLDumper().getClass().getName())
+                .add("xml-model-factory", camelContext.getModelJAXBContextFactory().getClass().getName())
                 .add("routes-collector", collector)
                 .add("listeners", listeners)
                 .add("routeBuilders", routeBuilders)
diff --git a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbTest.java
b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbTest.java
index fe3dcc0..4c55d6b 100644
--- a/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbTest.java
+++ b/integration-tests/main-xml-jaxb/src/test/java/org/apache/camel/quarkus/core/CoreMainXmlJaxbTest.java
@@ -21,8 +21,8 @@ import javax.ws.rs.core.MediaType;
 import io.quarkus.test.junit.QuarkusTest;
 import io.restassured.RestAssured;
 import io.restassured.path.json.JsonPath;
+import org.apache.camel.xml.in.ModelParserXMLRoutesDefinitionLoader;
 import org.apache.camel.xml.jaxb.JaxbModelToXMLDumper;
-import org.apache.camel.xml.jaxb.JaxbXMLRoutesDefinitionLoader;
 import org.junit.jupiter.api.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
@@ -40,8 +40,9 @@ public class CoreMainXmlJaxbTest {
                 .body()
                 .jsonPath();
 
-        assertThat(p.getString("xml-loader")).isEqualTo(JaxbXMLRoutesDefinitionLoader.class.getName());
+        assertThat(p.getString("xml-loader")).isEqualTo(ModelParserXMLRoutesDefinitionLoader.class.getName());
         assertThat(p.getString("xml-model-dumper")).isEqualTo(JaxbModelToXMLDumper.class.getName());
+        assertThat(p.getString("xml-model-factory")).isEqualTo("org.apache.camel.xml.jaxb.DefaultModelJAXBContextFactory");
 
         assertThat(p.getList("routeBuilders", String.class))
                 .isEmpty();


Mime
View raw message