X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=system%2Fspring%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fspring%2FSpringSystemTest.java;h=1543b7ab8cd39067b6d9a9aa64450c9a733a8669;hb=6f277575685808a5c5a76555dd3e839dc5255031;hp=e12e0113a46e2d9a2b42e7f1b9ca3929d3cc64f2;hpb=fd4cca82a8da5d7e347a1ae40f25db245f0ad235;p=utils diff --git a/system/spring/src/test/java/org/wamblee/system/spring/SpringSystemTest.java b/system/spring/src/test/java/org/wamblee/system/spring/SpringSystemTest.java index e12e0113..1543b7ab 100644 --- a/system/spring/src/test/java/org/wamblee/system/spring/SpringSystemTest.java +++ b/system/spring/src/test/java/org/wamblee/system/spring/SpringSystemTest.java @@ -5,14 +5,14 @@ import java.util.Map; import junit.framework.TestCase; -import org.wamblee.system.AbstractServiceDescriptor; -import org.wamblee.system.DefaultProvidedServiceDescriptor; -import org.wamblee.system.DefaultRequiredServiceDescriptor; +import org.wamblee.system.AbstractInterfaceDescriptor; +import org.wamblee.system.DefaultProvidedInterfaceDescriptor; +import org.wamblee.system.DefaultRequiredInterfaceDescriptor; import org.wamblee.system.DefaultServiceRegistry; -import org.wamblee.system.ProvidedServiceDescriptor; -import org.wamblee.system.RequiredServiceDescriptor; +import org.wamblee.system.ProvidedInterfaceDescriptor; +import org.wamblee.system.RequiredInterfaceDescriptor; import org.wamblee.system.Service; -import org.wamblee.system.ServiceDescriptor; +import org.wamblee.system.InterfaceDescriptor; import org.wamblee.system.ServiceRegistry; import org.wamblee.system.SystemAssemblyException; @@ -32,8 +32,8 @@ public class SpringSystemTest extends TestCase { public void testBlackboxSystem() { SpringSystem system = new SpringSystem("system", _registry, new String[] { HELLO_SERVICE_SPRING_XML }, - new HashMap(), - new HashMap()); + new HashMap(), + new HashMap()); system.start("Hello", new Service[0]); Service[] services = system.getRunningServices(); assertEquals(0, services.length); @@ -42,13 +42,13 @@ public class SpringSystemTest extends TestCase { } public void testOneProvidedService() { - Map provided = new HashMap(); - provided.put("helloService", new DefaultProvidedServiceDescriptor( + Map provided = new HashMap(); + provided.put("helloService", new DefaultProvidedInterfaceDescriptor( "hello", HelloService.class)); SpringSystem system = new SpringSystem("system", _registry, new String[] { HELLO_SERVICE_SPRING_XML }, provided, - new HashMap()); + new HashMap()); system.start("Hello", new Service[0]); Service[] services = system.getRunningServices(); assertEquals(1, services.length); @@ -62,8 +62,8 @@ public class SpringSystemTest extends TestCase { try { SpringSystem system = new SpringSystem("system", _registry, new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML }, - new HashMap(), - new HashMap()); + new HashMap(), + new HashMap()); system.start("Bla", new Service[0]); } catch (SystemAssemblyException e) { //e.printStackTrace(); @@ -73,25 +73,25 @@ public class SpringSystemTest extends TestCase { } public void testWithRequirement() { - Map required = new HashMap(); - required.put(new DefaultRequiredServiceDescriptor("hello", HelloService.class), + Map required = new HashMap(); + required.put(new DefaultRequiredInterfaceDescriptor("hello", HelloService.class), "helloService"); SpringSystem system = new SpringSystem("system", _registry, new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML }, - new HashMap(), required); + new HashMap(), required); HelloService helloObject = new HelloService("ladida"); - Service helloService = _registry.register(new DefaultProvidedServiceDescriptor("hello", HelloService.class), helloObject); + Service helloService = _registry.register(new DefaultProvidedInterfaceDescriptor("hello", HelloService.class), helloObject); system.start("Bla", new Service[] { helloService } ); system.stop(); } public void testWithRequirementAndProvidedService() { - Map required = new HashMap(); - required.put(new DefaultRequiredServiceDescriptor("hello", HelloService.class), + Map required = new HashMap(); + required.put(new DefaultRequiredInterfaceDescriptor("hello", HelloService.class), "helloService"); - Map provided = new HashMap(); - provided.put("blaService", new DefaultProvidedServiceDescriptor("bla", + Map provided = new HashMap(); + provided.put("blaService", new DefaultProvidedInterfaceDescriptor("bla", BlaService.class)); SpringSystem system = new SpringSystem("system", _registry, @@ -99,7 +99,7 @@ public class SpringSystemTest extends TestCase { provided, required); HelloService helloObject = new HelloService("ladida"); - Service helloService = _registry.register(new DefaultProvidedServiceDescriptor("hello", HelloService.class), helloObject); + Service helloService = _registry.register(new DefaultProvidedInterfaceDescriptor("hello", HelloService.class), helloObject); Service[] services = system.start("Bla", new Service[] { helloService } ); assertEquals(1, services.length);