Starting bus after the messages have been sent to the channel.

This commit is contained in:
Mark Fisher
2008-01-02 15:24:11 +00:00
parent 55b038412f
commit acd86b863a

View File

@@ -95,14 +95,15 @@ public class FixedDelayConsumerTests {
subscription.setEndpoint("testEndpoint");
subscription.setPolicy(policy);
bus.activateSubscription(subscription);
bus.start();
for (int i = 0; i < messagesToSend; i++) {
channel.send(new GenericMessage<String>(1, "test " + (i+1)));
}
bus.start();
latch.await(80, TimeUnit.MILLISECONDS);
int count = counter.get();
assertTrue("received " + count + ", expected less than 10", counter.get() < 10);
assertTrue("received " + count + ", expected more than 7", counter.get() > 7);
bus.stop();
}
}