camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arjan Moraal <>
Subject Re: Problem with XPath splitters
Date Thu, 25 Oct 2007 09:42:47 GMT

Hi Gert, 

You are right, the test passes when just checking the id's.

I was a bit confused by the output of the failure:
java.lang.AssertionError: mock:result Body of message: 0. Expected:
<<rugbyFixture id=...
It looked like the body of the message was just the string "0" instead of an
XML snippet.


Gert Vanthienen wrote:
> L.S.,
> At first glance, it seems to me that the correct result is returned.  
> Only the order of the attributes within the XML element has changed, but 
> everything is there.  I don't think that there is a way to enforce this 
> order of attributes, it's probably being rearranged while parsing the 
> XML document for the XPath splitter.
> One possible solution is to check the id attribute in your test 
> afterwards using the DOM API instead of using the expectedBodies(...):
>         resultEndpoint.assertIsSatisfied();
>         assertEquals("2909509", 
> resultEndpoint.assertExchangeReceived(0).getIn().getBody(Element.class).getAttribute("id"));
>         assertEquals("2866397", 
> resultEndpoint.assertExchangeReceived(1).getIn().getBody(Element.class).getAttribute("id"));
> Regards,
> Gert

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message