From bb83bf5746df6a4089d0b73ec90457b77bda4c39 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Mon, 2 Mar 2015 11:19:57 -0500 Subject: [PATCH] https://issues.apache.org/jira/browse/AMQ-5606 if the client throws the correct exception type, don't fail the test. --- .../activemq/transport/amqp/JMSClientSimpleAuthTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSimpleAuthTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSimpleAuthTest.java index 064e132a8f..2f559e6b7c 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSimpleAuthTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSimpleAuthTest.java @@ -25,6 +25,7 @@ import java.net.URI; import javax.jms.Connection; import javax.jms.JMSException; +import javax.jms.JMSSecurityException; import javax.jms.Message; import javax.jms.MessageConsumer; import javax.jms.MessageProducer; @@ -71,6 +72,8 @@ public class JMSClientSimpleAuthTest { Thread.sleep(500); connection.createSession(false, Session.AUTO_ACKNOWLEDGE); fail("Expected JMSException"); + } catch (JMSSecurityException ex) { + LOG.debug("Failed to authenticate connection with no user / password."); } catch (JMSException e) { Exception linkedException = e.getLinkedException(); if (linkedException != null && linkedException instanceof ConnectionClosedException) { @@ -91,6 +94,8 @@ public class JMSClientSimpleAuthTest { Thread.sleep(500); connection.createSession(false, Session.AUTO_ACKNOWLEDGE); fail("Expected JMSException"); + } catch (JMSSecurityException ex) { + LOG.debug("Failed to authenticate connection with no user / password."); } catch (JMSException e) { Exception linkedException = e.getLinkedException(); if (linkedException != null && linkedException instanceof ConnectionClosedException) { @@ -111,6 +116,8 @@ public class JMSClientSimpleAuthTest { Thread.sleep(500); connection.createSession(false, Session.AUTO_ACKNOWLEDGE); fail("Expected JMSException"); + } catch (JMSSecurityException ex) { + LOG.debug("Failed to authenticate connection with no user / password."); } catch (JMSException e) { Exception linkedException = e.getLinkedException(); if (linkedException != null && linkedException instanceof ConnectionClosedException) {