summaryrefslogtreecommitdiff
path: root/qpid/java/systests/src/main
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-02-04 16:15:27 +0000
committerRobert Gemmell <robbie@apache.org>2011-02-04 16:15:27 +0000
commitd79e40667ca674d9c206b43f1ffbb1dcbecfc7ff (patch)
tree6009aef670fc737332ed954e8d1a72d0ef6f52fd /qpid/java/systests/src/main
parent5e34c79ab85ff75a929353590cd1b90ce1b91b67 (diff)
downloadqpid-python-d79e40667ca674d9c206b43f1ffbb1dcbecfc7ff.tar.gz
QPID-3029: actually set and negotiate the supported max num channels per connection during connection handshake. Enable/make the 0-10 client use channel numbers 0 to N-1 in line with the spec, rather than 1-N.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1067210 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src/main')
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/logging/ChannelLoggingTest.java6
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java13
2 files changed, 11 insertions, 8 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 bd9b18d848..02d0d6f334 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
@@ -75,7 +75,7 @@ public class ChannelLoggingTest extends AbstractTestLogging
String log = getLogMessage(results, 0);
// MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1001 : Create
validateMessageID("CHN-1001", log);
- assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log)));
+ assertEquals("Incorrect Channel in actor:"+fromActor(log), isBroker010()? 0 : 1, getChannelID(fromActor(log)));
if (isBroker08())
{
@@ -89,7 +89,7 @@ public class ChannelLoggingTest extends AbstractTestLogging
log = getLogMessage(results, 0);
// MESSAGE [con:0(guest@anonymous(3273383)/test)/ch:1] CHN-1004 : Prefetch Size (bytes) {0,number} : Count {1,number}
validateMessageID("CHN-1004", log);
- assertEquals("Incorrect Channel in actor:"+fromActor(log), 1, getChannelID(fromActor(log)));
+ assertEquals("Incorrect Channel in actor:"+fromActor(log), isBroker010()? 0 : 1, getChannelID(fromActor(log)));
assertTrue("Prefetch Count not correct",getMessageString(fromMessage(log)).endsWith("Count "+PREFETCH));
}
@@ -306,7 +306,7 @@ public class ChannelLoggingTest extends AbstractTestLogging
validateMessageID("CHN-1001", open);
validateMessageID("CHN-1003", close);
assertEquals("Message should be Close", "Close", getMessageString(fromMessage(close)));
- assertEquals("Incorrect Channel ID closed", 1, getChannelID(fromSubject(close)));
+ assertEquals("Incorrect Channel ID closed", isBroker010()? 0 : 1, getChannelID(fromSubject(close)));
assertEquals("Channel IDs should be the same", getChannelID(fromActor(open)), getChannelID(fromSubject(close)));
assertEquals("Connection IDs should be the same", getConnectionID(fromActor(open)), getConnectionID(fromSubject(close)));
}
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
index 5e83b0569d..292bcd6039 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
@@ -266,19 +266,22 @@ public class AMQConnectionTest extends QpidBrokerTestCase
}
}
- public void testGetChannelID()
+ public void testGetChannelID() throws Exception
{
- int maxChannelID = 65536;
+ long maxChannelID = _connection.getMaximumChannelCount();
if (isBroker010())
{
- maxChannelID = Integer.MAX_VALUE+1;
+ //Usable numbers are 0 to N-1 when using 0-10
+ //and 1 to N for 0-8/0-9
+ maxChannelID = maxChannelID-1;
}
for (int j = 0; j < 3; j++)
{
- for (int i = 1; i < maxChannelID; i++)
+ int i = isBroker010() ? 0 : 1;
+ for ( ; i <= maxChannelID; i++)
{
int id = _connection.getNextChannelID();
- assertEquals("On iterartion "+j, i, id);
+ assertEquals("Unexpected number on iteration "+j, i, id);
_connection.deregisterSession(id);
}
}