Author: rajith
Date: Mon Oct 18 16:06:19 2010
New Revision: 1023879

URL: http://svn.apache.org/viewvc?rev=1023879&view=rev
Log:
QPID-2339
Added a test case for the above JIRA.

Modified:
    
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
    qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes

Modified: 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java?rev=1023879&r1=1023878&r2=1023879&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
 (original)
+++ 
qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
 Mon Oct 18 16:06:19 2010
@@ -271,6 +271,28 @@ public class ConnectionTest extends Qpid
         }
         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()
     {

Modified: qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes?rev=1023879&r1=1023878&r2=1023879&view=diff
==============================================================================
--- qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes (original)
+++ qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes Mon Oct 18 16:06:19 
2010
@@ -16,3 +16,5 @@ org.apache.qpid.test.client.queue.QueueP
 // Those tests are written against the 0.10 path
 org.apache.qpid.test.unit.message.UTF8Test#*
 org.apache.qpid.client.MessageListenerTest#testSynchronousRecieveNoWait
+
+org.apache.qpid.test.unit.client.connection.ConnectionTest#testUnsupportedSASLMechanism



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscr...@qpid.apache.org

Reply via email to