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 | b91e4b41ad7cc05535b220f6a398f9b3e4f126dc (patch) | |
| tree | 8347af7950adb9d682a267a9fa3ea94c00242a4a /java | |
| parent | 7c21f856b84db3c6539b8a6c01efdcdbb8dd414f (diff) | |
| download | qpid-python-b91e4b41ad7cc05535b220f6a398f9b3e4f126dc.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/qpid@764141 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
| -rw-r--r-- | java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java b/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java index 5d0e7f9186..4db11e7db8 100644 --- a/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java +++ b/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()); + } } } |
