import junit.framework.TestCase;
-import org.wamblee.system.AbstractServiceDescriptor;
-import org.wamblee.system.DefaultProvidedServiceDescriptor;
-import org.wamblee.system.DefaultRequiredServiceDescriptor;
+import org.wamblee.system.AbstractInterfaceDescriptor;
+import org.wamblee.system.DefaultProvidedInterfaceDescriptor;
+import org.wamblee.system.DefaultRequiredInterfaceDescriptor;
import org.wamblee.system.DefaultServiceRegistry;
-import org.wamblee.system.ProvidedServiceDescriptor;
-import org.wamblee.system.RequiredServiceDescriptor;
+import org.wamblee.system.ProvidedInterfaceDescriptor;
+import org.wamblee.system.RequiredInterfaceDescriptor;
import org.wamblee.system.Service;
-import org.wamblee.system.ServiceDescriptor;
+import org.wamblee.system.InterfaceDescriptor;
import org.wamblee.system.ServiceRegistry;
import org.wamblee.system.SystemAssemblyException;
public void testBlackboxSystem() {
SpringSystem system = new SpringSystem("system", _registry,
new String[] { HELLO_SERVICE_SPRING_XML },
- new HashMap<String, ProvidedServiceDescriptor>(),
- new HashMap<RequiredServiceDescriptor, String>());
+ new HashMap<String, ProvidedInterfaceDescriptor>(),
+ new HashMap<RequiredInterfaceDescriptor, String>());
system.start("Hello", new Service[0]);
Service[] services = system.getRunningServices();
assertEquals(0, services.length);
}
public void testOneProvidedService() {
- Map<String, ProvidedServiceDescriptor> provided = new HashMap<String, ProvidedServiceDescriptor>();
- provided.put("helloService", new DefaultProvidedServiceDescriptor(
+ Map<String, ProvidedInterfaceDescriptor> provided = new HashMap<String, ProvidedInterfaceDescriptor>();
+ provided.put("helloService", new DefaultProvidedInterfaceDescriptor(
"hello", HelloService.class));
SpringSystem system = new SpringSystem("system", _registry,
new String[] { HELLO_SERVICE_SPRING_XML }, provided,
- new HashMap<RequiredServiceDescriptor, String>());
+ new HashMap<RequiredInterfaceDescriptor, String>());
system.start("Hello", new Service[0]);
Service[] services = system.getRunningServices();
assertEquals(1, services.length);
try {
SpringSystem system = new SpringSystem("system", _registry,
new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML },
- new HashMap<String, ProvidedServiceDescriptor>(),
- new HashMap<RequiredServiceDescriptor, String>());
+ new HashMap<String, ProvidedInterfaceDescriptor>(),
+ new HashMap<RequiredInterfaceDescriptor, String>());
system.start("Bla", new Service[0]);
} catch (SystemAssemblyException e) {
//e.printStackTrace();
}
public void testWithRequirement() {
- Map<RequiredServiceDescriptor, String> required = new HashMap<RequiredServiceDescriptor, String>();
- required.put(new DefaultRequiredServiceDescriptor("hello", HelloService.class),
+ Map<RequiredInterfaceDescriptor, String> required = new HashMap<RequiredInterfaceDescriptor, String>();
+ required.put(new DefaultRequiredInterfaceDescriptor("hello", HelloService.class),
"helloService");
SpringSystem system = new SpringSystem("system", _registry,
new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML },
- new HashMap<String, ProvidedServiceDescriptor>(), required);
+ new HashMap<String, ProvidedInterfaceDescriptor>(), required);
HelloService helloObject = new HelloService("ladida");
- Service helloService = _registry.register(new DefaultProvidedServiceDescriptor("hello", HelloService.class), helloObject);
+ Service helloService = _registry.register(new DefaultProvidedInterfaceDescriptor("hello", HelloService.class), helloObject);
system.start("Bla", new Service[] { helloService } );
system.stop();
}
public void testWithRequirementAndProvidedService() {
- Map<RequiredServiceDescriptor, String> required = new HashMap<RequiredServiceDescriptor, String>();
- required.put(new DefaultRequiredServiceDescriptor("hello", HelloService.class),
+ Map<RequiredInterfaceDescriptor, String> required = new HashMap<RequiredInterfaceDescriptor, String>();
+ required.put(new DefaultRequiredInterfaceDescriptor("hello", HelloService.class),
"helloService");
- Map<String,ProvidedServiceDescriptor> provided = new HashMap<String, ProvidedServiceDescriptor>();
- provided.put("blaService", new DefaultProvidedServiceDescriptor("bla",
+ Map<String,ProvidedInterfaceDescriptor> provided = new HashMap<String, ProvidedInterfaceDescriptor>();
+ provided.put("blaService", new DefaultProvidedInterfaceDescriptor("bla",
BlaService.class));
SpringSystem system = new SpringSystem("system", _registry,
provided, required);
HelloService helloObject = new HelloService("ladida");
- Service helloService = _registry.register(new DefaultProvidedServiceDescriptor("hello", HelloService.class), helloObject);
+ Service helloService = _registry.register(new DefaultProvidedInterfaceDescriptor("hello", HelloService.class), helloObject);
Service[] services = system.start("Bla", new Service[] { helloService } );
assertEquals(1, services.length);