Search in sources :

Example 1 with BeanArchive

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;
}
Also used : CDAO(org.jboss.weld.tests.interceptors.lhotse.snd.CDAO) BeanArchive(org.jboss.shrinkwrap.api.BeanArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) TDAO(org.jboss.weld.tests.interceptors.lhotse.fst.TDAO) TxInterceptor(org.jboss.weld.tests.interceptors.lhotse.fst.TxInterceptor) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 2 with BeanArchive

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);
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) BeanArchive(org.jboss.shrinkwrap.api.BeanArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with BeanArchive

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;
}
Also used : BeanArchive(org.jboss.shrinkwrap.api.BeanArchive) ShouldThrowException(org.jboss.arquillian.container.test.api.ShouldThrowException) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 4 with BeanArchive

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);
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) BeanArchive(org.jboss.shrinkwrap.api.BeanArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) DummySessionBean(org.jboss.weld.tests.config.files.DummySessionBean) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with BeanArchive

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);
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) BeanArchive(org.jboss.shrinkwrap.api.BeanArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ShouldThrowException(org.jboss.arquillian.container.test.api.ShouldThrowException) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

Deployment (org.jboss.arquillian.container.test.api.Deployment)6 BeanArchive (org.jboss.shrinkwrap.api.BeanArchive)6 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)5 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)3 ShouldThrowException (org.jboss.arquillian.container.test.api.ShouldThrowException)2 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)2 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)1 Archive (org.jboss.shrinkwrap.api.Archive)1 BeansXml (org.jboss.shrinkwrap.impl.BeansXml)1 DummySessionBean (org.jboss.weld.tests.config.files.DummySessionBean)1 TDAO (org.jboss.weld.tests.interceptors.lhotse.fst.TDAO)1 TxInterceptor (org.jboss.weld.tests.interceptors.lhotse.fst.TxInterceptor)1 CDAO (org.jboss.weld.tests.interceptors.lhotse.snd.CDAO)1