Search in sources :

Example 76 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project deltaspike by apache.

the class ConfigPropertyEARTest method deployEar.

@Deployment
public static EnterpriseArchive deployEar() {
    JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "ejb-jar.jar").addClasses(BaseTestConfigProperty.class, ConfigPropertyEARTest.class, MyBean.class, MyCustomEarPropertyFileConfig.class).addAsResource(CONFIG_FILE_NAME).addAsServiceProvider(PropertyFileConfig.class, MyCustomEarPropertyFileConfig.class).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml").addAsManifestResource(new StringAsset("org.apache.deltaspike.ProjectStage = UnitTest"), "apache-deltaspike.properties");
    WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    EnterpriseArchive enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "test.ear").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreArchive()).addAsModule(ejbJar).addAsModule(war).setApplicationXML("application.xml");
    return enterpriseArchive;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 77 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project tomee by apache.

the class EarTest method createDeployment.

@Deployment(testable = false)
public static EnterpriseArchive createDeployment() {
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "beans.jar");
    ejbJar.addClass(Bean.class);
    final WebArchive webapp = ShrinkWrap.create(WebArchive.class, "green.war").addClass(Hello.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "red.ear").addAsModule(ejbJar).addAsModule(webapp);
    ear.addAsLibraries(JarLocation.jarLocation(Test.class));
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) Test(org.junit.Test) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 78 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project tomee by apache.

the class ConnectorWithApplicationResourcesInEarTest method createDeployment.

@Deployment
public static EnterpriseArchive createDeployment() {
    final JavaArchive apiJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-api.jar");
    apiJar.addPackage("org.superbiz.connector.api");
    System.out.println("API JAR:\n" + apiJar.toString(true));
    final JavaArchive implJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-impl.jar");
    implJar.addPackage("org.superbiz.connector.adapter");
    System.out.println("IMPL JAR:\n" + implJar.toString(true));
    final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, "connector-sample-ra.rar");
    rar.addAsLibraries(implJar);
    rar.setResourceAdapterXML(ConnectorWithApplicationResourcesInEarTest.class.getResource("/connector/ra.xml"));
    System.out.println("RAR:\n" + rar.toString(true));
    final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "connector-sample-war.war");
    webArchive.addPackage("org.superbiz.application");
    final WebAppDescriptor webAppDescriptor = Descriptors.create(WebAppDescriptor.class);
    webAppDescriptor.version("3.0");
    webArchive.addAsWebInfResource(ConnectorWithApplicationResourcesInEarTest.class.getResource("/connector/resources.xml"), "resources.xml");
    webArchive.setWebXML(new StringAsset(webAppDescriptor.exportAsString()));
    System.out.println("Webapp:\n" + webArchive.toString(true));
    final EnterpriseArchive enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "connector-sample.ear");
    enterpriseArchive.addAsLibraries(apiJar);
    enterpriseArchive.addAsModule(rar);
    enterpriseArchive.addAsModule(webArchive);
    ApplicationDescriptor applicationXml = Descriptors.create(ApplicationDescriptor.class);
    applicationXml.displayName("connector-sample-ear");
    applicationXml.createModule().getOrCreateWeb().webUri("connector-sample-war.war").contextRoot("/sample").up().up().createModule().connector("connector-sample-ra.rar").up().libraryDirectory("lib");
    enterpriseArchive.setApplicationXML(new StringAsset(applicationXml.exportAsString()));
    System.out.println(enterpriseArchive.toString(true));
    return enterpriseArchive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ApplicationDescriptor(org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 79 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project tomee by apache.

the class EARTest method createDeployment.

@Deployment
public static EnterpriseArchive createDeployment() {
    final JavaArchive apiJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-api.jar");
    apiJar.addPackage("org.superbiz.connector.api");
    System.out.println("API JAR:\n" + apiJar.toString(true));
    final JavaArchive implJar = ShrinkWrap.create(JavaArchive.class, "connector-sample-impl.jar");
    implJar.addPackage("org.superbiz.connector.adapter");
    System.out.println("IMPL JAR:\n" + implJar.toString(true));
    final ResourceAdapterArchive rar = ShrinkWrap.create(ResourceAdapterArchive.class, "connector-sample-ra.rar");
    rar.addAsLibraries(implJar);
    final File raXml = Basedir.basedir("../connector-sample-rar/src/main/rar/META-INF/ra.xml");
    rar.setResourceAdapterXML(raXml);
    System.out.println("RAR:\n" + rar.toString(true));
    final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "connector-sample-war.war");
    webArchive.addPackage("org.superbiz.application");
    final WebAppDescriptor webAppDescriptor = Descriptors.create(WebAppDescriptor.class);
    webAppDescriptor.version("3.0");
    final File resourcesXml = Basedir.basedir("../connector-sample-war/src/main/webapp/WEB-INF/resources.xml");
    webArchive.addAsWebInfResource(resourcesXml);
    webArchive.setWebXML(new StringAsset(webAppDescriptor.exportAsString()));
    webArchive.addAsWebInfResource(resourcesXml);
    webArchive.addAsWebInfResource(new StringAsset("<beans/>"), "beans.xml");
    System.out.println("Webapp:\n" + webArchive.toString(true));
    final EnterpriseArchive enterpriseArchive = ShrinkWrap.create(EnterpriseArchive.class, "connector-sample.ear");
    enterpriseArchive.addAsLibraries(apiJar);
    enterpriseArchive.addAsModule(rar);
    enterpriseArchive.addAsModule(webArchive);
    ApplicationDescriptor applicationXml = Descriptors.create(ApplicationDescriptor.class);
    applicationXml.displayName("connector-sample-ear");
    applicationXml.createModule().getOrCreateWeb().webUri("connector-sample-war.war").contextRoot("/sample").up().up().createModule().connector("connector-sample-ra.rar").up().libraryDirectory("lib");
    enterpriseArchive.setApplicationXML(new StringAsset(applicationXml.exportAsString()));
    System.out.println(enterpriseArchive.toString(true));
    return enterpriseArchive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ResourceAdapterArchive(org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive) File(java.io.File) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) ApplicationDescriptor(org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 80 with EnterpriseArchive

use of org.jboss.shrinkwrap.api.spec.EnterpriseArchive in project tomee by apache.

the class JMXTest method createDeployment.

@Deployment
public static EnterpriseArchive createDeployment() {
    final JavaArchive ejbJar = new Mvn.Builder().name("jmx-ejb.jar").build(JavaArchive.class).addClass(JMXTest.class).addClass(TestEjb.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "jmx.ear").addAsModule(ejbJar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)164 Deployment (org.jboss.arquillian.container.test.api.Deployment)143 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)139 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)85 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)58 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)21 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)15 BeforeClass (org.junit.BeforeClass)10 File (java.io.File)8 ModelNode (org.jboss.dmr.ModelNode)8 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)7 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)6 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)4 ByteArrayAsset (org.jboss.shrinkwrap.api.asset.ByteArrayAsset)4 ApplicationDescriptor (org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor)4 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)4 Properties (java.util.Properties)3 PropertyPermission (java.util.PropertyPermission)3 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)3 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)3