activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r943877 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/MessageEvictionTest.java
Date Thu, 13 May 2010 13:10:49 GMT
Author: gtully
Date: Thu May 13 13:10:49 2010
New Revision: 943877

URL: http://svn.apache.org/viewvc?rev=943877&view=rev
Log:
fix assertion on discarded count

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

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/MessageEvictionTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/MessageEvictionTest.java?rev=943877&r1=943876&r2=943877&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/MessageEvictionTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/MessageEvictionTest.java
Thu May 13 13:10:49 2010
@@ -118,12 +118,13 @@ public class MessageEvictionTest {
                     Session advisorySession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
                     final MessageConsumer consumer = advisorySession.createConsumer(discardedAdvisoryDestination);
                     consumer.setMessageListener(new MessageListener() {
+                        int advisoriesReceived = 0;
                         public void onMessage(Message message) {
                             try {
                                 LOG.info("advisory:" + message);
                                 ActiveMQMessage activeMQMessage = (ActiveMQMessage) message;
                                 assertNotNull(activeMQMessage.getStringProperty(AdvisorySupport.MSG_PROPERTY_CONSUMER_ID));
-                                assertEquals(1, activeMQMessage.getIntProperty(AdvisorySupport.MSG_PROPERTY_DISCARDED_COUNT));
+                                assertEquals(++advisoriesReceived, activeMQMessage.getIntProperty(AdvisorySupport.MSG_PROPERTY_DISCARDED_COUNT));
                                 message.acknowledge();
                                 advisoryIsGood.countDown();
                             } catch (JMSException e) {
@@ -164,6 +165,7 @@ public class MessageEvictionTest {
                             try {
                                 // very slow, only ack once
                                 doAck.await(60, TimeUnit.SECONDS);
+                                LOG.info("acking: " + message.getJMSMessageID());
                                 message.acknowledge();
                             } catch (Exception e) {
                                 e.printStackTrace();



Mime
View raw message