Search in sources :

Example 16 with BeansXml

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

the class BeanDiscoveryInterceptor03Test method getDeployment.

/**
 * Throw exception because of the interceptor ClassicInterceptor not accessible.
 */
@Deployment
@ShouldThrowException(DeploymentException.class)
public static Archive<?> getDeployment() {
    WeldSEClassPath archives = ShrinkWrap.create(WeldSEClassPath.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Dog.class, Cat.class, InterceptorBindingAnnotation.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class, ScopedInterceptor.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Flat.class, House.class, ClassicInterceptor.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) ShouldThrowException(org.jboss.arquillian.container.test.api.ShouldThrowException) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 17 with BeansXml

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

the class BeanDiscoveryInterceptor02Test 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).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Dog.class, Cat.class, ClassicInterceptor.class, ScopedInterceptor.class, InterceptorBindingAnnotation.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).interceptors(ScopedInterceptor.class, ClassicInterceptor.class), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).interceptors(ScopedInterceptor.class, ClassicInterceptor.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)

Example 18 with BeansXml

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

the class BeanDiscoveryAlternativeTest method getDeployment.

@Deployment
public static Archive<?> getDeployment() {
    WeldSEClassPath archives = ShrinkWrap.create(WeldSEClassPath.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).alternatives(AlternativeDog.class), "beans.xml").addClasses(Dog.class, AlternativeDog.class, DogInterface.class, Cat.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).alternatives(AlternativeTree.class), "beans.xml").addClasses(Tree.class, AlternativeTree.class, Plant.class, Stone.class, AlternativeStone.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).alternatives(AlternativeFlat.class), "beans.xml").addClasses(Flat.class, AlternativeFlat.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)

Example 19 with BeansXml

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

the class BeanDiscoveryWithJandexIndexTest method getDeployment.

@Deployment
public static Archive<?> getDeployment() {
    WeldSEClassPath archives = ShrinkWrap.create(WeldSEClassPath.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml").addAsManifestResource(EmptyAsset.INSTANCE, // simulate broken index
    "jandex.idx").addClasses(Dog.class, Cat.class, Cow.class);
    archives.add(archive01);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class);
    archive02.addAsManifestResource(createJandexIndexAsset(archive02), "jandex.idx");
    archives.add(archive02);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL), "beans.xml").addClasses(Flat.class, House.class, Apartment.class);
    archive03.addAsManifestResource(createJandexIndexAsset(archive03), "jandex.idx");
    archives.add(archive03);
    // Archive without index
    JavaArchive archive04 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL), "beans.xml").addClasses(Hat.class);
    archives.add(archive04);
    return archives;
}
Also used : BeanArchive(org.jboss.shrinkwrap.api.BeanArchive) 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)

Example 20 with BeansXml

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

the class AlternativeDiscoveryTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    WebArchive testArchive = Deployments.baseDeployment().addClass(AlternativeDiscoveryTest.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).alternatives(AlternativeDog.class), "beans.xml").addClasses(Dog.class, AlternativeDog.class, DogInterface.class, Cat.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).alternatives(AlternativeTree.class), "beans.xml").addClasses(Tree.class, AlternativeTree.class, Plant.class, Stone.class, AlternativeStone.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).alternatives(AlternativeFlat.class), "beans.xml").addClasses(Flat.class, AlternativeFlat.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)

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