X-Git-Url: http://wamblee.org/gitweb/?a=blobdiff_plain;f=system%2Fspring%2Fsrc%2Ftest%2Fjava%2Forg%2Fwamblee%2Fsystem%2Fspring%2FSpringComponentTest.java;h=1cc95c11cb640e7c92ca2ab3192b7977880458ee;hb=32a8562695029cf13d915bc7941a61fe07ff0005;hp=67ed048df8f19dbaed681191c855686d785486ac;hpb=49e4054c52db618894cf85eab721aebcbb9c3bc1;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 67ed048d..1cc95c11 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 @@ -17,6 +17,7 @@ package org.wamblee.system.spring; import java.io.IOException; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Properties; @@ -59,7 +60,7 @@ public class SpringComponentTest extends TestCase { new HashMap()); Scope runtime = system.start(_externalScope); - assertEquals(0, _externalScope.getProvidedInterfaces().length); + assertEquals(0, _externalScope.getProvidedInterfaces().size()); system.stop(runtime); } @@ -73,10 +74,10 @@ public class SpringComponentTest extends TestCase { new String[] { HELLO_SERVICE_SPRING_XML }, provided, new HashMap()); Scope runtime = system.start(_externalScope); - ProvidedInterface[] services = runtime.getProvidedInterfaces(); + List services = runtime.getProvidedInterfaces(); - assertEquals(1, services.length); - Object service = runtime.getInterfaceImplementation(services[0], + assertEquals(1, services.size()); + Object service = runtime.getInterfaceImplementation(services.get(0), Object.class); assertTrue(service instanceof HelloService); @@ -106,9 +107,9 @@ public class SpringComponentTest extends TestCase { // unprocessed property // and another time with the processed property. assertEquals(1, EVENT_TRACKER.getEventCount()); - ProvidedInterface[] services = scope.getProvidedInterfaces(); + List services = scope.getProvidedInterfaces(); assertEquals("Property Value", scope.getInterfaceImplementation( - services[0], HelloService.class).say()); + services.get(0), HelloService.class).say()); } public void testWithPropertiesAsBean() throws IOException { @@ -124,9 +125,9 @@ public class SpringComponentTest extends TestCase { Scope scope = system.start(_externalScope); - ProvidedInterface[] services = scope.getProvidedInterfaces(); + List services = scope.getProvidedInterfaces(); - Properties props2 = scope.getInterfaceImplementation(services[0], + Properties props2 = scope.getInterfaceImplementation(services.get(0), HelloService2.class).getProperties(); assertEquals(props, props2); } @@ -183,7 +184,7 @@ public class SpringComponentTest extends TestCase { scope.publishInterface(helloService, helloObject); system.getRequiredInterfaces().get(0).setProvider(helloService); Scope runtime = system.start(scope); - ProvidedInterface started = runtime.getProvidedInterfaces()[0]; + ProvidedInterface started = runtime.getProvidedInterfaces().get(0); Object impl = runtime.getInterfaceImplementation(started, BlaService.class); @@ -208,10 +209,10 @@ public class SpringComponentTest extends TestCase { new HashMap()); Scope runtime = system.start(_externalScope); - ProvidedInterface[] services = runtime.getProvidedInterfaces(); + List services = runtime.getProvidedInterfaces(); - assertEquals(2, services.length); - Object service = runtime.getInterfaceImplementation(services[0], + assertEquals(2, services.size()); + Object service = runtime.getInterfaceImplementation(services.get(0), Object.class); assertTrue(service instanceof HelloService);