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 25 29 public class SingleBrokerScenario extends ProducerConsumerScenarioSupport { 30 31 private BrokerAgent broker; 32 33 public SingleBrokerScenario(BrokerAgent broker, ProducerAgent producer, ConsumerAgent consumer, MessageList list) { 34 super(producer, consumer, list); 35 this.broker = broker; 36 } 37 38 public void run() throws Exception { 39 producer.sendMessages(messageList); 40 consumer.assertConsumed(messageList); 41 } 42 43 public void start() throws Exception { 44 start(broker); 45 46 consumer.connectTo(broker); 47 producer.connectTo(broker); 48 49 super.start(); 50 } 51 52 } 53 | Popular Tags |