Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0AD8596CE for ; Tue, 11 Sep 2012 14:15:23 +0000 (UTC) Received: (qmail 3702 invoked by uid 500); 11 Sep 2012 14:15:23 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 3668 invoked by uid 500); 11 Sep 2012 14:15:22 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 3661 invoked by uid 99); 11 Sep 2012 14:15:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2012 14:15:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Sep 2012 14:15:20 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C6A30238896F for ; Tue, 11 Sep 2012 14:14:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1383426 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JmsTempDestinationTest.java Date: Tue, 11 Sep 2012 14:14:36 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120911141436.C6A30238896F@eris.apache.org> Author: gtully Date: Tue Sep 11 14:14:36 2012 New Revision: 1383426 URL: http://svn.apache.org/viewvc?rev=1383426&view=rev Log: https://issues.apache.org/jira/browse/AMQ-3985 - fix up timeing issue in test post change to asyncDispatch for temp dest advisories 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=1383426&r1=1383425&r2=1383426&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 Tue Sep 11 14:14:36 2012 @@ -44,6 +44,7 @@ import javax.jms.TextMessage; import junit.framework.TestCase; import org.apache.activemq.transport.TransportListener; import org.apache.activemq.transport.vm.VMTransport; +import org.apache.activemq.util.Wait; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -246,16 +247,24 @@ public class JmsTempDestinationTest exte * @throws JMSException * @throws InterruptedException */ - public void testPublishFailsForDestoryedTempDestination() throws JMSException, InterruptedException { + public void testPublishFailsForDestroyedTempDestination() 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);