You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by blommish <jo...@gmail.com> on 2015/03/12 14:24:32 UTC

Java ActiveMQConnectionFactory BrowsableEndpoint

Is there a reason why this does not work? If I remove the persistent=false it
does work the first time but when running the test again the message will
already be there, so i will get "collection size was <2>"

java.lang.AssertionError: 
Expected: a collection with size <1>
     but: collection size was <0>

It does work if I define the jmscomponent as a springbean instead, but
wouldnt like to use spring.

@Test
    public void test() throws Exception {
        context.addComponent("wmq", jmsComponent(new
ActiveMQConnectionFactory("vm://localhost?broker.persistent=false")));
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:a").to("wmq:queue:b");
            }
        });
        NotifyBuilder notify = new
NotifyBuilder(context).from("wmq:queue:b").whenDone(1).create();
        template.sendBody("direct:a", "body");
        notify.matches(3, SECONDS);
        BrowsableEndpoint be = context.getEndpoint("wmq:queue:b",
BrowsableEndpoint.class);
        assertThat(be.getExchanges(), hasSize(1));
    }



--
View this message in context: http://camel.465427.n5.nabble.com/Java-ActiveMQConnectionFactory-BrowsableEndpoint-tp5764037.html
Sent from the Camel - Users mailing list archive at Nabble.com.