camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Straube <claus.stra...@catify.com>
Subject Re: Using Apache Camel as replacement for cron-driven shell scripts
Date Fri, 08 Apr 2011 08:26:22 GMT
On 08.04.2011 10:14, Arkadi Shishlov wrote:
> On Fri, 08 Apr 2011 10:58:27 +0300, Claus Straube 
> <claus.straube@catify.com> wrote:
>> An empty multicast is no error.
>
> ArrayList l = new ArrayList();
> from("direct:a").multicast().to(l);
>
> java.lang.IllegalArgumentException: Definition has no children on 
> Multicast[[]]
>   at 
> org.apache.camel.model.ProcessorDefinition.createChildProcessor(ProcessorDefinition.java:152)
>
> Camel 2.6.0
>
>
This test is green in camel 2.7.0:

     public void testErrorReplacement() throws Exception{

         MockEndpoint a = getMockEndpoint("mock:a");
         a.setExpectedMessageCount(1);

         template.sendBody("direct:a", "foo");

         RouteBuilder builder = new RouteBuilder() {

             @Override
             public void configure() throws Exception {

                 from("direct:a")
                 .routeId("myRoute")
                 .multicast()
                 .to("mock:b");

             }
         };

         context.addRoutes(builder);

         MockEndpoint b = getMockEndpoint("mock:b");
         b.setExpectedMessageCount(1);

         template.sendBody("direct:a", "foo");

         assertMockEndpointsSatisfied(10, TimeUnit.SECONDS);

     }

     protected RouteBuilder createRouteBuilder(){
         return new RouteBuilder() {

             @Override
             public void configure() throws Exception {

                 from("direct:a")
                 .routeId("myRoute")
                 .to("mock:a");

             }
         };

     }


Mime
View raw message