Author: ritchiem
Date: Mon Mar 3 09:44:03 2008
New Revision: 633201
URL: http://svn.apache.org/viewvc?rev=633201&view=rev
Log:
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
Modified:
incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
Modified:
incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java?rev=633201&r1=633200&r2=633201&view=diff
==============================================================================
---
incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
(original)
+++
incubator/qpid/branches/M2.1/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
Mon Mar 3 09:44:03 2008
@@ -31,6 +31,7 @@
import org.apache.qpid.url.URLSyntaxException;
import javax.jms.*;
+import javax.jms.IllegalStateException;
import java.io.File;
@@ -288,6 +289,7 @@
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 @@
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,12 +547,20 @@
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
conn.close();
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)
{