public void testAllConnectedBrokerNetwork() throws Exception {
  bridgeBrokers("BrokerA","BrokerB");
  bridgeBrokers("BrokerB","BrokerA");
  bridgeBrokers("BrokerB","BrokerC");
  bridgeBrokers("BrokerC","BrokerB");
  bridgeBrokers("BrokerA","BrokerC");
  bridgeBrokers("BrokerC","BrokerA");
  startAllBrokers();
  Destination dest=createDestination("TEST.FOO",true);
  MessageConsumer clientA=createConsumer("BrokerA",dest);
  MessageConsumer clientB=createConsumer("BrokerB",dest);
  MessageConsumer clientC=createConsumer("BrokerC",dest);
  Thread.sleep(2000);
  sendMessages("BrokerA",dest,MESSAGE_COUNT);
  sendMessages("BrokerB",dest,MESSAGE_COUNT);
  sendMessages("BrokerC",dest,MESSAGE_COUNT);
  MessageIdList msgsA=getConsumerMessages("BrokerA",clientA);
  MessageIdList msgsB=getConsumerMessages("BrokerB",clientB);
  MessageIdList msgsC=getConsumerMessages("BrokerC",clientC);
  msgsA.waitForMessagesToArrive(MESSAGE_COUNT * 3);
  msgsB.waitForMessagesToArrive(MESSAGE_COUNT * 3);
  msgsC.waitForMessagesToArrive(MESSAGE_COUNT * 3);
  assertEquals(MESSAGE_COUNT * 3,msgsA.getMessageCount());
  assertEquals(MESSAGE_COUNT * 3,msgsB.getMessageCount());
  assertEquals(MESSAGE_COUNT * 3,msgsC.getMessageCount());
}

public void testAllConnectedBrokerNetwork ( ) throws Exception { bridgeBrokers ( "BrokerA" , "BrokerB" ) ; bridgeBrokers ( "BrokerB" , "BrokerA" ) ; bridgeBrokers ( "BrokerB" , "BrokerC" ) ; bridgeBrokers ( "BrokerC" , "BrokerB" ) ; bridgeBrokers ( "BrokerA" , "BrokerC" ) ; bridgeBrokers ( "BrokerC" , "BrokerA" ) ; startAllBrokers ( ) ; Destination dest = createDestination ( "TEST.FOO" , true ) ; MessageConsumer clientA = createConsumer ( "BrokerA" , dest ) ; MessageConsumer clientB = createConsumer ( "BrokerB" , dest ) ; MessageConsumer clientC = createConsumer ( "BrokerC" , dest ) ; Thread . sleep ( 2000 ) ; sendMessages ( "BrokerA" , dest , MESSAGE_COUNT ) ; sendMessages ( "BrokerB" , dest , MESSAGE_COUNT ) ; sendMessages ( "BrokerC" , dest , MESSAGE_COUNT ) ; MessageIdList msgsA = getConsumerMessages ( "BrokerA" , clientA ) ; MessageIdList msgsB = getConsumerMessages ( "BrokerB" , clientB ) ; MessageIdList msgsC = getConsumerMessages ( "BrokerC" , clientC ) ; msgsA . waitForMessagesToArrive ( MESSAGE_COUNT * 3 ) ; msgsB . waitForMessagesToArrive ( MESSAGE_COUNT * 3 ) ; msgsC . waitForMessagesToArrive ( MESSAGE_COUNT * 3 ) ; assertEquals ( MESSAGE_COUNT * 3 , msgsA . getMessageCount ( ) ) ; assertEquals ( MESSAGE_COUNT * 3 , msgsB . getMessageCount ( ) ) ; assertEquals ( MESSAGE_COUNT * 3 , msgsC . getMessageCount ( ) ) ; }
brokera < - > brokerb < - > brokerc
