public void testTopicDinamicallyIncludedBehavior() throws Exception {
  startAllBrokers();
  Destination dest=createDestination("test",true);
  MessageConsumer clientA=createConsumer("BrokerA",dest);
  MessageConsumer clientB=createConsumer("BrokerB",dest);
  Thread.sleep(2 * 1000);
  sendMessages("BrokerA",dest,MESSAGE_COUNT);
  MessageIdList msgsA=getConsumerMessages("BrokerA",clientA);
  msgsA.waitForMessagesToArrive(MESSAGE_COUNT);
  assertEquals(MESSAGE_COUNT,msgsA.getMessageCount());
  MessageIdList msgsB=getConsumerMessages("BrokerB",clientB);
  msgsB.waitForMessagesToArrive(MESSAGE_COUNT);
  assertEquals(0,msgsB.getMessageCount());
}

public void testTopicDinamicallyIncludedBehavior ( ) throws Exception { startAllBrokers ( ) ; Destination dest = createDestination ( "test" , true ) ; MessageConsumer clientA = createConsumer ( "BrokerA" , dest ) ; MessageConsumer clientB = createConsumer ( "BrokerB" , dest ) ; Thread . sleep ( 2 * 1000 ) ; sendMessages ( "BrokerA" , dest , MESSAGE_COUNT ) ; MessageIdList msgsA = getConsumerMessages ( "BrokerA" , clientA ) ; msgsA . waitForMessagesToArrive ( MESSAGE_COUNT ) ; assertEquals ( MESSAGE_COUNT , msgsA . getMessageCount ( ) ) ; MessageIdList msgsB = getConsumerMessages ( "BrokerB" , clientB ) ; msgsB . waitForMessagesToArrive ( MESSAGE_COUNT ) ; assertEquals ( 0 , msgsB . getMessageCount ( ) ) ; }
brokera - > brokerb & & brokerb - > brokera
