use of org.hudsonci.inject.SmoothieContainer in project hudson-2.x by hudson.
the class InjectomaticAwareTest method testInjectoAwareWithExtends.
@Test
public void testInjectoAwareWithExtends() {
SmoothieContainer container = Smoothie.getContainer();
assertNotNull(container);
Injectomatic injecto = container.get(Key.get(Injectomatic.class));
assertNotNull(injecto);
System.out.println(injecto);
TestInjectomaticAware aware = container.get(Key.get(TestInjectomaticAware2.class));
assertNotNull(aware.injecto);
assertEquals(injecto, aware.injecto);
}
use of org.hudsonci.inject.SmoothieContainer in project hudson-2.x by hudson.
the class SmoothieContainerBootstrap method bootstrap.
public SmoothieContainer bootstrap(final ClassLoader classLoader, final Class... types) {
log.info("Bootstrapping Smoothie");
// Build the root space for the given types
ClassSpace space = new ClassSpaceFactory().create(classLoader, types);
// Start up the container
SmoothieContainer container = new SmoothieContainerImpl(new ExtensionModule(space, true));
Smoothie.setContainer(container);
// Enable aspect-based injection
InjectomaticAspectHelper.setEnabled(true);
return container;
}
Aggregations