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);
}
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;
}
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();
}
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();
}
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;
}
Aggregations