This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit db15d5e7fd11b029ef1c6f87005990acd9ee528e Author: Claus Ibsen <[email protected]> AuthorDate: Wed Feb 25 09:15:40 2026 +0100 CAMEL-16861: Update docs --- .../modules/ROOT/pages/template-engines.adoc | 34 ++++++++++++---------- .../user-manual/modules/ROOT/pages/test-infra.adoc | 18 +++++------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/docs/user-manual/modules/ROOT/pages/template-engines.adoc b/docs/user-manual/modules/ROOT/pages/template-engines.adoc index a9a6bec4f8da..d19b3be8b2f2 100644 --- a/docs/user-manual/modules/ROOT/pages/template-engines.adoc +++ b/docs/user-manual/modules/ROOT/pages/template-engines.adoc @@ -1,28 +1,32 @@ = Template engines -A template engine is a tool that generates text output, such as emails, XML, or code, by combining templates with dynamic data. -In Apache Camel, templates are primarily used to create layouts while dynamically using exchange data. +A template engine is a tool that generates text output, such as emails, XML, JSon or code, by combining templates with dynamic data. +In Camel, templates are primarily used to create layouts while dynamically using data from the current xref:exchange.adoc[]. -Below is a list of the template engines that are provided by Apache Camel. +Below is a list of some of the template engines that are provided by Camel: -[cols="1,1,1,3", options="header"] +[cols="1,1,3", options="header"] |=== -|Template engine |Artifact |Since |Website - -|Chunk |camel-chunk |2.10 |https://github.com/tomj74/chunk-templates[github.com/tomj74/chunk-templates] -|Freemarker |camel-freemarker |2.10 |https://freemarker.apache.org/[freemarker.apache.org] -|JTE |camel-jte |4.4 |https://jte.gg/[jte.gg/] -|MVEL |camel-mvel |2.12 |http://mvel.documentnode.com/[mvel.documentnode.com] -|Mustache |camel-mustache |2.12 |https://mustache.github.io/[mustache.github.io] -|String Template |camel-stringtemplate |1.2 |https://www.stringtemplate.org/[www.stringtemplate.org] -|Thymeleaf |camel-thymeleaf |4.1 |https://www.thymeleaf.org/[www.thymeleaf.org] -|Velocity |camel-velocity |1.2 |https://velocity.apache.org/[velocity.apache.org] +|Template |Artifact |Description +|xref:components::chunk-component.adoc[] |camel-chunk | Transform messages using Chunk templating engine. +|xref:components::freemarker-component.adoc[] |camel-freemarker | Transform messages using FreeMarker templates. +|xref:components::jte-component.adoc[] |camel-jte | Transform messages using a Java based template engine (JTE). +|xref:components::mustache-component.adoc[] | camel-mustache | Transform messages using a Mustache template. +|xref:components::mvel-component.adoc[] | camel-mvel | Transform messages using an MVEL template. +|xref:components::string-template-component.adoc[] | camel-stringtemplate | Transform messages using StringTemplate engine. +|xref:components::thymeleaf-component.adoc[] | camel-thymeleaf | Transform messages using a Thymeleaf template. +|xref:components::velocity-component.adoc[] | camel-velocity | Transform messages using a Velocity template. +|xref:components::xslt-component.adoc[] | camel-xslt | Transforms XML payload using an XSLT template. +|xref:components::xslt-saxon-component.adoc[] | camel-xslt-saxon | Transform XML payloads using an XSLT template using Saxon. |=== +TIP: To see a wider list try Camel JBang to execute: `camel catalog component --filter=transform` from the CLI. + == Which template engine to choose Velocity is a mature template engine with long-term support from Camel. It can be used for text generation, such as emails. -Mustache can be used for similar purposes and is cross-platform. +Mustache can be used for similar purposes and is cross-platform. + For templates that require more conditional logic and XML or HTML output, Freemarker, MVEL, and Thymeleaf are good choices. JTE is known to be fast due to its compile-time template processing. NOTE: These template engines perform directly on the Exchange, if you want to template routes, look at xref:manual::route-template.adoc[Route Templates]. diff --git a/docs/user-manual/modules/ROOT/pages/test-infra.adoc b/docs/user-manual/modules/ROOT/pages/test-infra.adoc index 2c4168bb3040..dcaaaf51e0f1 100644 --- a/docs/user-manual/modules/ROOT/pages/test-infra.adoc +++ b/docs/user-manual/modules/ROOT/pages/test-infra.adoc @@ -19,7 +19,6 @@ check the code for additional details. === Writing A New Test Infrastructure Module - [NOTE] ==== This section is aimed at Camel maintainers that need to write new test infra components. End users can skip this section. @@ -72,7 +71,7 @@ interface. Ideally, there should be two concrete implementations of the services: one of the remote service (if applicable) and another for the container service: -[source, bash] +[source,text] ---- MyService / \ @@ -92,15 +91,13 @@ the service accordingly. The https://github.com/apache/camel/blob/main/test-infra/camel-test-infra-common/src/main/java/org/apache/camel/test/infra/common/services/TestService.java[TestService] interface can be used to integrate the actual Service implementation with JUnit and its lifecycle. -The services should try to minimize the test execution time and resource usage when running. As such, -the https://junit.org/junit5/docs/5.1.1/api/org/junit/jupiter/api/extension/BeforeAllCallback.html[BeforeAllCallback] -and https://junit.org/junit5/docs/5.1.1/api/org/junit/jupiter/api/extension/AfterAllCallback.html[AfterAllCallback] +The services should try to minimize the test execution time and resource usage when running. As such the JUnit `@BeforeAllCallback` and `@AfterAllCallback` should be the preferred extensions whenever possible because they allow the instance of the infrastructure to be static throughout the test execution. [NOTE] ==== -Bear in mind that, according to the https://junit.org/junit5/docs/5.1.1/api/org/junit/jupiter/api/extension/RegisterExtension.html[JUnit 5 extension] +Bear in mind that, according to the https://docs.junit.org/6.0.3/extensions/registering-extensions.html#registration-programmatic[JUnit 6 Extension] model, the time of service initialization may differ depending on whether the service instance is declared as static or not in the test class. As such, the code should make no assumptions as to its time of initialization. ==== @@ -108,7 +105,7 @@ static or not in the test class. As such, the code should make no assumptions as ==== Registering Properties All services should register the properties, via `System.setProperty` that allow access to the services. This is required - to resolve those properties when running tests using the Spring framework. This registration allows the properties +to resolve those properties when running tests using the Spring framework. This registration allows the properties to be resolved in Spring's XML files. This registration is done in the `registerProperties` methods during the service initialization. @@ -172,8 +169,7 @@ On the dependencies above, the dependency version is set to `${project.version}` Camel version when used outside the Camel Core project. ==== -On the test class, add a member variable for the service and annotate it with the https://junit.org/junit5/docs/5.1.1/api/org/junit/jupiter/api/extension/RegisterExtension.html[@RegisterExtension], - to let JUnit 5 manage its lifecycle. +On the test class, add a member variable for the service and annotate it with the `@RegisterExtension` to let JUnit manage its lifecycle. [source,java] ---- @@ -251,7 +247,7 @@ Assuming Podman is properly installed and configured to behave like docker (i.e. On most systems that should be similar to the following command: -[source, console] +[source,bash] ---- export DOCKER_HOST=unix:///run/user/$UID/podman/podman.sock ---- @@ -268,4 +264,4 @@ Some containers don't have images available for all architectures. In this case, 1. use an alternative image from a reputable source if they provide an image for that architecture. 2. create a `Dockerfile` and build your own if the system is available on that arch. -3. disable the tests on that architecture. \ No newline at end of file +3. disable the tests on that architecture.
