You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zh...@apache.org on 2021/12/13 00:50:14 UTC

[camel-quarkus] branch main updated: Fix #3374 to use File.separatorChar when get fqcn from generated … (#3380)

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

zhfeng 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 6731c51  Fix #3374 to use File.separatorChar when get fqcn from generated … (#3380)
6731c51 is described below

commit 6731c512c557e567fe916cd68f40afb143fce1b7
Author: Amos Feng <zh...@gmail.com>
AuthorDate: Mon Dec 13 08:49:59 2021 +0800

    Fix #3374 to use File.separatorChar when get fqcn from generated … (#3380)
    
    * Fix #3374 to use File.separatorChar when get fqcn from generated xslt class files
    
    * Fix XmlTest to work on Windows
---
 .../apache/camel/quarkus/component/xslt/deployment/XsltProcessor.java | 3 ++-
 .../test/java/org/apache/camel/quarkus/component/xml/it/XmlTest.java  | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/extensions/xslt/deployment/src/main/java/org/apache/camel/quarkus/component/xslt/deployment/XsltProcessor.java b/extensions/xslt/deployment/src/main/java/org/apache/camel/quarkus/component/xslt/deployment/XsltProcessor.java
index cff57cb..074c415 100644
--- a/extensions/xslt/deployment/src/main/java/org/apache/camel/quarkus/component/xslt/deployment/XsltProcessor.java
+++ b/extensions/xslt/deployment/src/main/java/org/apache/camel/quarkus/component/xslt/deployment/XsltProcessor.java
@@ -120,7 +120,8 @@ class XsltProcessor {
                     .forEach(path -> {
                         try {
                             final Path rel = destination.relativize(path);
-                            final String fqcn = StringUtils.removeEnd(rel.toString(), ".class").replace('/', '.');
+                            final String fqcn = StringUtils.removeEnd(rel.toString(), ".class").replace(File.separatorChar,
+                                    '.');
                             final byte[] data = Files.readAllBytes(path);
 
                             generatedClasses.produce(new GeneratedClassBuildItem(false, fqcn, data));
diff --git a/integration-tests/xml/src/test/java/org/apache/camel/quarkus/component/xml/it/XmlTest.java b/integration-tests/xml/src/test/java/org/apache/camel/quarkus/component/xml/it/XmlTest.java
index cce580b..72544e8 100644
--- a/integration-tests/xml/src/test/java/org/apache/camel/quarkus/component/xml/it/XmlTest.java
+++ b/integration-tests/xml/src/test/java/org/apache/camel/quarkus/component/xml/it/XmlTest.java
@@ -91,8 +91,8 @@ class XmlTest {
                 .extract().body().asString().trim();
 
         Assertions.assertEquals(
-                "= Title\n"
-                        + "\n"
+                "= Title" + System.lineSeparator()
+                        + System.lineSeparator()
                         + "Paragraph Contents",
                 actual);
     }