summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ritchie <ritchiem@apache.org>2010-01-19 20:25:00 +0000
committerMartin Ritchie <ritchiem@apache.org>2010-01-19 20:25:00 +0000
commit065137f8f47e5b0ad14b328c5f69cfd7bb33ac92 (patch)
tree73adbb41da162c2e5506caec624f68415195ad12
parentddd558a8eeb31a597068572d546c80d24a3a491f (diff)
downloadqpid-python-065137f8f47e5b0ad14b328c5f69cfd7bb33ac92.tar.gz
QPID-2262 : Removed SALCT from from exclude list and added required null check.
Updated references to QPID-1204 to QPID-2345 which talks more to the issue of setting exception cause when the connection is closed by the broker. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@900943 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java46
-rw-r--r--qpid/java/test-profiles/Excludes2
2 files changed, 35 insertions, 13 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
index 9487f72ac8..08fc047533 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/server/security/acl/SimpleACLTest.java
@@ -438,17 +438,34 @@ public class SimpleACLTest extends QpidTestCase implements ConnectionListener
catch (JMSException e)
{
Throwable cause = e.getLinkedException();
- if (!(cause instanceof AMQAuthenticationException))
+
+ if (cause == null)
{
- e.printStackTrace();
+ e.printStackTrace(System.out);
+ if (e instanceof IllegalStateException)
+ {
+ System.out.println("QPID-2345: Session became closed and we got that error rather than the authentication error.");
+ }
+ else
+ {
+ fail("JMS Exception of did not have cause.:" + e.getMessage());
+ }
}
- assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
- assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
-
- //use the latch to ensure the control thread waits long enough for the exception thread
- //to have done enough to mark the connection closed before teardown commences
- assertTrue("Timed out waiting for conneciton to report close",
- exceptionReceived.await(2, TimeUnit.SECONDS));
+ else
+ {
+ if (!(cause instanceof AMQAuthenticationException))
+ {
+ e.printStackTrace();
+ }
+ assertEquals("Incorrect exception", AMQAuthenticationException.class, cause.getClass());
+ assertEquals("Incorrect error code thrown", 403, ((AMQAuthenticationException) cause).getErrorCode().getCode());
+
+ //use the latch to ensure the control thread waits long enough for the exception thread
+ //to have done enough to mark the connection closed before teardown commences
+ assertTrue("Timed out waiting for connection to report close",
+ exceptionReceived.await(2, TimeUnit.SECONDS));
+ }
+
}
}
@@ -876,13 +893,20 @@ public class SimpleACLTest extends QpidTestCase implements ConnectionListener
if (cause == null)
{
e.printStackTrace(System.out);
- fail("JMS Exception did not have cause");
+ if (e instanceof IllegalStateException)
+ {
+ System.out.println("QPID-2345: Session became closed and we got that error rather than the authentication error.");
+ }
+ else
+ {
+ fail("JMS Exception of did not have cause.:" + e.getMessage());
+ }
}
else if (!(cause instanceof AMQAuthenticationException))
{
cause.printStackTrace(System.out);
assertEquals("Incorrect exception", IllegalStateException.class, cause.getClass());
- System.out.println("QPID-1204 : Session became closed and we got that error rather than the authentication error.");
+ System.out.println("QPID-2345: Session became closed and we got that error rather than the authentication error.");
}
else
{
diff --git a/qpid/java/test-profiles/Excludes b/qpid/java/test-profiles/Excludes
index 5c6308a2d2..b2f438e487 100644
--- a/qpid/java/test-profiles/Excludes
+++ b/qpid/java/test-profiles/Excludes
@@ -34,5 +34,3 @@ org.apache.qpid.test.unit.ack.AcknowledgeAfterFailoverTest#*
org.apache.qpid.transport.network.mina.MINANetworkDriverTest#*
// QPID-2225 Random Test failures against the in-vm broker.
org.apache.qpid.test.unit.ack.FailoverBeforeConsumingRecover#*
-// QPID-2262 Random test failures - The test needs to be fixed.
-org.apache.qpid.server.security.acl.SimpleACLTest#testClientPublishInvalidQueueSuccess