mirror of https://github.com/apache/activemq.git
https://issues.apache.org/jira/browse/AMQ-4213 - fix up test that expected async producer creation
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1423833 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0f3ce45cff
commit
10e1c0c8d3
|
@ -417,26 +417,20 @@ public class ConfigTest extends TestCase {
|
|||
|
||||
ActiveMQConnectionFactory activeMQConnectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61631");
|
||||
javax.jms.Connection connection = activeMQConnectionFactory.createConnection();
|
||||
final CountDownLatch latch = new CountDownLatch(1);
|
||||
connection.setExceptionListener(new ExceptionListener() {
|
||||
public void onException(JMSException e) {
|
||||
if (e.getCause() instanceof IllegalStateException) {
|
||||
latch.countDown();
|
||||
}
|
||||
}
|
||||
});
|
||||
connection.start();
|
||||
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
|
||||
Topic topic = session.createTopic("test.foo");
|
||||
|
||||
for (int i = 0; i < (MAX_PRODUCERS + 1); i++) {
|
||||
MessageProducer messageProducer = session.createProducer(topic);
|
||||
for (int i = 0; i < MAX_PRODUCERS; i++) {
|
||||
session.createProducer(topic);
|
||||
}
|
||||
|
||||
latch.await(5, TimeUnit.SECONDS);
|
||||
if (latch.getCount() > 0) {
|
||||
fail("Should have got an exception");
|
||||
try {
|
||||
session.createProducer(topic);
|
||||
fail("Should have got an exception on exceeding MAX_PRODUCERS");
|
||||
} catch (JMSException expected) {
|
||||
}
|
||||
|
||||
try {
|
||||
for (int i = 0; i < (MAX_CONSUMERS + 1); i++) {
|
||||
MessageConsumer consumer = session.createConsumer(topic);
|
||||
|
|
Loading…
Reference in New Issue