import java.io.IOException;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Properties;
new HashMap<RequiredInterface, String>());
Scope runtime = system.start(_externalScope);
- assertEquals(0, _externalScope.getProvidedInterfaces().length);
+ assertEquals(0, _externalScope.getProvidedInterfaces().size());
system.stop(runtime);
}
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);
// 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 {
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);
}
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
- system.getRequiredInterfaces()[0].setProvider(helloService);
+ system.getRequiredInterfaces().get(0).setProvider(helloService);
Scope runtime = system.start(scope);
system.stop(runtime);
HelloService.class);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
- system.getRequiredInterfaces()[0].setProvider(helloService);
+ 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);
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);
assertSame(service, service2);
Object floatsvc = _externalScope.getInterfaceImplementation(system
- .getProvidedInterfaces()[1], Object.class);
+ .getProvidedInterfaces().get(1), Object.class);
assertTrue(floatsvc instanceof Float);
assertTrue((((Float) floatsvc).floatValue() - 100.345f) < 0.00001);
Scope scope = new DefaultScope(new ProvidedInterface[] { helloService });
scope.publishInterface(helloService, helloObject);
scope.publishInterface(floatService, 100.234f);
- system.getRequiredInterfaces()[0].setProvider(helloService);
- system.getRequiredInterfaces()[1].setProvider(floatService);
+ system.getRequiredInterfaces().get(0).setProvider(helloService);
+ system.getRequiredInterfaces().get(1).setProvider(floatService);
Scope runtime = system.start(scope);
system.stop(runtime);