1 18 package org.apache.activemq.systest.usecase.network; 19 20 import org.apache.activemq.systest.BrokerAgent; 21 import org.apache.activemq.systest.ConsumerAgent; 22 import org.apache.activemq.systest.MessageList; 23 import org.apache.activemq.systest.ProducerAgent; 24 import org.apache.activemq.systest.QueueOnlyScenario; 25 26 30 public class TwoBrokerFailoverScenario extends TwoBrokerNetworkScenario implements QueueOnlyScenario { 31 32 public TwoBrokerFailoverScenario(BrokerAgent brokera, BrokerAgent brokerb, ProducerAgent producer, ConsumerAgent consumer, MessageList list) { 33 super(brokera, brokerb, producer, consumer, list); 34 } 35 36 public void run() throws Exception { 37 producer.sendMessages(messageList, 30); 38 consumer.waitUntilConsumed(messageList, 20); 39 40 consumer.stop(); 41 brokerB.kill(); 42 consumer.connectTo(brokerA); 43 consumer.start(); 44 45 producer.sendMessages(messageList); 46 47 consumer.assertConsumed(messageList); 48 } 49 50 } 51 | Popular Tags |