summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2008-03-03 17:44:03 +0000
committerMartin Ritchie <ritchiem@apache.org>2008-03-03 17:44:03 +0000
commit655e52b228ca233027f32ba54f7e94c88754a5c8 (patch)
treec99795f5bedd0d5040af38178117b96d3f8aa5d7
parent0eadb79ee82aadfc6fa6d2b81aa483cf3f62d7d4 (diff)
downloadqpid-python-655e52b228ca233027f32ba54f7e94c88754a5c8.tar.gz
QPID-107 : Updated two test cases that can fail due to the session being closed before we can attempt to use the connection. Also there is no way to get any exception that has occurred on the connection
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@633201 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java15
1 files changed, 15 insertions, 0 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 8ed3605723..a643230bc2 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
@@ -31,6 +31,7 @@ import org.apache.qpid.jms.ConnectionListener;
import org.apache.qpid.url.URLSyntaxException;
import javax.jms.*;
+import javax.jms.IllegalStateException;
import java.io.File;
@@ -288,6 +289,7 @@ public class SimpleACLTest extends TestCase implements ConnectionListener
DeliveryMode.NON_PERSISTENT, 0, 0L, false, false, true);
// Test the connection with a valid consumer
+ // This may fail as the session may be closed before the queue or the consumer created.
session.createConsumer(session.createTemporaryQueue()).close();
//Connection should now be closed and will throw the exception caused by the above send
@@ -295,6 +297,11 @@ public class SimpleACLTest extends TestCase implements ConnectionListener
fail("Close is not expected to succeed.");
}
+ catch (IllegalStateException ise)
+ {
+ System.err.println("QPID-826 : WARNING : Unable to determine cause of failure due to closure as we don't " +
+ "record it for reporting after connection closed asynchronously");
+ }
catch (JMSException e)
{
Throwable cause = e.getLinkedException();
@@ -540,6 +547,9 @@ public class SimpleACLTest extends TestCase implements ConnectionListener
DeliveryMode.NON_PERSISTENT, 0, 0L, false, false, true);
// Test the connection with a valid consumer
+ // This may not work as the session may be closed before the queue or consumer creation can occur.
+ // The correct JMSexception with linked error will only occur when the close method is recevied whilst in
+ // the failover safe block
session.createConsumer(session.createQueue("example.RequestQueue")).close();
//Connection should now be closed and will throw the exception caused by the above send
@@ -547,6 +557,11 @@ public class SimpleACLTest extends TestCase implements ConnectionListener
fail("Close is not expected to succeed.");
}
+ catch (IllegalStateException ise)
+ {
+ System.err.println("QPID-826 : WARNING : Unable to determine cause of failure due to closure as we don't " +
+ "record it for reporting after connection closed asynchronously");
+ }
catch (JMSException e)
{
Throwable cause = e.getLinkedException();