You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Gary Tully (JIRA)" <ji...@apache.org> on 2008/10/24 11:46:52 UTC

[jira] Commented: (AMQ-1725) org.apache.activemq.JMSConsumerTest.testMessageListenerUnackedWithPrefetch1StayInQueue fails for ackMode != dups_ok

    [ https://issues.apache.org/activemq/browse/AMQ-1725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46822#action_46822 ] 

Gary Tully commented on AMQ-1725:
---------------------------------

stack trace is now in the log.

> org.apache.activemq.JMSConsumerTest.testMessageListenerUnackedWithPrefetch1StayInQueue fails for ackMode != dups_ok
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: AMQ-1725
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1725
>             Project: ActiveMQ
>          Issue Type: Test
>          Components: Test Cases
>    Affects Versions: 5.1.0
>            Reporter: Gary Tully
>            Priority: Minor
>             Fix For: 5.3.0
>
>
> Variants of the activemq-core testMessageListenerUnackedWithPrefetch1StayInQueue test fail checking the ordering of messages and they should not for ackMode!=DUPS_OK_ACK
> the test does not fail because the assertion kills the message dispatch task thread. The stack Trace is visible on the console.
> junit.framework.ComparisonFailure: testMessageListenerUnackedWithPrefetch1StayInQueue {deliveryMode=2, ackMode=1, destinationType=1} verify ordering expected:<2> but was:<1>
> 	at junit.framework.Assert.assertEquals(Assert.java:81)
> 	at org.apache.activemq.JMSConsumerTest$5.onMessage(JMSConsumerTest.java:361)
> 	at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:967)
> 	at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:122)
> 	at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:192)
> 	at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)
> 	at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
> 	at java.lang.Thread.run(Thread.java:595)
> applying the following diff helps identify the tests that fail:
> Index: src/test/java/org/apache/activemq/JMSConsumerTest.java
> ===================================================================
> --- src/test/java/org/apache/activemq/JMSConsumerTest.java      (revision 655936)
> +++ src/test/java/org/apache/activemq/JMSConsumerTest.java      (working copy)
> @@ -290,6 +290,13 @@
>          addCombinationValues("destinationType", new Object[] {Byte.valueOf(ActiveMQDestination.QUEUE_TYPE)});
>      }
> +    public void testA() throws Exception {
> +        deliveryMode = Integer.valueOf(DeliveryMode.NON_PERSISTENT);
> +        ackMode = Integer.valueOf(Session.AUTO_ACKNOWLEDGE);
> +        destinationType = Byte.valueOf(ActiveMQDestination.QUEUE_TYPE);
> +        testMessageListenerUnackedWithPrefetch1StayInQueue();
> +    }
> +
>      public void testMessageListenerUnackedWithPrefetch1StayInQueue() throws Exception {
>          final AtomicInteger counter = new AtomicInteger(0);
> @@ -351,7 +358,7 @@
>                  try {
>                      TextMessage tm = (TextMessage)m;
>                      LOG.info("Got in second listener: " + tm.getText());
> -                    assertEquals("" + counter.get(), tm.getText());
> +                    assertEquals(getName() + " verify ordering", "" + counter.get(), tm.getText());
>                      counter.incrementAndGet();
>                      if (counter.get() == 4) {
>                          done2.countDown();

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.