import junit.framework.TestCase;
-public class SystemAssemblerTest extends TestCase {
+public class ContainerTest extends TestCase {
private EventTracker<String> _tracker;
MyMultiple.class);
AssertionUtils.assertEquals(new RequiredInterface[] { req1 },
- SystemAssembler.filterRequiredServices(prov1, Arrays
+ Container.filterRequiredServices(prov1, Arrays
.asList(new RequiredInterface[] { req1 })));
AssertionUtils.assertEquals(new RequiredInterface[] { req1 },
- SystemAssembler.filterRequiredServices(prov1, Arrays
+ Container.filterRequiredServices(prov1, Arrays
.asList(new RequiredInterface[] { req1, req2 })));
AssertionUtils.assertEquals(new RequiredInterface[] { req1, req2 },
- SystemAssembler.filterRequiredServices(prov3, Arrays
+ Container.filterRequiredServices(prov3, Arrays
.asList(new RequiredInterface[] { req1, req2 })));
AssertionUtils.assertEquals(new ProvidedInterface[] { prov1 },
- SystemAssembler.filterProvidedServices(req1, Arrays
+ Container.filterProvidedServices(req1, Arrays
.asList(new ProvidedInterface[] { prov1 })));
AssertionUtils.assertEquals(new ProvidedInterface[] { prov1 },
- SystemAssembler.filterProvidedServices(req1, Arrays
+ Container.filterProvidedServices(req1, Arrays
.asList(new ProvidedInterface[] { prov1, prov2 })));
AssertionUtils.assertEquals(new ProvidedInterface[] { prov1, prov3 },
- SystemAssembler.filterProvidedServices(req1, Arrays
+ Container.filterProvidedServices(req1, Arrays
.asList(new ProvidedInterface[] { prov1, prov3 })));
}
public void testEnvironmentApplication() {
Component environment = new Environment(_tracker);
Component application = new Application(_tracker);
- SystemAssembler assembler = new SystemAssembler(new Component[] {
- environment, application }, new ProvidedInterface[0]);
- assembler.start();
+ Container container = new Container("root", new Component[] {
+ environment, application }, new ProvidedInterface[0],
+ new RequiredInterface[0]);
+
+ container.start("top");
AssertionUtils.assertEquals(new String[] { "start.environment",
"start.application" }, _tracker.getEvents(
Thread.currentThread()).toArray(new String[0]));
try {
Component environment = new Environment();
Component application = new Application();
- SystemAssembler assembler = new SystemAssembler(new Component[] {
- application, environment }, new ProvidedInterface[0]);
- assembler.start();
+ Container container = new Container(
+ "root",
+ new Component[] {
+ application, environment },
+ new ProvidedInterface[0], new RequiredInterface[0]);
+ container.start("top");
} catch (SystemAssemblyException e) {
// e.printStackTrace();
return;
Component environment1 = new Environment();
Component environment2 = new Environment();
Component application = new Application();
- SystemAssembler assembler = new SystemAssembler(new Component[] {
+ Container container = new Container("root", new Component[] {
environment1, environment2, application },
- new ProvidedInterface[0]);
- assembler.start();
+ new ProvidedInterface[0], new RequiredInterface[0]);
+ container.start("top");
} catch (SystemAssemblyException e) {
return;