diff options
Diffstat (limited to 'sandbox/event/samples/event-jms/src/test')
-rw-r--r-- | sandbox/event/samples/event-jms/src/test/java/weather/WeatherTestCase.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sandbox/event/samples/event-jms/src/test/java/weather/WeatherTestCase.java b/sandbox/event/samples/event-jms/src/test/java/weather/WeatherTestCase.java index a251de53c2..dfff7cc666 100644 --- a/sandbox/event/samples/event-jms/src/test/java/weather/WeatherTestCase.java +++ b/sandbox/event/samples/event-jms/src/test/java/weather/WeatherTestCase.java @@ -20,6 +20,7 @@ package weather; +import org.apache.activemq.broker.BrokerService; import org.apache.tuscany.sca.host.embedded.SCADomain; import org.junit.After; import org.junit.Before; @@ -33,14 +34,19 @@ import weather.WeatherService; */ public class WeatherTestCase { + private BrokerService jmsBroker; + private WeatherService weatherService; private SCADomain weatherSubscriberDomain; private SCADomain weatherPublisherDomain; @Before - public void startClient() throws Exception { + public void startWeatherTest() throws Exception { try { + + startBroker(); + weatherPublisherDomain = SCADomain.newInstance("weatherPublisher.composite"); weatherSubscriberDomain = SCADomain.newInstance("weatherSubscriber.composite"); weatherService = weatherPublisherDomain.getService(WeatherService.class, "WeatherPublisherComponent"); @@ -51,7 +57,7 @@ public class WeatherTestCase { } @Test - public void testClient() throws Exception { + public void runWeatherTest() throws Exception { weatherService.start(); } @@ -62,5 +68,13 @@ public class WeatherTestCase { weatherSubscriberDomain.close(); } - + + + protected void startBroker() throws Exception { + jmsBroker = new BrokerService(); + jmsBroker.setPersistent(false); + jmsBroker.setUseJmx(false); + jmsBroker.addConnector("tcp://localhost:61619"); + jmsBroker.start(); + } } |