diff options
| author | Arnaud Simon <arnaudsimon@apache.org> | 2007-10-19 10:50:02 +0000 |
|---|---|---|
| committer | Arnaud Simon <arnaudsimon@apache.org> | 2007-10-19 10:50:02 +0000 |
| commit | 620ed093eee287f9ec83d6239b560b2124138841 (patch) | |
| tree | 03e0d734a23527f53a56129b2c5097ef23bc9b4d /java/client/src/test | |
| parent | c386672b7a049f8dc532d940f6e418998faea3c6 (diff) | |
| download | qpid-python-620ed093eee287f9ec83d6239b560b2124138841.tar.gz | |
changed to manage 0_10 specific semantics
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@586373 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/test')
| -rw-r--r-- | java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java index adc0ab2d20..4c6ca296cd 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java @@ -58,11 +58,13 @@ public class MessageRequeueTest extends TestCase 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 @@ public class MessageRequeueTest extends TestCase 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 @@ public class MessageRequeueTest extends TestCase 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 @@ public class MessageRequeueTest extends TestCase 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; } |
