From 32bfd712449b0839d9f302f8168c4f588e3c6070 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Mon, 7 Sep 2009 08:51:08 +0000 Subject: 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/qpid@812043 13f79535-47bb-0310-9956-ffa450edef68 --- .../unit/close/JavaServerCloseRaceConditionTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'java') diff --git a/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java index 7ff603df96..3eddc8d7a5 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java +++ b/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()); + } + } + } } -- cgit v1.2.1