use of org.jboss.shrinkwrap.api.GenericArchive in project javaee7-samples by javaee-samples.
the class NoteResourceImplTest method createDeployment.
@Deployment
public static Archive createDeployment() {
final GenericArchive webResources = ShrinkWrap.create(GenericArchive.class).as(ExplodedImporter.class).importDirectory("src/main/webapp").as(GenericArchive.class);
final File[] seleniumApi = Maven.resolver().loadPomFromFile("pom.xml").resolve("org.seleniumhq.selenium:selenium-api:2.35.0").withTransitivity().asFile();
return ShrinkWrap.create(WebArchive.class, NoteResourceImplTest.class.getSimpleName() + ".war").addClasses(Note.class, NoteApp.class, NoteResource.class, NoteResourceImpl.class).addAsResource("META-INF/persistence.xml").addAsWebInfResource("enforce-beans.xml", "jboss-all.xml").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsLibraries(seleniumApi).merge(webResources);
}
use of org.jboss.shrinkwrap.api.GenericArchive in project wildfly by wildfly.
the class DeploymentArchiveTestCase method createCliArchive.
private static File createCliArchive() {
final WebArchive webArchive = ShrinkWrap.create(WebArchive.class, WEB_ARCHIVE_NAME + ".war");
webArchive.addClass(SimpleServlet.class);
final JavaArchive moduleArchive = ShrinkWrap.create(JavaArchive.class, MODULE_ARCHIVE);
moduleArchive.addClass(DeploymentArchiveTestCase.class);
final GenericArchive cliArchive = ShrinkWrap.create(GenericArchive.class, "deploymentarchive.cli");
cliArchive.add(new StringAsset(DEPLOY_SCR), "deploy.scr");
cliArchive.add(new StringAsset(UNDEPLOY_SCR), "undeploy.scr");
cliArchive.add(webArchive, "/", ZipExporter.class);
cliArchive.add(moduleArchive, "/", ZipExporter.class);
cliArchive.add(new StringAsset(MODULE_XML), "/", "module.xml");
final String tempDir = TestSuiteEnvironment.getTmpDir();
final File file = new File(tempDir, "deploymentarchive.cli");
cliArchive.as(ZipExporter.class).exportTo(file, true);
return file;
}
Aggregations