camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [1/2] git commit: Fix test issue related to order of attributes in xml element
Date Sun, 24 Nov 2013 11:03:18 GMT
Updated Branches:
  refs/heads/camel-2.11.x 0785cac1e -> 22ada8abc
  refs/heads/master 79700e1b7 -> c13f7c89c


Fix test issue related to order of attributes in xml element


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c13f7c89
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c13f7c89
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c13f7c89

Branch: refs/heads/master
Commit: c13f7c89c6dee87dabe106d625e9339667f9b7da
Parents: 79700e1
Author: Hadrian Zbarcea <hzbarcea@gmail.com>
Authored: Fri Nov 22 11:40:08 2013 -0500
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sun Nov 24 12:04:29 2013 +0100

----------------------------------------------------------------------
 .../util/DumpModelAsXmlTransformRouteTest.java  | 21 ++++++++++++++++++--
 1 file changed, 19 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c13f7c89/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlTransformRouteTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlTransformRouteTest.java
b/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlTransformRouteTest.java
index f63f7bb..e58d68d 100644
--- a/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlTransformRouteTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/DumpModelAsXmlTransformRouteTest.java
@@ -18,7 +18,12 @@ package org.apache.camel.util;
 
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.converter.jaxp.XmlConverter;
 import org.apache.camel.model.ModelHelper;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
 
 /**
  *
@@ -30,8 +35,20 @@ public class DumpModelAsXmlTransformRouteTest extends ContextTestSupport
{
         assertNotNull(xml);
         log.info(xml);
 
-        assertTrue(xml.contains("<simple>Hello ${body}</simple>"));
-        assertTrue(xml.contains("<to uri=\"mock:result\" customId=\"true\" id=\"myMock\"/>"));
+        Document doc = new XmlConverter().toDOMDocument(xml);
+        NodeList nodes = doc.getElementsByTagName("simple");
+        assertEquals(1, nodes.getLength());
+        Element node = (Element)nodes.item(0);
+        assertNotNull("Node <simple> expected to be instanceof Element", node);
+        assertEquals("Hello ${body}", node.getTextContent());
+
+        nodes = doc.getElementsByTagName("to");
+        assertEquals(1, nodes.getLength());
+        node = (Element)nodes.item(0);
+        assertNotNull("Node <to> expected to be instanceof Element", node);
+        assertEquals("mock:result", node.getAttribute("uri"));
+        assertEquals("myMock", node.getAttribute("id"));
+        assertEquals("true", node.getAttribute("customId"));
     }
 
     @Override


Mime
View raw message