Search in sources :

Example 21 with BeansXml

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

the class InterceptorDiscoveryTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    WebArchive testArchive = Deployments.baseDeployment().addClass(InterceptorDiscoveryTest.class);
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL).interceptors(ClassicInterceptor.class), "beans.xml").addClasses(Dog.class, Cat.class, InterceptorBindingAnnotation.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED).interceptors(ClassicInterceptor.class), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class, ClassicInterceptor.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE).interceptors(ClassicInterceptor.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 22 with BeansXml

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

the class BeanDiscoveryInjectionTest method getDeployment.

@Deployment
public static Archive<?> getDeployment() {
    JavaArchive archive01 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ALL), "beans.xml").addClasses(Dog.class, Cat.class, Cow.class);
    JavaArchive archive02 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.ANNOTATED), "beans.xml").addClasses(Plant.class, Tree.class, Stone.class);
    JavaArchive archive03 = ShrinkWrap.create(BeanArchive.class).addAsManifestResource(new BeansXml(BeanDiscoveryMode.NONE), "beans.xml").addClasses(Flat.class, House.class);
    return ShrinkWrap.create(WeldSEClassPath.class).add(archive01, archive02, archive03);
}
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 23 with BeansXml

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

the class IsolationDisabledTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    WebArchive testArchive = Deployments.baseDeployment(new StringAsset(extendDefaultWebXml(toContextParam("org.jboss.weld.environment.servlet.archive.isolation", "false")))).addClass(IsolationDisabledTest.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);
    testArchive.addAsLibraries(archive01, archive02);
    return testArchive;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) 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 24 with BeansXml

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

the class LibrariesDiscoveredTest method createTestArchive.

@Deployment
public static WebArchive createTestArchive() {
    JavaArchive library = ShrinkWrap.create(JavaArchive.class, "library.jar").addClass(Camel.class).addAsManifestResource(new BeansXml(), "beans.xml");
    log.fine(DELIMITER);
    log.fine("Library");
    log.fine(DELIMITER);
    log.fine(library.toString(true));
    return baseDeployment().addClasses(Needle.class, LibrariesDiscoveredTest.class).addAsLibrary(library);
}
Also used : 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 25 with BeansXml

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

the class EnhancedListenerShutdownTest method createAssertArchive.

@Deployment(name = ASSERT, managed = false)
public static WebArchive createAssertArchive() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "app-assert.war").addAsWebInfResource(new BeansXml(), "beans.xml").setWebXML(DEFAULT_WEB_XML);
    war.addClasses(InfoServlet.class, ActionSequence.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