activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1391392 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
Date Fri, 28 Sep 2012 10:48:22 GMT
Author: gtully
Date: Fri Sep 28 10:48:22 2012
New Revision: 1391392

URL: http://svn.apache.org/viewvc?rev=1391392&view=rev
Log:
ensure async dispatches temp advisory is present before verfication of temp usage

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java?rev=1391392&r1=1391391&r2=1391392&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java
Fri Sep 28 10:48:22 2012
@@ -208,16 +208,24 @@ public class JmsTempDestinationTest exte
      * @throws InterruptedException
      * @throws URISyntaxException 
      */
-    public void testPublishFailsForClosedConnection() throws JMSException, InterruptedException,
URISyntaxException {
+    public void testPublishFailsForClosedConnection() throws Exception {
         
         Connection tempConnection = factory.createConnection();
         connections.add(tempConnection);
         Session tempSession = tempConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-        TemporaryQueue queue = tempSession.createTemporaryQueue();
+        final TemporaryQueue queue = tempSession.createTemporaryQueue();
 
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         connection.start();
 
+        final ActiveMQConnection activeMQConnection = (ActiveMQConnection) connection;
+        assertTrue("creation advisory received in time with async dispatch", Wait.waitFor(new
Wait.Condition() {
+            @Override
+            public boolean isSatisified() throws Exception {
+                return activeMQConnection.activeTempDestinations.containsKey(queue);
+            }
+        }));
+
         // This message delivery should work since the temp connection is still
         // open.
         MessageProducer producer = session.createProducer(queue);



Mime
View raw message