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 2023/02/17 21:08:01 UTC
[camel-quarkus] 03/08: Use XML DSL to define templated route in integration test
This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch 2.13.x
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
commit b324920bf5d861d450b67fd327ac2ebfed7db271
Author: Tomas Turek <tt...@redhat.com>
AuthorDate: Mon Feb 13 14:24:43 2023 +0100
Use XML DSL to define templated route in integration test
Signed-off-by: Tomas Turek <tt...@redhat.com>
---
.../camel/quarkus/main/CoreMainXmlIoResource.java | 7 ------
.../src/main/resources/application.properties | 2 +-
.../src/main/resources/routes/my-templated.xml | 25 ++++++++++++++++++++++
3 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
index 51cb960d23..50fcdae936 100644
--- a/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
+++ b/integration-tests/main-xml-io/src/main/java/org/apache/camel/quarkus/main/CoreMainXmlIoResource.java
@@ -38,7 +38,6 @@ import javax.ws.rs.core.UriInfo;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.ProducerTemplate;
-import org.apache.camel.builder.TemplatedRouteBuilder;
import org.apache.camel.dsl.xml.io.XmlRoutesBuilderLoader;
import org.apache.camel.spi.RoutesBuilderLoader;
@@ -63,12 +62,6 @@ public class CoreMainXmlIoResource {
JsonArrayBuilder routeBuilders = Json.createArrayBuilder();
main.configure().getRoutesBuilders().forEach(builder -> routeBuilders.add(builder.getClass().getName()));
- TemplatedRouteBuilder.builder(main.getCamelContext(), "myTemplate")
- .parameter("name", "Camel Quarkus")
- .parameter("greeting", "Hello")
- .routeId("templated-route")
- .add();
-
JsonArrayBuilder routes = Json.createArrayBuilder();
main.getCamelContext().getRoutes().forEach(route -> routes.add(route.getId()));
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 2ff43c93ac..d02938b70c 100644
--- a/integration-tests/main-xml-io/src/main/resources/application.properties
+++ b/integration-tests/main-xml-io/src/main/resources/application.properties
@@ -28,4 +28,4 @@ camel.rest.component = platform-http
#
# Main
#
-camel.main.routes-include-pattern = routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml
+camel.main.routes-include-pattern = routes/my-routes.xml,classpath:rests/my-rests.xml,classpath:templates/my-templates.xml,classpath:routes/my-templated.xml
diff --git a/integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml b/integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml
new file mode 100644
index 0000000000..adb162fc94
--- /dev/null
+++ b/integration-tests/main-xml-io/src/main/resources/routes/my-templated.xml
@@ -0,0 +1,25 @@
+<?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.
+
+-->
+<templatedRoutes xmlns="http://camel.apache.org/schema/spring">
+ <templatedRoute routeId="templated-route" routeTemplateRef="myTemplate">
+ <parameter name="name" value="Camel Quarkus"/>
+ <parameter name="greeting" value="Hello"/>
+ </templatedRoute>
+</templatedRoutes>