From 0d7106b320a854e1dacfd9a12fccf71bc561763d Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Wed, 16 Jan 2008 22:23:29 +0000 Subject: [PATCH] Test does not need counter. --- .../integration/bus/FixedRateConsumerTests.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java index 782054c2b5..22cf2f9e3f 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/bus/FixedRateConsumerTests.java @@ -40,12 +40,10 @@ public class FixedRateConsumerTests { @Test public void testAllSentMessagesAreReceivedWithinTimeLimit() throws Exception { int messagesToSend = 20; - final AtomicInteger counter = new AtomicInteger(0); final CountDownLatch latch = new CountDownLatch(messagesToSend); SimpleChannel channel = new SimpleChannel(); MessageHandler handler = new MessageHandler() { public Message handle(Message message) { - counter.incrementAndGet(); latch.countDown(); return null; } @@ -63,8 +61,8 @@ public class FixedRateConsumerTests { for (int i = 0; i < messagesToSend; i++) { channel.send(new GenericMessage(1, "test " + (i+1))); } - latch.await(210, TimeUnit.MILLISECONDS); - assertEquals(messagesToSend, counter.get()); + latch.await(250, TimeUnit.MILLISECONDS); + assertEquals("all messages should have been received within the time limit", 0, latch.getCount()); } @Test