@Override
 protected void tearDown() throws Exception {
   super.tearDown();
   for (Iterator<BrokerService> iter = brokers.values().iterator(); iter.hasNext(); ) {
     BrokerService broker = iter.next();
     ServiceSupport.dispose(broker);
     iter.remove();
   }
 }
  @Override
  protected void setUp() throws Exception {
    sendFactory = createSenderConnectionFactory();
    receiveFactory = createReceiverConnectionFactory();

    // Give server enough time to setup,
    // so we don't lose messages when connection fails
    LOG.info("Waiting for brokers Initialize.");
    Thread.sleep(5000);
    LOG.info("Brokers should be initialized by now.. starting test.");

    super.setUp();
  }