You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2024/04/17 11:27:05 UTC

(camel) branch xfix created (now f7a391ec845)

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

davsclaus pushed a change to branch xfix
in repository https://gitbox.apache.org/repos/asf/camel.git


      at f7a391ec845 Fix unit test as the xml dumper may have changed recently

This branch includes the following new commits:

     new f7a391ec845 Fix unit test as the xml dumper may have changed recently

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: Fix unit test as the xml dumper may have changed recently

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch xfix
in repository https://gitbox.apache.org/repos/asf/camel.git

commit f7a391ec845121592532388a2c41f406d7f9f78e
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Apr 17 13:26:56 2024 +0200

    Fix unit test as the xml dumper may have changed recently
---
 .../org/apache/camel/util/DumpModelAsXmlNamespaceTest.java | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/core/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlNamespaceTest.java b/core/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlNamespaceTest.java
index a5a72c9f259..6ff68ae0b63 100644
--- a/core/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlNamespaceTest.java
+++ b/core/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlNamespaceTest.java
@@ -43,13 +43,19 @@ public class DumpModelAsXmlNamespaceTest extends ContextTestSupport {
         NodeList nl = dom.getElementsByTagName("xpath");
         assertEquals(2, nl.getLength());
 
-        Element n1 = (Element) nl.item(0);
-        String attributeFoo = n1.getAttribute("xmlns:foo");
+        String attributeFoo = dom.getDocumentElement().getAttribute("xmlns:foo");
+        if (attributeFoo.isEmpty()) {
+            Element n1 = (Element) nl.item(0);
+            attributeFoo = n1.getAttribute("xmlns:foo");
+        }
         assertNotNull(attributeFoo);
         assertEquals(URL_FOO, attributeFoo);
 
-        Element n2 = (Element) nl.item(1);
-        String attributeBar = n2.getAttribute("xmlns:bar");
+        String attributeBar = dom.getDocumentElement().getAttribute("xmlns:bar");
+        if (attributeBar.isEmpty()) {
+            Element n1 = (Element) nl.item(0);
+            attributeBar = n1.getAttribute("xmlns:bar");
+        }
         assertNotNull(attributeBar);
         assertEquals(URL_BAR, attributeBar);
     }