summaryrefslogtreecommitdiff
path: root/qpid/java/systests
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-08-09 23:26:10 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-08-09 23:26:10 +0000
commit335e875366d7cb8775c623e3541b2976172ebd12 (patch)
tree5548b9ce8e4467102ee21a905c15fef9b1a6fc87 /qpid/java/systests
parent8bb3446353548453b09fbd5718469d4b8bd34f4f (diff)
downloadqpid-python-335e875366d7cb8775c623e3541b2976172ebd12.tar.gz
QPID-2002 : Added new message CHN-1004, to allow the reporting of prefetch sizes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@802625 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java22
1 files changed, 17 insertions, 5 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java
index da3f458cef..ea0199570c 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java
@@ -20,6 +20,8 @@
*/
package org.apache.qpid.server.logging;
+import org.apache.qpid.client.AMQConnection;
+
import javax.jms.Connection;
import javax.jms.MessageConsumer;
import javax.jms.Queue;
@@ -52,11 +54,12 @@ public class ChannelLoggingTest extends AbstractTestLogging
* 2. New JMS Session/Channel creation
*
* Output:
- * <date> CHN-1001 : Create : Prefetch <count>
+ * <date> CHN-1001 : Create
+ * <date> CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}
*
* Validation Steps:
- * 3. The CHN ID is correct
- * 4. The prefetch value matches that defined by the requesting client.
+ * 1. The CHN ID is correct
+ * 2. The prefetch value matches that defined by the requesting client.
*
* @throws Exception - if an error occurs
*/
@@ -66,14 +69,16 @@ public class ChannelLoggingTest extends AbstractTestLogging
Connection connection = getConnection();
+ int PREFETCH = 12;
+
// Test that calling session.close gives us the expected output
- connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ ((AMQConnection)connection).createSession(false, Session.AUTO_ACKNOWLEDGE,PREFETCH);
List<String> results = _monitor.findMatches(CHANNEL_PREFIX);
// Validation
- assertEquals("CHN messages not logged", 1, results.size());
+ assertEquals("CHN messages not logged", 2, results.size());
String log = getLog(results.get(0));
// MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1001 : Create
@@ -81,6 +86,13 @@ public class ChannelLoggingTest extends AbstractTestLogging
validateMessageID("CHN-1001", log);
assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log)));
+ log = getLog(results.get(1));
+ // MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}
+ //1 & 2
+ validateMessageID("CHN-1004", log);
+ assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log)));
+ assertTrue("Prefetch Count not correct",getMessageString(fromMessage(log)).endsWith("Count "+PREFETCH));
+
connection.close();
}