* @version $Revision: 520220 $
*/
public class DirectRouteTest extends TestCase {
public void testSedaQueue() throws Exception {
CamelContext container = new DefaultCamelContext();
final AtomicBoolean invoked = new AtomicBoolean();
// lets add some routes
container.addRoutes(new RouteBuilder() {
public void configure() {
from("direct:test.a").to("direct:test.b");
from("direct:test.b").process(new Processor() {
public void process(Exchange e) {
invoked.set(true);
}
});
}
});
container.start();
// now lets fire in a message
Endpoint<Exchange> endpoint = container.getEndpoint("direct:test.a");
Exchange exchange = endpoint.createExchange();
exchange.getIn().setHeader("cheese", 123);
Producer<Exchange> producer = endpoint.createProducer();
producer.process(exchange);
// now lets sleep for a while
assertTrue("Did not receive the message!", invoked.get());
container.stop();
}