2012-07-15 14:12:03 +02:00
|
|
|
package docs.camel;
|
|
|
|
|
|
|
|
|
|
import akka.actor.ActorRef;
|
|
|
|
|
import akka.actor.ActorSystem;
|
|
|
|
|
import akka.actor.Props;
|
|
|
|
|
import akka.camel.Camel;
|
|
|
|
|
import akka.camel.CamelExtension;
|
2013-05-02 17:12:36 +02:00
|
|
|
import akka.testkit.JavaTestKit;
|
2012-07-15 14:12:03 +02:00
|
|
|
|
|
|
|
|
public class CustomRouteTestBase {
|
|
|
|
|
public void customRoute() throws Exception{
|
|
|
|
|
//#CustomRoute
|
|
|
|
|
ActorSystem system = ActorSystem.create("some-system");
|
|
|
|
|
Camel camel = CamelExtension.get(system);
|
2013-04-14 22:56:41 +02:00
|
|
|
ActorRef responder = system.actorOf(Props.create(Responder.class), "TestResponder");
|
2012-07-15 14:12:03 +02:00
|
|
|
camel.context().addRoutes(new CustomRouteBuilder(responder));
|
|
|
|
|
//#CustomRoute
|
|
|
|
|
system.stop(responder);
|
2013-05-02 17:12:36 +02:00
|
|
|
JavaTestKit.shutdownActorSystem(system);
|
2012-07-15 14:12:03 +02:00
|
|
|
}
|
|
|
|
|
}
|