activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vijay <vijayender.band...@gmail.com>
Subject Re: Junit Testing Master/Slave Program Hangs forever..
Date Mon, 27 Jun 2011 13:29:23 GMT
As suggested, I changed my code to this, still no luck.Any further
suggestions pls.

	public void testMasterSlaveFailover() throws Exception {
		 cleanupDir("activemq-data");
		 BrokerFactoryBean masterBrokerFactory = new BrokerFactoryBean(new
ClassPathResource("master.xml"));
         masterBrokerFactory.afterPropertiesSet();
         final BrokerService masterBroker = masterBrokerFactory.getBroker();
         
         BrokerFactoryBean slaveBrokerFactory = new BrokerFactoryBean(new
ClassPathResource("slave.xml"));
  	     slaveBrokerFactory.afterPropertiesSet();
  	     final BrokerService slaveBroker = slaveBrokerFactory.getBroker();
  	     
  	     masterBroker.start();
  	     LOG.info("Master started ...");
  	     
  	     slaveBroker.start();
  	     LOG.info("Slave started ...");
  	     
  	     masterBroker.waitUntilStarted();
  	     LOG.info("masterBroker.waitUntilStarted() completed");
  	     
  	     slaveBroker.waitUntilStarted();
  	     LOG.info("slaveBroker.waitUntilStarted() completed");
  	     
  	     //Stop Master
  	     masterBroker.stop();
  	     masterBroker.waitUntilStopped();
  	     assertTrue("Slave indeed master now?", !slaveBroker.isSlave());
  	   
	}

--
View this message in context: http://activemq.2283324.n4.nabble.com/Junit-Testing-Master-Slave-Program-Hangs-forever-tp3623477p3627717.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message