Search in sources :

Example 11 with BeansXml

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

the class IncontainerTest method getDeployment.

@Deployment
public static WebArchive getDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, Utils.getDeploymentNameAsHash(IncontainerTest.class, Utils.ARCHIVE_TYPE.WAR)).addClasses(Alpha.class, MarkerObtainer1.class, Foo.class, Marker.class).addAsWebInfResource(new BeansXml().alternatives(Alpha.class), "beans.xml");
    JavaArchive bda1 = ShrinkWrap.create(JavaArchive.class).addClasses(Bravo.class, MarkerObtainer2.class, Bar.class).addAsManifestResource(new BeansXml().alternatives(Bravo.class), "beans.xml");
    JavaArchive bda2 = ShrinkWrap.create(JavaArchive.class).addClasses(Charlie.class, MarkerObtainer3.class, Baz.class).addAsManifestResource(new BeansXml().alternatives(Charlie.class), "beans.xml");
    JavaArchive nonBda = ShrinkWrap.create(JavaArchive.class).addClasses(MarkerObtainer4.class);
    return war.addAsLibraries(bda1, bda2, nonBda);
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 12 with BeansXml

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

the class DecoratorDiscoveryTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    WebArchive testArchive = Deployments.baseDeployment().addClass(DecoratorDiscoveryTest.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).decorators(ClassicDecorator.class), "beans.xml").addClasses(Dog.class, Cat.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).decorators(ClassicDecorator.class), "beans.xml").addClasses(Plant.class, Tree.class, ClassicDecorator.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).decorators(ClassicDecorator.class), "beans.xml").addClasses(Flat.class, House.class);
    testArchive.addAsLibraries(archive01, archive02, archive03);
    return testArchive;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 13 with BeansXml

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

the class BeanDiscoveryInjectionTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    WebArchive testArchive = Deployments.baseDeployment().addClass(BeanDiscoveryInjectionTest.class);
    JavaArchive archive01 = ShrinkWrap.create(JavaArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL), "beans.xml").addClasses(Dog.class, Cat.class, Cow.class);
    JavaArchive archive02 = ShrinkWrap.create(JavaArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class);
    JavaArchive archive03 = ShrinkWrap.create(JavaArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE), "beans.xml").addClasses(Flat.class, House.class);
    testArchive.addAsLibraries(archive01, archive02, archive03);
    return testArchive;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 14 with BeansXml

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

the class DuplicateBeansXmlMergingTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    BeansXml beansXml = new BeansXml();
    beansXml.interceptors(SimpleInterceptor.class);
    WebArchive war = baseDeployment(beansXml).addClasses(DuplicateBeansXmlMergingTest.class, SimpleBinding.class, SimpleInterceptor.class);
    JavaArchive library = ShrinkWrap.create(JavaArchive.class, "library.jar").addAsManifestResource(beansXml, "beans.xml");
    war.addAsLibrary(library);
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment) Deployments.baseDeployment(org.jboss.weld.environment.servlet.test.util.Deployments.baseDeployment)

Example 15 with BeansXml

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

the class BeanDiscoveryDecoratorTest method getDeployment.

@Deployment
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