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