From 1877a14a6020f5dbee6759eff62ae509a11fb54a Mon Sep 17 00:00:00 2001 From: "Hiram R. Chirino" Date: Tue, 27 Nov 2012 14:24:55 +0000 Subject: [PATCH] Changes for https://issues.apache.org/jira/browse/AMQ-4165 : Remove pure master/slave functionality git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1414203 13f79535-47bb-0310-9956-ffa450edef68 --- .../broker/ft/JDBCQueueMasterSlaveTest.java | 2 +- .../ft/QueueMasterSlaveSingleUrlTest.java | 3 +- ....java => QueueMasterSlaveTestSupport.java} | 4 +- ...eueMasterSlaveTestUsingSharedFileTest.java | 2 +- ...terConnectorElementCompositeQueueTest.java | 45 ------------------- ...rSlaveUsingMasterConnectorElementTest.java | 30 ------------- .../broker/ft/TopicMasterSlaveTest.java | 44 ------------------ .../org/apache/activemq/broker/ft/master.xml | 34 -------------- .../org/apache/activemq/broker/ft/slave.xml | 35 --------------- .../org/apache/activemq/broker/ft/slave2.xml | 41 ----------------- 10 files changed, 5 insertions(+), 235 deletions(-) rename activemq-core/src/test/java/org/apache/activemq/broker/ft/{QueueMasterSlaveTest.java => QueueMasterSlaveTestSupport.java} (97%) delete mode 100644 activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementCompositeQueueTest.java delete mode 100644 activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementTest.java delete mode 100644 activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java delete mode 100755 activemq-core/src/test/resources/org/apache/activemq/broker/ft/master.xml delete mode 100755 activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave.xml delete mode 100755 activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave2.xml diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java index cef95aa53b..3a96db149a 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/ft/JDBCQueueMasterSlaveTest.java @@ -33,7 +33,7 @@ import org.apache.activemq.store.jdbc.JDBCPersistenceAdapter; import org.apache.activemq.util.IOHelper; import org.apache.derby.jdbc.EmbeddedDataSource; -public class JDBCQueueMasterSlaveTest extends QueueMasterSlaveTest { +public class JDBCQueueMasterSlaveTest extends QueueMasterSlaveTestSupport { protected DataSource sharedDs; protected String MASTER_URL = "tcp://localhost:62001"; protected String SLAVE_URL = "tcp://localhost:62002"; diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java index 63bd1e53be..70d59cbbef 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java @@ -17,7 +17,6 @@ package org.apache.activemq.broker.ft; import java.io.File; -import java.io.IOException; import java.net.URI; import org.apache.activemq.ActiveMQConnectionFactory; @@ -26,7 +25,7 @@ import org.apache.activemq.broker.TransportConnector; import org.apache.activemq.store.amq.AMQPersistenceAdapter; -public class QueueMasterSlaveSingleUrlTest extends QueueMasterSlaveTest { +public class QueueMasterSlaveSingleUrlTest extends QueueMasterSlaveTestSupport { private final String brokerUrl = "tcp://localhost:62001"; private final String singleUriString = "failover://(" + brokerUrl +")?randomize=false"; diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestSupport.java similarity index 97% rename from activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTest.java rename to activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestSupport.java index 5ae54e4c50..ed7867d404 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestSupport.java @@ -39,8 +39,8 @@ import org.springframework.core.io.ClassPathResource; /** * Test failover for Queues */ -public class QueueMasterSlaveTest extends JmsTopicSendReceiveWithTwoConnectionsTest { - private static final transient Logger LOG = LoggerFactory.getLogger(QueueMasterSlaveTest.class); +abstract public class QueueMasterSlaveTestSupport extends JmsTopicSendReceiveWithTwoConnectionsTest { + private static final transient Logger LOG = LoggerFactory.getLogger(QueueMasterSlaveTestSupport.class); protected BrokerService master; protected AtomicReference slave = new AtomicReference(); diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestUsingSharedFileTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestUsingSharedFileTest.java index 40cef973d4..c9f178dd47 100644 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestUsingSharedFileTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveTestUsingSharedFileTest.java @@ -17,7 +17,7 @@ package org.apache.activemq.broker.ft; public class QueueMasterSlaveTestUsingSharedFileTest extends - QueueMasterSlaveTest { + QueueMasterSlaveTestSupport { protected String getSlaveXml() { return "org/apache/activemq/broker/ft/sharedFileSlave.xml"; diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementCompositeQueueTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementCompositeQueueTest.java deleted file mode 100644 index 3f7862e53f..0000000000 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementCompositeQueueTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.broker.ft; - -/** - * Let's test composite destinations - * - */ -public class QueueMasterSlaveUsingMasterConnectorElementCompositeQueueTest extends QueueMasterSlaveUsingMasterConnectorElementTest { - - /** - * Returns the consumer subject. - * - * @return String - consumer subject - * @see org.apache.activemq.test.TestSupport#getConsumerSubject() - */ - protected String getConsumerSubject() { - return "FOO.BAR.HUMBUG2"; - } - - /** - * Returns the producer subject. - * - * @return String - producer subject - * @see org.apache.activemq.test.TestSupport#getProducerSubject() - */ - protected String getProducerSubject() { - return "queue://FOO.BAR.HUMBUG,queue://FOO.BAR.HUMBUG2"; - } - -} \ No newline at end of file diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementTest.java deleted file mode 100644 index 7d5c7ef0f2..0000000000 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveUsingMasterConnectorElementTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.broker.ft; - -/** - * Lets test using a element instead of the old masterConnectorURI attribute - * - * - */ -public class QueueMasterSlaveUsingMasterConnectorElementTest extends QueueMasterSlaveTest { - - protected String getSlaveXml() { - return "org/apache/activemq/broker/ft/slave2.xml"; - } - -} diff --git a/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java b/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java deleted file mode 100644 index 617c447e76..0000000000 --- a/activemq-core/src/test/java/org/apache/activemq/broker/ft/TopicMasterSlaveTest.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.activemq.broker.ft; - -import javax.jms.Connection; -import javax.jms.Destination; -import javax.jms.JMSException; -import javax.jms.MessageConsumer; -import javax.jms.Session; -import javax.jms.Topic; - -/** - * Test failover for Queues - */ -public class TopicMasterSlaveTest extends QueueMasterSlaveTest { - - protected boolean isTopic() { - return true; - } - - protected MessageConsumer createConsumer(Session session, Destination dest) throws JMSException { - return session.createDurableSubscriber((Topic)dest, "subName"); - } - - protected Connection createReceiveConnection() throws Exception { - Connection result = super.createReceiveConnection(); - result.setClientID("clientId"); - return result; - } -} diff --git a/activemq-core/src/test/resources/org/apache/activemq/broker/ft/master.xml b/activemq-core/src/test/resources/org/apache/activemq/broker/ft/master.xml deleted file mode 100755 index 3fbc3d1119..0000000000 --- a/activemq-core/src/test/resources/org/apache/activemq/broker/ft/master.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - diff --git a/activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave.xml b/activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave.xml deleted file mode 100755 index a0723a370e..0000000000 --- a/activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave2.xml b/activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave2.xml deleted file mode 100755 index 888cade483..0000000000 --- a/activemq-core/src/test/resources/org/apache/activemq/broker/ft/slave2.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - -