diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-10-18 16:06:19 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-10-18 16:06:19 +0000 |
commit | 4c4caa9a8e41235e5c1957020dbb525e2a507dfa (patch) | |
tree | c788967143ec93e801f856aaa707b6f15a122af1 /qpid/java/systests/src/main/java/org | |
parent | a33004d9f40e9d477fb68b83823d3c8f9be6aa26 (diff) | |
download | qpid-python-4c4caa9a8e41235e5c1957020dbb525e2a507dfa.tar.gz |
QPID-2339
Added a test case for the above JIRA.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1023879 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src/main/java/org')
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java index 51fa29b36a..04fc611cd1 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java @@ -271,6 +271,28 @@ public class ConnectionTest extends QpidBrokerTestCase } connection.close(); } + + public void testUnsupportedSASLMechanism() throws Exception + { + BrokerDetails broker = getBroker(); + broker.setProperty(BrokerDetails.OPTIONS_SASL_MECHS, "MY_MECH"); + + try + { + Connection connection = new AMQConnection(broker.toString(), "guest", "guest", + null, "test"); + connection.close(); + fail("The client should throw a ConnectionException stating the" + + " broker does not support the SASL mech specified by the client"); + } + catch (Exception e) + { + assertTrue("Incorrect exception thrown", + e.getMessage().contains("The following SASL mechanisms " + + "[MY_MECH]" + + " specified by the client are not supported by the broker")); + } + } public static junit.framework.Test suite() { |