diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2009-09-07 08:51:08 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2009-09-07 08:51:08 +0000 |
| commit | 480499dc8acadbba77903ad4afc9b0e7980806e1 (patch) | |
| tree | 6bdfd4ab5c2b41b97373789bfb1fc57033081b62 /qpid/java | |
| parent | 29f0cb06ba0f6e1439bf2179d5258ea3c61e1941 (diff) | |
| download | qpid-python-480499dc8acadbba77903ad4afc9b0e7980806e1.tar.gz | |
QPID-1809 : There is still a race condition between the notification and main threads closing. The issue is ok as the main thread will not perform a syncWait, however, the set exception will be rethrown.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@812043 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java index 7ff603df96..3eddc8d7a5 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java @@ -65,5 +65,22 @@ public class JavaServerCloseRaceConditionTest extends QpidTestCase fail("Cause was not AMQAuthenticationException. Was " + e.getClass() + ":" + e.getMessage()); } } + + try + { + // Depending on if the notification thread has closed the connection + // or not we may get an exception here when we attempt to close the + // connection. If we do get one then it should be the same as above + // an AMQAuthenticationException. + connection.close(); + } + catch (Exception e) + { + if (!(e instanceof AMQAuthenticationException)) + { + fail("Cause was not AMQAuthenticationException. Was " + e.getClass() + ":" + e.getMessage()); + } + } + } } |
