use of org.jboss.weld.environment.se.test.synthethic.testpackage.nested.BetaFromDirectory in project core by weld.
the class SyntheticBeanArchiveFromDirectoryTest method testAddPackageFromDirectory.
@Test
public void testAddPackageFromDirectory() {
try (WeldContainer container = new Weld().disableDiscovery().addPackages(AlphaFromDirectory.class.getPackage()).initialize()) {
AlphaFromDirectory alpha = container.select(AlphaFromDirectory.class).get();
Instance<BetaFromDirectory> betaInstance = container.select(BetaFromDirectory.class);
assertTrue(betaInstance.isUnsatisfied());
assertNotNull(alpha);
assertEquals(1, alpha.ping());
}
}
use of org.jboss.weld.environment.se.test.synthethic.testpackage.nested.BetaFromDirectory in project core by weld.
the class SyntheticBeanArchiveFromDirectoryTest method testAddPackageFromDirectoryRecursively.
@Test
public void testAddPackageFromDirectoryRecursively() {
try (WeldContainer container = new Weld().disableDiscovery().addPackages(true, AlphaFromDirectory.class.getPackage()).initialize()) {
AlphaFromDirectory alpha = container.select(AlphaFromDirectory.class).get();
Instance<BetaFromDirectory> betaInstance = container.select(BetaFromDirectory.class);
assertFalse(betaInstance.isUnsatisfied());
assertNotNull(alpha);
assertNotNull(betaInstance.get());
assertEquals(1, alpha.ping());
assertEquals(1, betaInstance.get().ping());
}
}
Aggregations