Return-Path: Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: (qmail 47967 invoked from network); 3 Jul 2009 14:34:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Jul 2009 14:34:58 -0000 Received: (qmail 62833 invoked by uid 500); 3 Jul 2009 14:35:09 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 62779 invoked by uid 500); 3 Jul 2009 14:35:09 -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 62770 invoked by uid 99); 3 Jul 2009 14:35:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 14:35:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jul 2009 14:35:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E425C2388876; Fri, 3 Jul 2009 14:34:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r790929 - /activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java Date: Fri, 03 Jul 2009 14:34:46 -0000 To: commits@activemq.apache.org From: gtully@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090703143446.E425C2388876@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: gtully Date: Fri Jul 3 14:34:46 2009 New Revision: 790929 URL: http://svn.apache.org/viewvc?rev=790929&view=rev Log: validate shared file system master/slave with single shared brokerurl Added: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java (with props) Added: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java?rev=790929&view=auto ============================================================================== --- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java (added) +++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java Fri Jul 3 14:34:46 2009 @@ -0,0 +1,63 @@ +/** + * 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 java.net.URI; + +import org.apache.activemq.ActiveMQConnectionFactory; +import org.apache.activemq.broker.BrokerService; +import org.apache.activemq.broker.TransportConnector; + + +public class QueueMasterSlaveSingleUrlTest extends QueueMasterSlaveTest { + private final String brokerUrl = "tcp://localhost:62001"; + private final String singleUriString = "failover://(" + brokerUrl +")?randomize=false"; + + protected ActiveMQConnectionFactory createConnectionFactory() throws Exception { + return new ActiveMQConnectionFactory(singleUriString); + } + + protected void createMaster() throws Exception { + master = new BrokerService(); + master.setBrokerName("shared"); + master.addConnector(brokerUrl); + master.start(); + } + + protected void createSlave() throws Exception { + new Thread(new Runnable() { + public void run() { + try { + BrokerService broker = new BrokerService(); + broker.setBrokerName("shared"); + // add transport as a service so that it is bound on start, after store started + final TransportConnector tConnector = new TransportConnector(); + tConnector.setUri(new URI(brokerUrl)); + broker.addConnector(tConnector); + + broker.start(); + slave.set(broker); + slaveStarted.countDown(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + }).start(); + } + +} Propchange: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/broker/ft/QueueMasterSlaveSingleUrlTest.java ------------------------------------------------------------------------------ svn:keywords = Rev Date