summaryrefslogtreecommitdiff
path: root/java/systests/src
diff options
context:
space:
mode:
authorRobert Gemmell <robbie@apache.org>2011-09-13 00:26:40 +0000
committerRobert Gemmell <robbie@apache.org>2011-09-13 00:26:40 +0000
commit79f25ae18103afc16bd92abf8ed31df1992f13cf (patch)
treeb9421cd313d59d33c0092926ee98fb48dc0c5e40 /java/systests/src
parent6c83b9c3c46f31bebcdefc0359b8125391ef6c6f (diff)
downloadqpid-python-79f25ae18103afc16bd92abf8ed31df1992f13cf.tar.gz
QPID-3428: make the Java broker validate 0-10 Session names, enabling it to satisfy the clients new ClientID verification feature. Misc updates to the clients verification process.
Applied patch from Andrew MacBean git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1169982 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests/src')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java28
1 files changed, 22 insertions, 6 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
index fe2ea6ef10..328719813a 100644
--- a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
+++ b/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
@@ -292,9 +292,10 @@ public class ConnectionTest extends QpidBrokerTestCase
}
}
- public void testClientIDVerification() throws Exception
+ public void testClientIDVerificationForSameUser() throws Exception
{
- System.setProperty("qpid.verify_client_id", "true");
+ setTestSystemProperty("qpid.verify_client_id", "true");
+
BrokerDetails broker = getBroker();
try
{
@@ -302,19 +303,34 @@ public class ConnectionTest extends QpidBrokerTestCase
"client_id", "test");
Connection con2 = new AMQConnection(broker.toString(), "guest", "guest",
- "client_id", "test");
+ "client_id", "test");
fail("The client should throw a ConnectionException stating the" +
" client ID is not unique");
}
catch (Exception e)
{
- assertTrue("Incorrect exception thrown",
+ assertTrue("Incorrect exception thrown: " + e.getMessage(),
e.getMessage().contains("ClientID must be unique"));
}
- finally
+ }
+
+ public void testClientIDVerificationForDifferentUsers() throws Exception
+ {
+ setTestSystemProperty("qpid.verify_client_id", "true");
+
+ BrokerDetails broker = getBroker();
+ try
+ {
+ Connection con = new AMQConnection(broker.toString(), "guest", "guest",
+ "client_id", "test");
+
+ Connection con2 = new AMQConnection(broker.toString(), "admin", "admin",
+ "client_id", "test");
+ }
+ catch (Exception e)
{
- System.setProperty("qpid.verify_client_id", "false");
+ fail("Unexpected exception thrown, client id was not unique but usernames were different! " + e.getMessage());
}
}