X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fspring%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fspring%2FSpringComponentTest.java;h=b0f7f8abd82734244288475825599f7c98523a90;hb=0af4854898104bd6322c0f22feb6dc285859f420;hp=dc7a5845c659f68c47bbcd7db8f855bd3fa1c5b2;hpb=d2bdf4e813c6a3964958c87b2ce56eaadf8a1f0a;p=utils diff --git a/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java b/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java index dc7a5845..b0f7f8ab 100644 --- a/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java +++ b/system/spring/src/test/java/org/wamblee/system/spring/SpringComponentTest.java @@ -8,14 +8,12 @@ import java.util.Properties; import junit.framework.TestCase; import org.wamblee.io.ClassPathResource; -import org.wamblee.system.AbstractInterfaceDescriptor; import org.wamblee.system.DefaultProvidedInterfaceDescriptor; import org.wamblee.system.DefaultRequiredInterfaceDescriptor; import org.wamblee.system.DefaultServiceRegistry; -import org.wamblee.system.ProvidedInterfaceDescriptor; -import org.wamblee.system.RequiredInterfaceDescriptor; +import org.wamblee.system.ProvidedInterface; +import org.wamblee.system.RequiredInterface; import org.wamblee.system.Service; -import org.wamblee.system.InterfaceDescriptor; import org.wamblee.system.ServiceRegistry; import org.wamblee.system.SystemAssemblyException; @@ -37,8 +35,8 @@ public class SpringComponentTest extends TestCase { public void testBlackboxSystem() { SpringComponent system = new SpringComponent("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); @@ -47,13 +45,13 @@ public class SpringComponentTest extends TestCase { } public void testOneProvidedService() { - Map provided = new HashMap(); + Map provided = new HashMap(); provided.put("helloService", new DefaultProvidedInterfaceDescriptor( "hello", HelloService.class)); SpringComponent system = new SpringComponent("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); @@ -64,13 +62,13 @@ public class SpringComponentTest extends TestCase { } public void testWithProperties() throws IOException { - Map provided = new HashMap(); + Map provided = new HashMap(); provided.put("helloService", new DefaultProvidedInterfaceDescriptor( "hello", HelloService.class)); SpringComponent system = new SpringComponent("system", _registry, new String[] { HELLO_SERVICE_SPRING_WITH_PROPERTIES_XML }, provided, - new HashMap()); + new HashMap()); Properties props = new Properties(); props.load(new ClassPathResource(PROPERTY_FILE).getInputStream()); system.addProperties(props); @@ -84,8 +82,8 @@ public class SpringComponentTest extends TestCase { try { SpringComponent system = new SpringComponent("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(); @@ -95,12 +93,12 @@ public class SpringComponentTest extends TestCase { } public void testWithRequirement() { - Map required = new HashMap(); + Map required = new HashMap(); required.put(new DefaultRequiredInterfaceDescriptor("hello", HelloService.class), "helloService"); SpringComponent system = new SpringComponent("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 DefaultProvidedInterfaceDescriptor("hello", HelloService.class), helloObject); @@ -109,10 +107,10 @@ public class SpringComponentTest extends TestCase { } public void testWithRequirementAndProvidedService() { - Map required = new HashMap(); + Map required = new HashMap(); required.put(new DefaultRequiredInterfaceDescriptor("hello", HelloService.class), "helloService"); - Map provided = new HashMap(); + Map provided = new HashMap(); provided.put("blaService", new DefaultProvidedInterfaceDescriptor("bla", BlaService.class));