Search in sources :

Example 1 with BeansXml

use of org.jboss.shrinkwrap.impl.BeansXml in project core by weld.

the class GlobalDecoratorOrderingTest method getWebArchive.

public static Archive<?> getWebArchive() {
    JavaArchive thirdPartyLibrary = ShrinkWrap.create(JavaArchive.class).addClasses(ThirdPartyDecorator.class, ThirdPartyDecoratorExtension.class).addAsServiceProvider(Extension.class, ThirdPartyDecoratorExtension.class);
    BeansXml beans = new BeansXml();
    beans.decorators(LegacyDecorator1.class, LegacyDecorator2.class, LegacyDecorator3.class);
    return ShrinkWrap.create(WebArchive.class, "test.war").addClasses(DecoratedImpl.class, LegacyDecorator1.class, LegacyDecorator2.class, LegacyDecorator3.class, WebApplicationGlobalDecorator.class, GlobalDecoratorOrderingTest.class, DecoratorRegisteringExtension.class).addAsWebInfResource(beans, "beans.xml").addAsServiceProvider(Extension.class, DecoratorRegisteringExtension.class).addAsLibrary(thirdPartyLibrary);
}
Also used : Extension(javax.enterprise.inject.spi.Extension) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive)

Example 2 with BeansXml

use of org.jboss.shrinkwrap.impl.BeansXml 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 3 with BeansXml

use of org.jboss.shrinkwrap.impl.BeansXml in project core by weld.

the class ImplicitScanSmokeTest method createTestArchive.

@Deployment
public static Archive<?> createTestArchive() {
    final JavaArchive bda1 = ShrinkWrap.create(JavaArchive.class).addClasses(Foo.class, Bar.class).addAsManifestResource(new BeansXml(), "beans.xml");
    final JavaArchive bda2 = ShrinkWrap.create(JavaArchive.class).addClasses(ImplicitScanSmokeTest.class, Baz.class);
    return ClassPath.builder().add(bda1).add(bda2).build();
}
Also used : BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 4 with BeansXml

use of org.jboss.shrinkwrap.impl.BeansXml in project core by weld.

the class ImplicitScanSystemPropertySmokeTest method createTestArchive.

@Deployment
public static Archive<?> createTestArchive() {
    final JavaArchive bda1 = ShrinkWrap.create(JavaArchive.class).addClasses(Foo.class, Bar.class).addAsManifestResource(new BeansXml(), "beans.xml");
    final JavaArchive bda2 = ShrinkWrap.create(JavaArchive.class).addClasses(ImplicitScanSystemPropertySmokeTest.class, Baz.class);
    return ClassPath.builder().add(bda1).add(bda2).addSystemProperty(Weld.JAVAX_ENTERPRISE_INJECT_SCAN_IMPLICIT, "true").build();
}
Also used : BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with BeansXml

use of org.jboss.shrinkwrap.impl.BeansXml in project core by weld.

the class BeanDiscoveryDecorator02Test method getDeployment.

@Deployment(managed = false)
public static Archive<?> getDeployment() {
    WeldSEClassPath archives = ShrinkWrap.create(WeldSEClassPath.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Dog.class, Cat.class, ClassicRepresentDecorator.class, ScopedRepresentDecorator.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Flat.class, House.class);
    archives.add(archive01);
    archives.add(archive02);
    archives.add(archive03);
    return archives;
}
Also used : BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) WeldSEClassPath(org.jboss.weld.environment.se.test.arquillian.WeldSEClassPath) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

BeansXml (org.jboss.shrinkwrap.impl.BeansXml)28 Deployment (org.jboss.arquillian.container.test.api.Deployment)25 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)22 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)12 WeldSEClassPath (org.jboss.weld.environment.se.test.arquillian.WeldSEClassPath)10 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)4 ShouldThrowException (org.jboss.arquillian.container.test.api.ShouldThrowException)2 BeanArchive (org.jboss.shrinkwrap.api.BeanArchive)2 Deployments.baseDeployment (org.jboss.weld.environment.servlet.test.util.Deployments.baseDeployment)2 ArrayList (java.util.ArrayList)1 Extension (javax.enterprise.inject.spi.Extension)1 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)1 Exclude (org.jboss.shrinkwrap.impl.BeansXml.Exclude)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