Search in sources :

Example 6 with BeansXml

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

the class BeanDiscoveryDecorator03Test method getDeployment.

/**
 * Throw exception because of the decorator ClassicRepresentDecorator not discovered, because it has not a bean defining annotation.
 */
@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).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Dog.class, Cat.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, ScopedRepresentDecorator.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).decorators(ClassicRepresentDecorator.class, ScopedRepresentDecorator.class), "beans.xml").addClasses(Flat.class, House.class, ClassicRepresentDecorator.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 7 with BeansXml

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

the class BeanDiscoveryInterceptorTest method getDeployment.

@Deployment
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 8 with BeansXml

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

the class IsolationDisabledTest 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(ZoomInterceptor.class).decorators(CameraDecorator.class).alternatives(RangefinderCamera.class).excludeFilters(Exclude.exact(PinholeCamera.class).ifClassAvailable(DSLR.class)), "beans.xml").addClasses(ZoomInterceptor.class, CameraDecorator.class, RangefinderCamera.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL), "beans.xml").addClasses(Zoom.class, Camera.class, DSLR.class, PinholeCamera.class);
    archives.add(archive01);
    archives.add(archive02);
    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 9 with BeansXml

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

the class ConfigTestBase method baseDeployment.

public static WebArchive baseDeployment(final Package... excludedPackages) {
    BeansXml beansXml = new BeansXml();
    ArrayList<Exclude> filters = new ArrayList<Exclude>();
    for (Package pckg : excludedPackages) {
        filters.add(Exclude.match(pckg.getName() + ".**"));
    }
    beansXml.excludeFilters(filters.toArray(new Exclude[filters.size()]));
    return Deployments.baseDeployment(beansXml);
}
Also used : Exclude(org.jboss.shrinkwrap.impl.BeansXml.Exclude) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) ArrayList(java.util.ArrayList)

Example 10 with BeansXml

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

the class CrossContextForwardTest method createSecondTestArchive.

@Deployment(name = CrossContextForwardTest.SECOND)
public static WebArchive createSecondTestArchive() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "app2.war").addAsWebInfResource(new BeansXml(), "beans.xml").setWebXML(INCLUDED_WEB_XML);
    war.addClass(IncludedServlet.class);
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) BeansXml(org.jboss.shrinkwrap.impl.BeansXml) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) 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