diff options
author | Martin Ritchie <ritchiem@apache.org> | 2009-04-11 01:39:50 +0000 |
---|---|---|
committer | Martin Ritchie <ritchiem@apache.org> | 2009-04-11 01:39:50 +0000 |
commit | d4534e1eadc2c10959342ccafc59ae32ba65a06e (patch) | |
tree | 780a42c6d97f859fa60585934fbd5571e852cec4 /qpid | |
parent | 498f877a585af34af4a877031f54b8a65561c7ce (diff) | |
download | qpid-python-d4534e1eadc2c10959342ccafc59ae32ba65a06e.tar.gz |
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
Diffstat (limited to 'qpid')
-rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java | 12 |
1 files changed, 10 insertions, 2 deletions
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()); + } } } |