|
|
|
Update:
Because all test runs operate on the same queue named queue1 some tests start failing because of a non-empty queue from previous test runs. Looking at some of the failing tests it looks as if queues are not properly consumed (emptied). This also explains the consistent queue size pasted in my previous comment. For kicks I used different queue names for each test and most tests succeeded. Still, there are a few not properly executing, which further suggests that there may be more to find. Although one could argue that every unit test should start with a clean slate I advocate in this particular case to keep the same queue name but at least make sure they are properly consumed and empty after each test run. Follow-up issues after test cases were fixed.
I added a private method to consume all messages for every queue used in each test case to ensure subsequent test runs start with an empty queue. Furthermore improved testPeek(), which revealed two issues filed separately and linked to this one.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
#1 FilePersistenceTestCase and NoPersistenceTestCase (which actually should be MemoryPersistenceTestCase) are both executing AbstractTransactionQueueManagerTestCase test cases.
#2 Interestingly the queue size always returns 2 for all failing tests when testing file persistence:
bart:core> grep expected target/surefire-reports/org.mule.util.queue.FilePersistenceTestCase.txt
junit.framework.AssertionFailedError: Queue size expected:<1> but was:<2>
junit.framework.AssertionFailedError: Queue size expected:<1> but was:<2>
junit.framework.AssertionFailedError: Queue size expected:<1> but was:<2>
junit.framework.AssertionFailedError: Queue size expected:<0> but was:<2>
junit.framework.AssertionFailedError: Queue size expected:<0> but was:<2>
junit.framework.AssertionFailedError: Queue size expected:<0> but was:<2>