(no commit message)
[utils] / system / spring / src / test / java / org / wamblee / system / spring / SpringComponentTest.java
index 67ed048df8f19dbaed681191c855686d785486ac..1cc95c11cb640e7c92ca2ab3192b7977880458ee 100644 (file)
@@ -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<RequiredInterface, String>());
 
         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<RequiredInterface, String>());
         Scope runtime = system.start(_externalScope);
-        ProvidedInterface[] services = runtime.getProvidedInterfaces();
+        List<ProvidedInterface> 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<ProvidedInterface> 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<ProvidedInterface> 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<RequiredInterface, String>());
 
         Scope runtime = system.start(_externalScope);
-        ProvidedInterface[] services = runtime.getProvidedInterfaces();
+        List<ProvidedInterface> 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);