Skip to content

Instantly share code, notes, and snippets.

@rajdavies
Created April 6, 2011 08:19
Show Gist options
  • Save rajdavies/905318 to your computer and use it in GitHub Desktop.
Save rajdavies/905318 to your computer and use it in GitHub Desktop.
public void testSimpleAfterCep() throws Exception {
final DirectEndpoint de = new DirectEndpoint();
de.setCamelContext(context);
de.setEndpointUriIfNotSpecified("direct://foo");
final DirectEndpoint de2 = new DirectEndpoint();
de2.setCamelContext(context);
de2.setEndpointUriIfNotSpecified("direct://foo2");
context.addRoutes(new CepRouteBuilder() {
@Override
public void configure() throws Exception {
RouteDefinition route = from(de2);
RouteDefinition route1 = from(de).to("mock:boo");
cep("test").win("30 s").when(route).after(route1).to("mock:result");
}
});
context.start();
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(COUNT);
mock.setResultWaitTime(WAIT_TIME);
for (int i = 0; i < COUNT; i++) {
Exchange exchange = createExchange(i, i);
template.send(de, exchange);
}
for (int i = 0; i < COUNT; i++) {
Exchange exchange = createExchange(i, i);
template.send(de2, exchange);
}
assertMockEndpointsSatisfied();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment