use of org.jboss.shrinkwrap.api.BeanArchive in project core by weld.
the class SplitInterceptorsTest method deploy.
@Deployment
public static Archive<?> deploy() {
WebArchive web = ShrinkWrap.create(WebArchive.class, Utils.getDeploymentNameAsHash(SplitInterceptorsTest.class, Utils.ARCHIVE_TYPE.WAR)).addPackage(SplitInterceptorsTest.class.getPackage());
BeanArchive fst = ShrinkWrap.create(BeanArchive.class).intercept(TxInterceptor.class);
fst.addPackage(TDAO.class.getPackage());
web.addAsLibrary(fst);
JavaArchive snd = ShrinkWrap.create(JavaArchive.class).addAsManifestResource(new BeansXml().interceptors(TxInterceptor.class), ArchivePaths.create("beans.xml"));
snd.addPackage(CDAO.class.getPackage());
web.addAsLibrary(snd);
return web;
}
use of org.jboss.shrinkwrap.api.BeanArchive in project core by weld.
the class PropertiesFilesConfigTest method createTestArchive.
@Deployment
public static Archive<?> createTestArchive() {
BeanArchive ejbJar = ShrinkWrap.create(BeanArchive.class);
ejbJar.addClass(DummySessionBean.class).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").set(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.get(), "5").build(), "weld.properties");
WebArchive war1 = Testable.archiveToTest(ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addClasses(PropertiesFilesConfigTest.class).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").set(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.get(), "5").set(ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE.get(), "FIXED_TIMEOUT").build(), "weld.properties"));
WebArchive war2 = ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").set(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.get(), "5").set(ConfigurationKey.RESOLUTION_CACHE_SIZE.get(), "1000").build(), "weld.properties");
return ShrinkWrap.create(EnterpriseArchive.class, Utils.getDeploymentNameAsHash(PropertiesFilesConfigTest.class, Utils.ARCHIVE_TYPE.EAR)).addAsModules(ejbJar, war1, war2);
}
use of org.jboss.shrinkwrap.api.BeanArchive in project core by weld.
the class UnproxyableTest method deploy.
@Deployment
@ShouldThrowException(DeploymentException.class)
public static JavaArchive deploy() {
BeanArchive archive = ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(UnproxyableTest.class));
archive.addPackage(UnproxyableTest.class.getPackage());
return archive;
}
use of org.jboss.shrinkwrap.api.BeanArchive in project core by weld.
the class CombinedPropertiesFilesConfigTest method createTestArchive.
@Deployment(order = 1, name = WAR_DEPLOYMENT)
public static Archive<?> createTestArchive() {
BeanArchive ejbJar = ShrinkWrap.create(BeanArchive.class, Utils.getDeploymentNameAsHash(CombinedPropertiesFilesConfigTest.class));
ejbJar.addClass(DummySessionBean.class).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").set(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.get(), "5").build(), "weld.properties");
WebArchive war1 = Testable.archiveToTest(ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addClasses(CombinedPropertiesFilesConfigTest.class).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.get(), "5").set(ConfigurationKey.EXECUTOR_THREAD_POOL_TYPE.get(), "FIXED_TIMEOUT").build(), "weld.properties"));
WebArchive war2 = ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.PRELOADER_THREAD_POOL_SIZE.get(), "5").set(ConfigurationKey.RESOLUTION_CACHE_SIZE.get(), "1000").build(), "weld.properties");
return ShrinkWrap.create(EnterpriseArchive.class, Utils.getDeploymentNameAsHash(CombinedPropertiesFilesConfigTest.class, Utils.ARCHIVE_TYPE.EAR)).addAsModules(ejbJar, war1, war2);
}
use of org.jboss.shrinkwrap.api.BeanArchive in project core by weld.
the class ConfigurationKeyHasDifferentValuesTest method createTestArchive.
@ShouldThrowException(org.jboss.weld.exceptions.IllegalStateException.class)
@Deployment
public static Archive<?> createTestArchive() {
BeanArchive ejbJar = ShrinkWrap.create(BeanArchive.class);
ejbJar.addClass(DummySessionBean.class).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").build(), "weld.properties");
WebArchive war1 = Testable.archiveToTest(ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml")).addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "true").build(), "weld.properties");
WebArchive war2 = ShrinkWrap.create(WebArchive.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource(PropertiesBuilder.newBuilder().set(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), "false").build(), "weld.properties");
return ShrinkWrap.create(EnterpriseArchive.class, Utils.getDeploymentNameAsHash(ConfigurationKeyHasDifferentValuesTest.class, Utils.ARCHIVE_TYPE.EAR)).addAsModules(ejbJar, war1, war2);
}
Aggregations