activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1423833 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
Date Wed, 19 Dec 2012 11:38:54 GMT
Author: gtully
Date: Wed Dec 19 11:38:53 2012
New Revision: 1423833

URL: http://svn.apache.org/viewvc?rev=1423833&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-4213 - fix up test that expected async producer
creation

Modified:
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java?rev=1423833&r1=1423832&r2=1423833&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/config/ConfigTest.java
Wed Dec 19 11:38:53 2012
@@ -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);



Mime
View raw message