Created
April 6, 2011 08:19
-
-
Save rajdavies/905318 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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