FALCON-2010 Fix UT errors due to ActiveMQ upgrade
authoryzheng-hortonworks <yzheng@hortonworks.com>
Mon, 6 Jun 2016 18:58:56 +0000 (11:58 -0700)
committerbvellanki <bvellanki@hortonworks.com>
Mon, 6 Jun 2016 18:59:05 +0000 (11:59 -0700)
commit0b922edbfa01c2f37a158fa63883ba7931b37bb0
tree5a24b21022ca1690eebe937ce271038cb0049e3e
parentf53f99a7272d4241f221f759eac60db358671dbd
FALCON-2010 Fix UT errors due to ActiveMQ upgrade

Fixed two test failures due to the upgrade:

1. JMSMessageConsumerTest
After upgrade, some messages are consumed faster and so the initial expectation on no message being dequeued right after the message sending doesn't hold. Also confirmed with bvellanki that this kind of tests are flaky and have caused intermittent test errors before. Therefore, removed getTotalDequeueCount assertion. In addition, the expected message consumptions are tested in existing code "Mockito.verify(jobEndService,...".

2. FalconPostProcessingTest
After upgrade, Falcon will run into an error if it tries to delete messages when ActiveMQ service is stopped. Therefore, need to call start before deleting the message during teardown.

Author: yzheng-hortonworks <yzheng@hortonworks.com>

Reviewers: "Balu Vellanki <balu@apache.org>, Venkat Ranganathan <venkat@hortonworks.com>, Pallavi Rao <pallavi@apache.org>"

Closes #169 from yzheng-hortonworks/FALCON-2010

(cherry picked from commit fb4d0b4955429e6cef413ab073814fc800361bd4)
Signed-off-by: bvellanki <bvellanki@hortonworks.com>
messaging/src/test/java/org/apache/falcon/messaging/JMSMessageConsumerTest.java
oozie/src/test/java/org/apache/falcon/oozie/workflow/FalconPostProcessingTest.java