@Deployment
public static EnterpriseArchive createTestArchive() {
// 1.1 version beans.xml with bean-discovery-mode of all
JavaArchive alpha = ShrinkWrap
.create(JavaArchive.class, ALPHA_JAR)
.addClasses(Alpha.class, AlphaLocal.class)
.addAsManifestResource(
new StringAsset(newBeans11Descriptor().setBeanDiscoveryMode(BeanDiscoveryMode.ALL).exportAsString()),
"beans.xml");
// Empty beans.xml
JavaArchive bravo = ShrinkWrap.create(JavaArchive.class, BRAVO_JAR).addClasses(Bravo.class, BravoLocal.class)
.addAsManifestResource(new StringAsset(""), "beans.xml");
// No version beans.xml
JavaArchive charlie = ShrinkWrap
.create(JavaArchive.class, CHARLIE_JAR)
.addClasses(Charlie.class, CharlieLocal.class)
.addAsManifestResource(new StringAsset(Descriptors.create(BeansDescriptor.class).exportAsString()), "beans.xml");
// Session bean and no beans.xml
JavaArchive delta = ShrinkWrap.create(JavaArchive.class, DELTA_JAR).addClasses(Delta.class, DeltaLocal.class);
// Session bean and 1.1 version beans.xml with bean-discovery-mode of annotated
JavaArchive echo = ShrinkWrap
.create(JavaArchive.class, ECHO_JAR)
.addClasses(Echo.class, EchoLocal.class)
.addAsManifestResource(
new StringAsset(newBeans11Descriptor().setBeanDiscoveryMode(BeanDiscoveryMode.ANNOTATED)
.exportAsString()), "beans.xml");
// Session bean and 1.1 version beans.xml with bean-discovery-mode of none
JavaArchive foxtrot = ShrinkWrap
.create(JavaArchive.class, FOXTROT_JAR)
.addClasses(Foxtrot.class, FoxtrotLocal.class)
.addAsManifestResource(
new StringAsset(newBeans11Descriptor().setBeanDiscoveryMode(BeanDiscoveryMode.NONE).exportAsString()),
"beans.xml");
// Archive which contains an extension and no beans.xml file - not a bean archive
JavaArchive legacy = ShrinkWrap.create(JavaArchive.class, LEGACY_JAR)
.addClasses(LegacyExtension.class, LegacyBean.class)
.addAsServiceProvider(Extension.class, LegacyExtension.class);
WebArchive webArchive = new WebArchiveBuilder()
.withClasses(EnterpriseBeanDiscoveryTest.class)