use of org.sonatype.guice.plexus.binders.PlexusAnnotatedBeanModule in project pom-manipulation-ext by release-engineering.
the class PlexusTestRunner method createTest.
@Override
protected Object createTest() throws Exception {
final TestClass testClass = getTestClass();
final DefaultContainerConfiguration config = new DefaultContainerConfiguration();
config.setAutoWiring(true);
config.setClassPathScanning(PlexusConstants.SCANNING_ON);
config.setComponentVisibility(PlexusConstants.GLOBAL_VISIBILITY);
config.setName(testClass.getName());
final DefaultPlexusContainer container = new DefaultPlexusContainer(config);
final ClassSpace cs = new URLClassSpace(Thread.currentThread().getContextClassLoader());
container.addPlexusInjector(Arrays.<PlexusBeanModule>asList(new PlexusAnnotatedBeanModule(cs, Collections.emptyMap())));
return container.lookup(testClass.getJavaClass());
}
Aggregations