summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2009-09-07 08:51:08 +0000
committerMartin Ritchie <ritchiem@apache.org>2009-09-07 08:51:08 +0000
commit32bfd712449b0839d9f302f8168c4f588e3c6070 (patch)
tree6fe4fb4371db0fbf5bd707f8f0115ec6054ee713 /java
parent2275ab4331a8ebb2488ec89316b540fe230b0e69 (diff)
downloadqpid-python-32bfd712449b0839d9f302f8168c4f588e3c6070.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/qpid@812043 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java')
-rw-r--r--java/systests/src/main/java/org/apache/qpid/test/unit/close/JavaServerCloseRaceConditionTest.java17
1 files changed, 17 insertions, 0 deletions
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());
+ }
+ }
+
}
}