Any idea the test is failing?
It seems to have been caused by this change
http://svn.apache.org/viewvc?view=rev&revision=593539
For now I've reverted back to the old version since it breaks about half our
routes :(
Thanks,
Arjan
Arjan Moraal wrote:
>
> Hi,
>
> I've just updated my sources from Oct 16 to the latest version from svn,
> and now the following simple test is failing. The test is working with the
> Oct 16 sources. Any idea why?
>
> == TEST CASE ==
>
> package com.bbc.newsi.feeds.sport.renderservice.camel;
>
> import static org.apache.camel.language.juel.JuelExpression.el;
> import junit.framework.TestCase;
>
> import org.apache.camel.CamelContext;
> import org.apache.camel.CamelTemplate;
> import org.apache.camel.Exchange;
> import org.apache.camel.Message;
> import org.apache.camel.Processor;
> import org.apache.camel.builder.RouteBuilder;
> import org.apache.camel.component.mock.MockEndpoint;
> import org.apache.camel.impl.DefaultCamelContext;
>
> /**
> *
> * @author Albert Moraal
> * @version $Revision$ $Date$ $Author$
> */
> public class NullBodyTest extends TestCase {
> private CamelContext context;
> private CamelTemplate<Exchange> template;
>
> @Override
> protected void setUp() throws Exception {
> super.setUp();
> context = new DefaultCamelContext();
> context.start();
> template = new CamelTemplate<Exchange>(context);
> }
>
> @Override
> protected void tearDown() throws Exception {
> context.stop();
> super.tearDown();
> }
>
> public void testNullBody() throws Exception {
> context.addRoutes(
> new RouteBuilder() {
> @Override
> public void configure() {
> from("seda:nullbodytest")
> .to("mock:Before")
> .setBody(el("xx${in.body}xx"))
> .to("mock:After");
> }
> }
> );
>
> MockEndpoint resultEndpoint = context.getEndpoint("mock:After",
> MockEndpoint.class);
> resultEndpoint.expectedBodiesReceived("xxtestbodyxx");
>
> template.send("seda:nullbodytest", new Processor() {
> public void process(Exchange exchange) {
> Message in = exchange.getIn();
> in.setBody("testbody");
> }
> });
>
> resultEndpoint.assertIsSatisfied();
> }
>
> }
>
> == RESULT ==
>
> java.lang.AssertionError: mock:After Body of message: 0. Expected:
> <xxtestbodyxx> but was: <null>
> at
> org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:531)
> at
> org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:513)
> at
> org.apache.camel.component.mock.MockEndpoint$2.run(MockEndpoint.java:252)
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:179)
> at
> org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:144)
> at
> com.bbc.newsi.feeds.sport.renderservice.camel.NullBodyTest.testNullBody(NullBodyTest.java:61)
>
>
--
View this message in context:
http://www.nabble.com/setBody%28el%28-%29%29-creates-null-body-tf4805396s22882.html#a13768004
Sent from the Camel - Users mailing list archive at Nabble.com.