From e753f271ccf0ff4617725130b82dd21ae721b3d2 Mon Sep 17 00:00:00 2001 From: rsivaram Date: Tue, 21 Oct 2008 09:04:28 +0000 Subject: Event prototype: Initial model changes git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@706556 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/weather/WeatherTestCase.java | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'sandbox/event/samples/event-jms/src/test/java/weather/WeatherTestCase.java') 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(); + } } -- cgit v1.2.3