Hi,
This particular commit caused the testAcknowledgePerConsumer test to
fail in org.apache.qpid.test.unit.ack.RecoverTest. For some reason it
seems that queue1 in TransactedTest.java lingers around after the test
has completed. In RecoverTest.java, the same queue is picked up and
causes the following error to occur:
testAcknowledgePerConsumer(org.apache.qpid.test.unit.ack.RecoverTest)
Time elapsed: 0.037 sec <<< FAILURE!
junit.framework.ComparisonFailure: expected:<msg1> but was:<A>
at junit.framework.Assert.assertEquals(Assert.java:81)
at junit.framework.Assert.assertEquals(Assert.java:87)
at
org.apache.qpid.test.unit.ack.RecoverTest.testAcknowledgePerConsumer(RecoverTest.java:204)
The message "A" comes from queue1 in TransactedTest.java. I have
attached a patch for TransactedTest.java to fix this problem. My fix
basically setup queue1 to auto delete so it won't be around for the
other tests.
Cheers,
Jon
[EMAIL PROTECTED] wrote:
Author: kpvdr
Date: Fri Jan 26 06:50:16 2007
New Revision: 500264
URL: http://svn.apache.org/viewvc?view=rev&rev=500264
Log:
Change to TransactedTest which prevents the intermittent error
junit.framework.ComparisonFailure: expected:<B> but was:<C> (or similar) from
occurring on either the commit or rollback portion of the test. The error occurs when the
test consumer testConsumer1 bind frames arrive at the server before the message bodies with
A,B,C and cause queue 1 to start a round-robin distribution for these messages when they
finally do arrive.
Modified:
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java?view=diff&rev=500264&r1=500263&r2=500264
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
Fri Jan 26 06:50:16 2007
@@ -83,7 +83,6 @@
testCon = new AMQConnection("vm://:1", "guest", "guest", "TestConnection", "test");
testSession = testCon.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- testConsumer1 = testSession.createConsumer(queue1);
testConsumer2 = testSession.createConsumer(queue2);
testCon.start();
}
@@ -115,6 +114,7 @@
expect("Y", testConsumer2.receive(1000));
expect("Z", testConsumer2.receive(1000));
+ testConsumer1 = testSession.createConsumer(queue1);
assertTrue(null == testConsumer1.receive(1000));
assertTrue(null == testConsumer2.receive(1000));
}
@@ -136,6 +136,7 @@
expect("B", consumer1.receive(1000));
expect("C", consumer1.receive(1000));
+ testConsumer1 = testSession.createConsumer(queue1);
assertTrue(null == testConsumer1.receive(1000));
assertTrue(null == testConsumer2.receive(1000));
}
Index:
client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
===================================================================
---
client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
(revision 500300)
+++
client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
(working copy)
@@ -58,7 +58,7 @@
{
super.setUp();
TransportConnection.createVMBroker(1);
- queue1 = new AMQQueue("Q1", false);
+ queue1 = new AMQQueue(new AMQShortString("Q1"), new
AMQShortString("Q1"), false, true);
queue2 = new AMQQueue("Q2", false);
con = new AMQConnection("vm://:1", "guest", "guest", "TransactedTest",
"test");