Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1759510F13 for ; Thu, 26 Feb 2015 22:35:36 +0000 (UTC) Received: (qmail 16083 invoked by uid 500); 26 Feb 2015 22:35:20 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 16037 invoked by uid 500); 26 Feb 2015 22:35:20 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 16025 invoked by uid 99); 26 Feb 2015 22:35:20 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2015 22:35:20 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 12084E0531; Thu, 26 Feb 2015 22:35:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: tabish@apache.org To: commits@activemq.apache.org Message-Id: <999dbb9c37ed4dfeacb0b796e7b3099b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: activemq git commit: https://issues.apache.org/jira/browse/AMQ-5617 Date: Thu, 26 Feb 2015 22:35:20 +0000 (UTC) Repository: activemq Updated Branches: refs/heads/master eaf773da5 -> b5ef92814 https://issues.apache.org/jira/browse/AMQ-5617 Direct all the JMSClient tests to use the indirect calls to create their connection, the Joram tests are a bit harder to make generic and can wait for now. Project: http://git-wip-us.apache.org/repos/asf/activemq/repo Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/b5ef9281 Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/b5ef9281 Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/b5ef9281 Branch: refs/heads/master Commit: b5ef92814e68742ab61bf6bebd7045ff5dcf2427 Parents: eaf773d Author: Timothy Bish Authored: Thu Feb 26 17:35:04 2015 -0500 Committer: Timothy Bish Committed: Thu Feb 26 17:35:04 2015 -0500 ---------------------------------------------------------------------- .../transport/amqp/JMSClientNioPlusSslTest.java | 6 --- .../transport/amqp/JMSClientNioTest.java | 6 --- .../transport/amqp/JMSClientSslTest.java | 14 ------ .../transport/amqp/JMSClientTestSupport.java | 46 +++----------------- 4 files changed, 5 insertions(+), 67 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/activemq/blob/b5ef9281/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioPlusSslTest.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioPlusSslTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioPlusSslTest.java index c7fc178..f13884d 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioPlusSslTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioPlusSslTest.java @@ -28,12 +28,6 @@ public class JMSClientNioPlusSslTest extends JMSClientSslTest { protected static final Logger LOG = LoggerFactory.getLogger(JMSClientNioPlusSslTest.class); @Override - protected int getBrokerPort() { - LOG.debug("JMSClientNioPlusSslTest.getBrokerPort returning nioPlusSslPort {}", amqpNioPlusSslPort); - return amqpNioPlusSslPort; - } - - @Override protected URI getBrokerURI() { return amqpNioPlusSslURI; } http://git-wip-us.apache.org/repos/asf/activemq/blob/b5ef9281/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java index a2f0417..6894362 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientNioTest.java @@ -28,12 +28,6 @@ public class JMSClientNioTest extends JMSClientTest { protected static final Logger LOG = LoggerFactory.getLogger(JMSClientNioTest.class); @Override - protected int getBrokerPort() { - LOG.debug("JMSClientNioTest.getBrokerPort returning nioPort {}", amqpNioPort); - return amqpNioPort; - } - - @Override protected URI getBrokerURI() { return amqpNioURI; } http://git-wip-us.apache.org/repos/asf/activemq/blob/b5ef9281/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSslTest.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSslTest.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSslTest.java index 94af759..a8acb7d 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSslTest.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientSslTest.java @@ -19,8 +19,6 @@ package org.apache.activemq.transport.amqp; import java.net.URI; import java.security.SecureRandom; -import javax.jms.Connection; -import javax.jms.JMSException; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; @@ -43,18 +41,6 @@ public class JMSClientSslTest extends JMSClientTest { } @Override - protected Connection createConnection(String clientId, boolean syncPublish, boolean useSsl) throws JMSException { - LOG.debug("JMSClientSslTest.createConnection called with clientId {} syncPublish {} useSsl {}", clientId, syncPublish, useSsl); - return super.createConnection(clientId, syncPublish, true); - } - - @Override - protected int getBrokerPort() { - LOG.debug("JMSClientSslTest.getBrokerPort returning sslPort {}", amqpSslPort); - return amqpSslPort; - } - - @Override protected URI getBrokerURI() { return amqpSslURI; } http://git-wip-us.apache.org/repos/asf/activemq/blob/b5ef9281/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java ---------------------------------------------------------------------- diff --git a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java index 0da90c3..eebceb0 100644 --- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java +++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/JMSClientTestSupport.java @@ -24,10 +24,8 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import javax.jms.Connection; -import javax.jms.ExceptionListener; import javax.jms.JMSException; -import org.apache.qpid.amqp_1_0.jms.impl.ConnectionFactoryImpl; import org.junit.After; public class JMSClientTestSupport extends AmqpTestSupport { @@ -81,15 +79,6 @@ public class JMSClientTestSupport extends AmqpTestSupport { /** * Can be overridden in subclasses to test against a different transport suchs as NIO. * - * @return the port to connect to on the Broker. - */ - protected int getBrokerPort() { - return amqpPort; - } - - /** - * Can be overridden in subclasses to test against a different transport suchs as NIO. - * * @return the URI to connect to on the Broker for AMQP. */ protected URI getBrokerURI() { @@ -97,44 +86,19 @@ public class JMSClientTestSupport extends AmqpTestSupport { } protected Connection createConnection() throws JMSException { - return createConnection(name.toString(), false, false); + return createConnection(name.toString(), false); } protected Connection createConnection(boolean syncPublish) throws JMSException { - return createConnection(name.toString(), syncPublish, false); + return createConnection(name.toString(), syncPublish); } protected Connection createConnection(String clientId) throws JMSException { - return createConnection(clientId, false, false); + return createConnection(clientId, false); } - protected Connection createConnection(String clientId, boolean syncPublish, boolean useSsl) throws JMSException { - - int brokerPort = getBrokerPort(); - LOG.debug("Creating connection on port {}", brokerPort); - final ConnectionFactoryImpl factory = new ConnectionFactoryImpl("localhost", brokerPort, "admin", "password", null, useSsl); - - if (useSsl) { - factory.setKeyStorePath(System.getProperty("javax.net.ssl.trustStore")); - factory.setKeyStorePassword("password"); - factory.setTrustStorePath(System.getProperty("javax.net.ssl.keyStore")); - factory.setTrustStorePassword("password"); - } - - factory.setSyncPublish(syncPublish); - factory.setTopicPrefix("topic://"); - factory.setQueuePrefix("queue://"); - - final Connection connection = factory.createConnection(); - if (clientId != null && !clientId.isEmpty()) { - connection.setClientID(clientId); - } - connection.setExceptionListener(new ExceptionListener() { - @Override - public void onException(JMSException exception) { - exception.printStackTrace(); - } - }); + protected Connection createConnection(String clientId, boolean syncPublish) throws JMSException { + Connection connection = JMSClientContext.INSTANCE.createConnection(getBrokerURI(), "admin", "password", clientId, syncPublish); connection.start(); return connection; }