Search in sources :

Example 56 with EnterpriseArchive

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

the class SubDeploymentAvailableInClassPathTestCase method createEarWithMultipleWars.

@Deployment(name = "ear-with-multiple-wars", testable = false)
public static EnterpriseArchive createEarWithMultipleWars() {
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
    ejbJar.addClasses(EJBBusinessInterface.class, SimpleSLSB.class);
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "war-access-to-war.war");
    war.addClasses(HelloWorldServlet.class, EjbInvokingServlet.class);
    final WebArchive otherWar = ShrinkWrap.create(WebArchive.class, OTHER_WEB_APP_CONTEXT + ".war");
    otherWar.addClass(ServletInOtherWar.class);
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "war-access-to-war.ear");
    ear.addAsModule(ejbJar);
    ear.addAsModule(war);
    ear.addAsModule(otherWar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 57 with EnterpriseArchive

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

the class EarClassPath3TestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    JavaArchive libJar = ShrinkWrap.create(JavaArchive.class);
    libJar.addClasses(TestAA.class, EarClassPath3TestCase.class);
    libJar.addAsManifestResource(new ByteArrayAsset("Class-Path: ../../../cp.jar\n".getBytes()), "MANIFEST.MF");
    war.addAsLibraries(libJar);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "cp.jar");
    earLib.addClass(TestBB.class);
    ear.addAsModule(earLib);
    earLib = ShrinkWrap.create(JavaArchive.class, "cp.jar");
    earLib.addClass(TestBB.class);
    ear.addAsModule(earLib);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) ByteArrayAsset(org.jboss.shrinkwrap.api.asset.ByteArrayAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 58 with EnterpriseArchive

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

the class EarClassPathTransitiveClosureTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class);
    JavaArchive libJar = ShrinkWrap.create(JavaArchive.class);
    libJar.addClasses(TestAA.class, EarClassPathTransitiveClosureTestCase.class);
    war.addAsLibraries(libJar);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "earLib.jar");
    earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: ../cp1.jar\n".getBytes()), "MANIFEST.MF");
    ear.addAsLibraries(earLib);
    earLib = ShrinkWrap.create(JavaArchive.class, "cp1.jar");
    earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: cp2.jar\n".getBytes()), "MANIFEST.MF");
    ear.addAsModule(earLib);
    earLib = ShrinkWrap.create(JavaArchive.class, "cp2.jar");
    earLib.addAsManifestResource(new ByteArrayAsset("Class-Path: a/b/c\n".getBytes()), "MANIFEST.MF");
    earLib.addClass(TestBB.class);
    ear.addAsModule(earLib);
    ear.add(new StringAsset("Hello World"), "a/b/c", "testfile.file");
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) ByteArrayAsset(org.jboss.shrinkwrap.api.asset.ByteArrayAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 59 with EnterpriseArchive

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

the class EarJbossStructureDepedenciesTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
    war.addClasses(TestAA.class, EarJbossStructureDepedenciesTestCase.class);
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    ear.addAsModule(war);
    //test the 1.0 parser
    ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure xmlns=\"urn:jboss:deployment-structure:1.0\">" + "<deployment>" + "</deployment>" + "<sub-deployment name=\"test.war\">" + "   <dependencies>" + "       <module name=\"org.jboss.classfilewriter\" />" + "   </dependencies>" + "</sub-deployment>" + "</jboss-deployment-structure>"), "jboss-deployment-structure.xml");
    JavaArchive earLib = ShrinkWrap.create(JavaArchive.class, "earLib.jar");
    earLib.addClass(TestBB.class);
    ear.addAsLibraries(earLib);
    ear.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader")), "permissions.xml");
    return ear;
}
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 60 with EnterpriseArchive

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

the class EarJbossStructureExtendedVisibilityTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class);
    WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
    war.addClasses(TestAA.class);
    ear.addAsModule(war);
    JavaArchive ejb = ShrinkWrap.create(JavaArchive.class, "ejb1.jar");
    ejb.addClasses(MyEjb.class, EarJbossStructureExtendedVisibilityTestCase.class);
    ear.addAsModule(ejb);
    ejb = ShrinkWrap.create(JavaArchive.class, "ejb2.jar");
    ejb.addClasses(MyEjb2.class);
    ear.addAsModule(ejb);
    ear.addAsManifestResource(new StringAsset("<jboss-deployment-structure><ear-subdeployments-isolated>false</ear-subdeployments-isolated></jboss-deployment-structure>"), "jboss-deployment-structure.xml");
    return ear;
}
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)

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