/**
* Tests explicit wiring of Java services.
*/
public class JavaServiceWiringTest extends AbstractRuntimeTest {
protected LilyRuntimeModel getRuntimeModel() throws Exception {
LilyRuntimeModel model = new LilyRuntimeModel();
{
File module1Dir = createModule("org.lilyproject.runtime.test.testmodules.jwiringmod1");
ModuleDefinition module1 = new ModuleDefinition("jwiringmod1", module1Dir, ModuleSourceType.EXPANDED_JAR);
model.addModule(module1);
}
{
File module2Dir = createModule("org.lilyproject.runtime.test.testmodules.jwiringmod2");
ModuleDefinition module2 = new ModuleDefinition("jwiringmod2", module2Dir, ModuleSourceType.EXPANDED_JAR);
model.addModule(module2);
}
{
File module3Dir = createModule("org.lilyproject.runtime.test.testmodules.jwiringmod3");
ModuleDefinition module3 = new ModuleDefinition("jwiringmod3", module3Dir, ModuleSourceType.EXPANDED_JAR);
module3.addInject(new JavaServiceInjectByNameDefinition("bean1", "jwiringmod1", "foo1Bean"));
module3.addInject(new JavaServiceInjectByNameDefinition("someDependency", "jwiringmod1", "someName"));
module3.addInject(new JavaServiceInjectByNameDefinition("bean3", "jwiringmod2"));
model.addModule(module3);
}
{
File module4Dir = createModule("org.lilyproject.runtime.test.testmodules.jwiringmod4");
ModuleDefinition module4 = new ModuleDefinition("jwiringmod4", module4Dir, ModuleSourceType.EXPANDED_JAR);
module4.addInject(new JavaServiceInjectByServiceDefinition("java.lang.CharSequence", "jwiringmod2"));
model.addModule(module4);
}
return model;
}