I've fixed/kludged the latest instance of this problem by manually draining
the queue before sending in my test messages; e.g.

       while (true) {
           TextMessage m1 = (TextMessage) consumer.receive(3000);
           if (m1 == null) break;
       }

The problem seems to be that under some circumstances previous test methods
leave messages somewhere that the new test can find them. They are not
cleaned up in tearDown() and the queue is not reinitialized fresh in
setUp(). At least that's my current hypothesis.

Why the the queue is not reinitialized fresh in setUp() I don't understand.
It certainly looks like it is. Probably I'm not doing something right. I
know I'm leaving active threads around after some of my tests complete, and
I need to be more careful about shutting those down, but that alone did not
seem to fix this problem.

I may need to understand more about just what a queue of the type
vm://localhost?broker.persistent=false is really doing.

--
Elliotte Rusty Harold
[EMAIL PROTECTED]

Reply via email to