Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 49177 invoked from network); 1 Jul 2009 09:29:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Jul 2009 09:29:11 -0000 Received: (qmail 28576 invoked by uid 500); 1 Jul 2009 09:29:22 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 28523 invoked by uid 500); 1 Jul 2009 09:29: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 28513 invoked by uid 99); 1 Jul 2009 09:29:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Jul 2009 09:29:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Wed, 01 Jul 2009 09:29:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8A3562388891; Wed, 1 Jul 2009 09:28:57 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r790087 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java Date: Wed, 01 Jul 2009 09:28:57 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090701092857.8A3562388891@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Wed Jul 1 09:28:56 2009 New Revision: 790087 URL: http://svn.apache.org/viewvc?rev=790087&view=rev Log: basic test case for https://issues.apache.org/activemq/browse/AMQ-1763 - but does not show the problem atm Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java?rev=790087&r1=790086&r2=790087&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/virtual/VirtualTopicPubSubTest.java Wed Jul 1 09:28:56 2009 @@ -17,10 +17,14 @@ package org.apache.activemq.broker.virtual; import javax.jms.Connection; +import javax.jms.JMSException; +import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; import javax.jms.Session; +import junit.framework.Test; + import org.apache.activemq.EmbeddedBrokerTestSupport; import org.apache.activemq.command.ActiveMQQueue; import org.apache.activemq.command.ActiveMQTopic; @@ -33,14 +37,35 @@ public class VirtualTopicPubSubTest extends EmbeddedBrokerTestSupport { private Connection connection; + public int ackMode = Session.AUTO_ACKNOWLEDGE; + public static Test suite() { + return suite(VirtualTopicPubSubTest.class); + } + + public void initCombosForTestVirtualTopicCreation() { + addCombinationValues("ackMode", new Object[] {new Integer(Session.AUTO_ACKNOWLEDGE), new Integer(Session.CLIENT_ACKNOWLEDGE) }); + } + public void testVirtualTopicCreation() throws Exception { if (connection == null) { connection = createConnection(); } connection.start(); - ConsumerBean messageList = new ConsumerBean(); + ConsumerBean messageList = new ConsumerBean() { + public synchronized void onMessage(Message message) { + super.onMessage(message); + if (ackMode == Session.CLIENT_ACKNOWLEDGE) { + try { + message.acknowledge(); + } catch (JMSException e) { + e.printStackTrace(); + } + } + + } + }; messageList.setVerbose(true); String queueAName = getVirtualTopicConsumerName(); @@ -48,7 +73,7 @@ ActiveMQQueue queue1 = new ActiveMQQueue(queueAName); ActiveMQQueue queue2 = new ActiveMQQueue(queueAName); - Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + Session session = connection.createSession(false, ackMode); MessageConsumer c1 = session.createConsumer(queue1); MessageConsumer c2 = session.createConsumer(queue2);