[ 
https://issues.apache.org/jira/browse/ARTEMIS-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16092175#comment-16092175
 ] 

ASF GitHub Bot commented on ARTEMIS-1276:
-----------------------------------------

GitHub user jdanekrh opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1407

    ARTEMIS-1276 fix JmsSendReceiveWithMessageExpirationTest [wip]

    The JmsSendReceiveWithMessageExpirationTest#testConsumeExpiredQueueAndDlq 
test used to fail with
    
    > 
JmsQueueCompositeSendReceiveTest>CombinationTestSupport.runBare:144->CombinationTestSupport.runBare:138->testSendReceive:86->JmsSendReceiveTestSupport.testSendReceive:
    > 
115->JmsSendReceiveTestSupport.assertMessagesAreReceived:156->JmsSendReceiveTestSupport.assertMessagesReceivedAreValid:176
 Invalid number of messages received
    > expected:<100> but was:<0>
    
    After the changes in this PR, it is now failing with
    
        junit.framework.AssertionFailedError: got dlq messages 
        Expected :99
        Actual   :90
    
    I can get it to pass if I disable prefetch, that is, I also change
    
    ```
    diff --git 
a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
 
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
    index dffd72296..3ff305810 100644
    --- 
a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
    +++ 
b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsSendReceiveWithMessageExpirationTest.java
    @@ -126,7 +126,7 @@ public class JmsSendReceiveWithMessageExpirationTest 
extends TestSupport {
     
           Connection consumerConnection = createConnection();
           ActiveMQPrefetchPolicy prefetchPolicy = new ActiveMQPrefetchPolicy();
    -      prefetchPolicy.setAll(10);
    +      prefetchPolicy.setAll(0);
           ((ActiveMQConnection) 
consumerConnection).setPrefetchPolicy(prefetchPolicy);
           Session consumerSession = consumerConnection.createSession(false, 
Session.CLIENT_ACKNOWLEDGE);
           MessageConsumer consumer = 
consumerSession.createConsumer(consumerDestination);
    ```
    
    I do not understand why prefetch breaks the test, and I do not know how to 
begin investigating this effectively...

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jdanekrh/activemq-artemis 
jd_JmsSendReceiveWithMessageExpirationTest

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1407.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1407
    
----
commit b629c1b2835af5e60593ec6c79adce83d7962ece
Author: Jiri Danek <[email protected]>
Date:   2017-06-26T13:16:44Z

    ARTEMIS-1276 fix JmsSendReceiveWithMessageExpirationTest

----


> [openwire-tests] Enable more OpenWire tests (from ActiveMQ 5)
> -------------------------------------------------------------
>
>                 Key: ARTEMIS-1276
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1276
>             Project: ActiveMQ Artemis
>          Issue Type: Test
>          Components: OpenWire
>    Affects Versions: 2.2.0
>            Reporter: Jiri Danek
>            Priority: Minor
>
> I've been looking into the currently disabled OpenWire tests, if there is a 
> way to implement support for more of them and enable them.
> I believe I've made some progress on this front, so I'd wish to discuss
> 1) what is the endgame about these tests; do we want to eventually run them 
> all, or is it expected to to ignore some?
> 2) what tests would be useful to enable now? I've been looking at them from 
> the point of how easy it is to enable them, not how useful it is.
> 3) would it be ok to add mockito as a test dependency? it seems useful, 
> because sometimes it is necessary to wrap something in ActiveMQ5 class, and 
> doing a proxy avoids having to invoke superclass constructors (when the thing 
> that needs to be implemented is a class and not an interface). Mockito is IMO 
> nicer to use than using java.lang.reflect.Proxy.newProxyInstance directly.
> and propose PR based on that discussion.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to