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.

Thanks,
Arjan



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: 
http://www.nabble.com/Problem-with-XPath-splitters-tf4357605s22882.html#a13403288
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to