From f59b10cea2186af9a49607e909e0467619b73258 Mon Sep 17 00:00:00 2001 From: gaohoward Date: Thu, 9 Jul 2015 09:10:15 +0800 Subject: [PATCH] Fix activemq-unit-test failure -- added addConnector() method so new connector can be created for tests -- fix zero-byte key store files that cause test failures -- fix a invm issue in test --- .../java/org/apache/activemq/broker/BrokerService.java | 4 +++- .../broker/artemiswrapper/ArtemisBrokerWrapper.java | 7 +------ .../src/test/java/org/apache/activemq/JmsTestSupport.java | 2 +- .../src/test/resources/client.keystore | 0 .../src/test/resources/server.keystore | 0 5 files changed, 5 insertions(+), 8 deletions(-) mode change 100644 => 100755 tests/activemq5-unit-tests/src/test/resources/client.keystore mode change 100644 => 100755 tests/activemq5-unit-tests/src/test/resources/server.keystore diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java index cf9c93909c..dd34769b9f 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/BrokerService.java @@ -431,7 +431,7 @@ public class BrokerService implements Service public TransportConnector addConnector(String bindAddress) throws Exception { - return null; + return addConnector(new URI(bindAddress)); } public void setIoExceptionHandler(IOExceptionHandler ioExceptionHandler) @@ -653,6 +653,8 @@ public class BrokerService implements Service public TransportConnector addConnector(URI bindAddress) throws Exception { + Integer port = bindAddress.getPort(); + this.extraConnectors.add(port); return null; } diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java index 69136fd80f..822faed30a 100644 --- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java +++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/ArtemisBrokerWrapper.java @@ -64,11 +64,6 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase Set acceptors0 = serverConfig.getAcceptorConfigurations(); Iterator iter0 = acceptors0.iterator(); - while (iter0.hasNext()) - { - System.out.println("===>: " + iter0.next()); - } - Map addressSettings = serverConfig.getAddressesSettings(); String match = "jms.queue.#"; AddressSettings dlaSettings = new AddressSettings(); @@ -168,7 +163,7 @@ public class ArtemisBrokerWrapper extends ArtemisBrokerBase while (iter.hasNext()) { - System.out.println(">: " + iter.next()); + System.out.println("acceptor =>: " + iter.next()); } server.start(); diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTestSupport.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTestSupport.java index 5531410779..29d84c9ecc 100644 --- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTestSupport.java +++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JmsTestSupport.java @@ -107,7 +107,7 @@ public class JmsTestSupport extends CombinationTestSupport { } protected ConnectionFactory createConnectionFactory() throws Exception { - return new ActiveMQConnectionFactory("vm://localhost"); + return new ActiveMQConnectionFactory("tcp://localhost:61616"); } protected BrokerService createBroker() throws Exception { diff --git a/tests/activemq5-unit-tests/src/test/resources/client.keystore b/tests/activemq5-unit-tests/src/test/resources/client.keystore old mode 100644 new mode 100755 diff --git a/tests/activemq5-unit-tests/src/test/resources/server.keystore b/tests/activemq5-unit-tests/src/test/resources/server.keystore old mode 100644 new mode 100755