You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Preben.Asmussen" <pr...@dr.dk> on 2012/02/22 13:16:42 UTC
Using adviceWith in CamelSpringTestSupport
Hi
Seems that there is an error in Camel test support for
CamelSpringTestSupport when u want to use adviceWith on a Spring DSL defined
route.
@Override
public boolean isUseAdviceWith() {
// tell we are using advice with, which allows us to advice the route
// before Camel is being started, and thus can replace activemq with
// something else.
return true;
}
@Test
public void testExample() throws Exception {
context.getRouteDefinition("myroute").adviceWith(context, new
AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
replaceFromWith("direct:start");
// weaveById("publisher").after().to("mock:tracks");
}
});
context.start();
When the route startes I get an error 'Should have at least one route' from
assertValidContext in CamelSpringTestSupport.
Is this expected ? And shouldn't CamelSpringTestSupport behave like
CamelTestSupport ?
cheers
Preben
--
View this message in context: http://camel.465427.n5.nabble.com/Using-adviceWith-in-CamelSpringTestSupport-tp5504936p5504936.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using adviceWith in CamelSpringTestSupport
Posted by "Preben.Asmussen" <pr...@dr.dk>.
Thans Created https://issues.apache.org/jira/browse/CAMEL-5028
--
View this message in context: http://camel.465427.n5.nabble.com/Using-adviceWith-in-CamelSpringTestSupport-tp5504936p5505087.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Using adviceWith in CamelSpringTestSupport
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
There is a method you need to override, and return 0 for
getExepctedRoute or something like that.
But yeah I think we can remove that old assertion, as its not as
relevant anymore. I guess it was used as a failsafe to ensure the
spring bits get started up. Its from the old 1.x days.
Feel free to create a JIRA ticket.
On Wed, Feb 22, 2012 at 1:16 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> Hi
>
> Seems that there is an error in Camel test support for
> CamelSpringTestSupport when u want to use adviceWith on a Spring DSL defined
> route.
>
> @Override
> public boolean isUseAdviceWith() {
> // tell we are using advice with, which allows us to advice the route
> // before Camel is being started, and thus can replace activemq with
> // something else.
> return true;
> }
>
> @Test
> public void testExample() throws Exception {
> context.getRouteDefinition("myroute").adviceWith(context, new
> AdviceWithRouteBuilder() {
> @Override
> public void configure() throws Exception {
> replaceFromWith("direct:start");
> // weaveById("publisher").after().to("mock:tracks");
> }
> });
> context.start();
>
>
> When the route startes I get an error 'Should have at least one route' from
> assertValidContext in CamelSpringTestSupport.
>
> Is this expected ? And shouldn't CamelSpringTestSupport behave like
> CamelTestSupport ?
>
> cheers
> Preben
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Using-adviceWith-in-CamelSpringTestSupport-tp5504936p5504936.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/