Author: arnaudsimon
Date: Fri Oct 19 03:50:02 2007
New Revision: 586373
URL: http://svn.apache.org/viewvc?rev=586373&view=rev
Log:
changed to manage 0_10 specific semantics
Modified:
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
Modified:
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java?rev=586373&r1=586372&r2=586373&view=diff
==============================================================================
---
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
(original)
+++
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
Fri Oct 19 03:50:02 2007
@@ -58,11 +58,13 @@
private long[] receieved = new long[numTestMessages + 1];
private boolean passed = false;
+ QpidClientConnection conn;
+
protected void setUp() throws Exception
{
super.setUp();
- QpidClientConnection conn = new QpidClientConnection(BROKER);
+ conn = new QpidClientConnection(BROKER);
conn.connect();
// clear queue
@@ -142,6 +144,7 @@
msg = consumer.receive(1000);
}
+ _logger.info("consuming done.");
conn.getSession().commit();
consumer.close();
assertEquals("number of consumed messages does not match initial
data", (int) numTestMessages, messagesReceived);
@@ -151,22 +154,26 @@
list.append("Failed to receive:");
int failed = 0;
- for (long b : messageLog)
+ // wit 0_10 we can have a delivery tag of 0
+ if (conn.isBroker08())
{
- if ((b == 0) && (index != 0)) // delivery tag of zero shouldn't
exist
+ for (long b : messageLog)
{
- _logger.error("Index: " + index + " was not received.");
- list.append(" ");
- list.append(index);
- list.append(":");
- list.append(b);
- failed++;
+ if ((b == 0) && (index != 0)) // delivery tag of zero
shouldn't exist
+ {
+ _logger.error("Index: " + index + " was not received.");
+ list.append(" ");
+ list.append(index);
+ list.append(":");
+ list.append(b);
+ failed++;
+ }
+
+ index++;
}
- index++;
+ assertEquals(list.toString(), 0, failed);
}
-
- assertEquals(list.toString(), 0, failed);
_logger.info("consumed: " + messagesReceived);
conn.disconnect();
passed = true;
@@ -216,23 +223,25 @@
StringBuilder list = new StringBuilder();
list.append("Failed to receive:");
int failed = 0;
-
- for (long b : receieved)
+ if (conn.isBroker08())
{
- if ((b == 0) && (index != 0)) // delivery tag of zero shouldn't
exist (and we don't have msg 0)
+ for (long b : receieved)
{
- _logger.error("Index: " + index + " was not received.");
- list.append(" ");
- list.append(index);
- list.append(":");
- list.append(b);
- failed++;
+ if ((b == 0) && (index != 0)) // delivery tag of zero
shouldn't exist (and we don't have msg 0)
+ {
+ _logger.error("Index: " + index + " was not received.");
+ list.append(" ");
+ list.append(index);
+ list.append(":");
+ list.append(b);
+ failed++;
+ }
+
+ index++;
}
- index++;
+ assertEquals(list.toString() + "-" + numTestMessages + "-" +
totalConsumed, 0, failed);
}
-
- assertEquals(list.toString() + "-" + numTestMessages + "-" +
totalConsumed, 0, failed);
assertEquals("number of consumed messages does not match initial
data", numTestMessages, totalConsumed);
passed = true;
}