Search in sources :

Example 46 with JavaArchive

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

the class JarResourceListingTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    JavaArchive jar = ShrinkWrap.create(JavaArchive.class);
    jar.addClasses(JarResourceListingTestCase.class, ResourceListingUtils.class);
    jar.add(EmptyAsset.INSTANCE, "META-INF/example.txt");
    jar.add(EmptyAsset.INSTANCE, "META-INF/properties/nested.properties");
    // shrink wrapper creates it in default, this way it is more clear that it's there
    jar.addAsManifestResource(EmptyAsset.INSTANCE, "MANIFEST.MF");
    jar.add(EmptyAsset.INSTANCE, "example2.txt");
    jar.addAsResource(JarResourceListingTestCase.class.getPackage(), "TextFile1.txt", "TextFile1.txt");
    return jar;
}
Also used : JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 47 with JavaArchive

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

the class EarJBossDeploymentStructureTestCase method createDeployment.

/**
     * .ear
     * |
     * |--- META-INF
     * |       |
     * |       |--- jboss-deployment-structure.xml
     * |
     * |--- ejb.jar
     * |
     * |--- available.jar
     * |
     * |--- ignored.jar
     *
     * @return
     */
@Deployment
public static Archive<?> createDeployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "deployment-structure.ear");
    ear.addAsManifestResource(EarJBossDeploymentStructureTestCase.class.getPackage(), "jboss-deployment-structure.xml", "jboss-deployment-structure.xml");
    final JavaArchive jarOne = ShrinkWrap.create(JavaArchive.class, "available.jar");
    jarOne.addClass(Available.class);
    jarOne.addAsManifestResource(new StringAsset("test resource"), METAINF_RESOURCE_TXT);
    final JavaArchive ignoredJar = ShrinkWrap.create(JavaArchive.class, "ignored.jar");
    ignoredJar.addClass(ToBeIgnored.class);
    final JavaArchive ejbJar = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
    ejbJar.addClasses(ClassLoadingEJB.class, EarJBossDeploymentStructureTestCase.class);
    // grant necessary permissions
    ejbJar.addAsResource(createPermissionsXmlAsset(new RuntimePermission("getProtectionDomain")), "META-INF/jboss-permissions.xml");
    ear.addAsModule(jarOne);
    ear.addAsModule(ignoredJar);
    ear.addAsModule(ejbJar);
    return ear;
}
Also used : EnterpriseArchive(org.jboss.shrinkwrap.api.spec.EnterpriseArchive) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 48 with JavaArchive

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

the class JarJBossDeploymentStructureTestCase method createDeployment.

@Deployment
public static Archive<?> createDeployment() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "deployment-structure.jar");
    jar.addAsManifestResource(JarJBossDeploymentStructureTestCase.class.getPackage(), "jboss-deployment-structure.xml", "jboss-deployment-structure.xml");
    final JavaArchive jarOne = ShrinkWrap.create(JavaArchive.class, "available.jar");
    jarOne.addClass(Available.class);
    final JavaArchive ignoredJar = ShrinkWrap.create(JavaArchive.class, "ignored.jar");
    ignoredJar.addClass(ToBeIgnored.class);
    final JavaArchive otherJar = ShrinkWrap.create(JavaArchive.class, "otherJar.jar");
    otherJar.addClass(InSameModule.class);
    jar.addClasses(ClassLoadingEJB.class, JarJBossDeploymentStructureTestCase.class);
    jar.add(jarOne, "a", ZipExporter.class);
    jar.add(ignoredJar, "i", ZipExporter.class);
    jar.add(otherJar, "other", ZipExporter.class);
    jar.addAsManifestResource(createPermissionsXmlAsset(new RuntimePermission("getClassLoader"), new RuntimePermission("getProtectionDomain")), "permissions.xml");
    return jar;
}
Also used : JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 49 with JavaArchive

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

the class GlobalModulesTestCase method deploy.

@Deployment
public static Archive<?> deploy() {
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "testglobal.jar");
    jar.addClass(GlobalModulesTestCase.class);
    return jar;
}
Also used : JavaArchive(org.jboss.shrinkwrap.api.spec.JavaArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 50 with JavaArchive

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

the class InitializeInOrderTestCase method deployment.

@Deployment
public static Archive<?> deployment() {
    final EnterpriseArchive ear = ShrinkWrap.create(EnterpriseArchive.class, "init.ear");
    ear.addAsResource(InitializeInOrderTestCase.class.getPackage(), "application.xml", "application.xml");
    final JavaArchive jar = ShrinkWrap.create(JavaArchive.class, "ejb.jar");
    jar.addClasses(MyEjb.class, InitializeInOrderTestCase.class);
    ear.addAsModule(jar);
    final WebArchive war = ShrinkWrap.create(WebArchive.class, "web.war");
    war.addClass(MyServlet.class);
    ear.addAsModule(war);
    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) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)644 Deployment (org.jboss.arquillian.container.test.api.Deployment)530 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)219 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)141 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)110 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)64 File (java.io.File)58 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)57 Asset (org.jboss.shrinkwrap.api.asset.Asset)44 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)41 ArchivePath (org.jboss.shrinkwrap.api.ArchivePath)29 AbstractMgmtTestBase (org.jboss.as.test.integration.management.base.AbstractMgmtTestBase)25 TargetsContainer (org.jboss.arquillian.container.test.api.TargetsContainer)23 PropertyPermission (java.util.PropertyPermission)19 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)15 JMSOperations (org.jboss.as.test.integration.common.jms.JMSOperations)15 URL (java.net.URL)13 VirtualFile (org.jboss.vfs.VirtualFile)11 ExplodedExporter (org.jboss.shrinkwrap.api.exporter.ExplodedExporter)8 OperationBuilder (org.jboss.as.controller.client.OperationBuilder)6