Author: ritchiem
Date: Sat Apr 11 01:49:08 2009
New Revision: 764146

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


Modified:
    
qpid/branches/0.5-release/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java

Modified: 
qpid/branches/0.5-release/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL: 
http://svn.apache.org/viewvc/qpid/branches/0.5-release/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=764146&r1=764145&r2=764146&view=diff
==============================================================================
--- 
qpid/branches/0.5-release/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
 (original)
+++ 
qpid/branches/0.5-release/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
 Sat Apr 11 01:49:08 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:[email protected]

Reply via email to