You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ri...@apache.org on 2009/04/11 03:39:51 UTC

svn commit: r764141 - /qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java

Author: ritchiem
Date: Sat Apr 11 01:39:50 2009
New Revision: 764141

URL: http://svn.apache.org/viewvc?rev=764141&view=rev
Log:
QPID-1204 : Augmented test to cope with case were Session was closed before we could extract the AuthenticationException

Modified:
    qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java

Modified: qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=764141&r1=764140&r2=764141&view=diff
==============================================================================
--- qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java (original)
+++ qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java Sat Apr 11 01:39:50 2009
@@ -619,8 +619,16 @@
         {
             Throwable cause = e.getLinkedException();
 
-            assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
-            assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
+            if (!(cause instanceof AMQAuthenticationException))
+            {
+                assertEquals("Incorrect exception", IllegalStateException.class, cause.getClass());
+                System.out.println("QPID-1204 : Session became closed and we got that error rather than the authentication error.");
+            }
+            else
+            {
+                assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
+                assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
+            }
         }
     }
 



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