mirror of https://github.com/apache/activemq.git
apply patch for: https://issues.apache.org/jira/browse/AMQ-3900
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1354291 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3813947879
commit
f90e6b9b6d
|
@ -27,6 +27,7 @@ import javax.jms.MessageProducer;
|
||||||
import javax.jms.Session;
|
import javax.jms.Session;
|
||||||
|
|
||||||
import junit.framework.TestCase;
|
import junit.framework.TestCase;
|
||||||
|
|
||||||
import org.apache.activemq.ActiveMQConnectionFactory;
|
import org.apache.activemq.ActiveMQConnectionFactory;
|
||||||
import org.apache.activemq.broker.BrokerService;
|
import org.apache.activemq.broker.BrokerService;
|
||||||
import org.apache.activemq.broker.region.policy.PolicyEntry;
|
import org.apache.activemq.broker.region.policy.PolicyEntry;
|
||||||
|
@ -82,7 +83,6 @@ public class TopicProducerFlowControlTest extends TestCase implements MessageLis
|
||||||
broker.waitUntilStarted();
|
broker.waitUntilStarted();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
broker.stop();
|
broker.stop();
|
||||||
broker.waitUntilStopped();
|
broker.waitUntilStopped();
|
||||||
|
@ -138,19 +138,17 @@ public class TopicProducerFlowControlTest extends TestCase implements MessageLis
|
||||||
|
|
||||||
assertEquals("Didn't produce all messages", numMessagesToSend, produced.get());
|
assertEquals("Didn't produce all messages", numMessagesToSend, produced.get());
|
||||||
assertEquals("Didn't consume all messages", numMessagesToSend, consumed.get());
|
assertEquals("Didn't consume all messages", numMessagesToSend, consumed.get());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onMessage(Message message) {
|
public void onMessage(Message message) {
|
||||||
try {
|
|
||||||
Thread.sleep(1);
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
}
|
|
||||||
|
|
||||||
long count = consumed.incrementAndGet();
|
long count = consumed.incrementAndGet();
|
||||||
if (count % 100 == 0) {
|
if (count % 100 == 0) {
|
||||||
LOG.info("\tConsumed " + count + " messages");
|
LOG.info("\tConsumed " + count + " messages");
|
||||||
|
try {
|
||||||
|
Thread.sleep(100);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue