Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 4958 invoked from network); 23 Sep 2008 13:21:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Sep 2008 13:21:48 -0000 Received: (qmail 11423 invoked by uid 500); 23 Sep 2008 13:21:46 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 11366 invoked by uid 500); 23 Sep 2008 13:21:45 -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 11357 invoked by uid 99); 23 Sep 2008 13:21:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 06:21:45 -0700 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; Tue, 23 Sep 2008 13:20:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A9ED523889A0; Tue, 23 Sep 2008 06:20:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r698175 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java Date: Tue, 23 Sep 2008 13:20:57 -0000 To: commits@activemq.apache.org From: chirino@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080923132057.A9ED523889A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: chirino Date: Tue Sep 23 06:20:57 2008 New Revision: 698175 URL: http://svn.apache.org/viewvc?rev=698175&view=rev Log: adding test case for https://issues.apache.org/activemq/browse/AMQ-1949 Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java?rev=698175&r1=698174&r2=698175&view=diff ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java (original) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/JMSConsumerTest.java Tue Sep 23 06:20:57 2008 @@ -598,4 +598,29 @@ assertNull(consumer.receiveNoWait()); } + + public void testDupsOkConsumer() throws Exception { + + // Receive a message with the JMS API + connection.start(); + Session session = connection.createSession(false, Session.DUPS_OK_ACKNOWLEDGE); + destination = createDestination(session, ActiveMQDestination.QUEUE_TYPE); + MessageConsumer consumer = session.createConsumer(destination); + + // Send the messages + sendMessages(session, destination, 4); + + // Make sure only 4 message are delivered. + for( int i=0; i < 4; i++){ + Message m = consumer.receive(1000); + assertNotNull(m); + } + assertNull(consumer.receive(1000)); + + // Close out the consumer.. no other messages should be left on the queue. + consumer.close(); + + consumer = session.createConsumer(destination); + assertNull(consumer.receive(1000)); + } }