From d4534e1eadc2c10959342ccafc59ae32ba65a06e Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Sat, 11 Apr 2009 01:39:50 +0000 Subject: QPID-1204 : Augmented test to cope with case were Session was closed before we could extract the AuthenticationException git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@764141 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/server/security/acl/SimpleACLTest.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'qpid/java') diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java index 5d0e7f9186..4db11e7db8 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java @@ -619,8 +619,16 @@ public class SimpleACLTest extends QpidTestCase implements ConnectionListener { 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()); + } } } -- cgit v1.2.1