Search in sources :

Example 16 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project javaee7-samples by javaee-samples.

the class SchemaGenScriptsExternalTest method createDeployment.

@Deployment
public static WebArchive createDeployment() throws Exception {
    copyURLToFile(currentThread().getContextClassLoader().getResource("META-INF/create.sql"), new File("/tmp/create.sql"));
    copyURLToFile(currentThread().getContextClassLoader().getResource("META-INF/drop.sql"), new File("/tmp/drop.sql"));
    copyURLToFile(currentThread().getContextClassLoader().getResource("META-INF/load.sql"), new File("/tmp/load.sql"));
    WebArchive war = ShrinkWrap.create(WebArchive.class).addPackage("org.javaee7.jpasamples.schema.gen.scripts.external").addAsResource("META-INF/persistence.xml").addAsResource("META-INF/create.sql").addAsResource("META-INF/drop.sql").addAsResource("META-INF/load.sql");
    System.out.println(war.toString(true));
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) File(java.io.File) FileUtils.copyURLToFile(org.apache.commons.io.FileUtils.copyURLToFile) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 17 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project javaee7-samples by javaee-samples.

the class EntityGraphTest method createDeployment.

@Deployment
public static WebArchive createDeployment() {
    WebArchive war = ShrinkWrap.create(WebArchive.class).addPackage("org.javaee7.jpa.entitygraph").addAsResource("META-INF/persistence.xml").addAsResource("META-INF/create.sql").addAsResource("META-INF/drop.sql").addAsResource("META-INF/load.sql");
    System.out.println(war.toString(true));
    return war;
}
Also used : WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 18 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project javaee7-samples by javaee-samples.

the class LockingOptimisticTest method createDeployment.

@Deployment
public static WebArchive createDeployment() {
    BeansDescriptor beansXml = Descriptors.create(BeansDescriptor.class);
    WebArchive war = ShrinkWrap.create(WebArchive.class).addPackage("org.javaee7.jpa.locking.optimistic").addAsResource("META-INF/persistence.xml").addAsResource("META-INF/load.sql").addAsWebInfResource(new StringAsset(beansXml.getOrCreateAlternatives().clazz(MovieBeanAlternative.class.getName()).up().exportAsString()), beansXml.getDescriptorName());
    System.out.println(war.toString(true));
    return war;
}
Also used : StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) BeansDescriptor(org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 19 with WebArchive

use of org.jboss.shrinkwrap.api.spec.WebArchive in project hibernate-orm by hibernate.

the class PackagingTestCase method buildWar.

protected File buildWar() {
    String fileName = "war.war";
    WebArchive archive = ShrinkWrap.create(WebArchive.class, fileName);
    archive.addClasses(org.hibernate.jpa.test.pack.war.ApplicationServer.class, org.hibernate.jpa.test.pack.war.IncrementListener.class, org.hibernate.jpa.test.pack.war.Lighter.class, org.hibernate.jpa.test.pack.war.Money.class, org.hibernate.jpa.test.pack.war.Mouse.class, org.hibernate.jpa.test.pack.war.OtherIncrementListener.class, org.hibernate.jpa.test.pack.war.Version.class);
    ArchivePath path = ArchivePaths.create("WEB-INF/classes/META-INF/orm.xml");
    archive.addAsResource("war/WEB-INF/classes/META-INF/orm.xml", path);
    path = ArchivePaths.create("WEB-INF/classes/META-INF/persistence.xml");
    archive.addAsResource("war/WEB-INF/classes/META-INF/persistence.xml", path);
    path = ArchivePaths.create("WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml");
    archive.addAsResource("war/WEB-INF/classes/org/hibernate/jpa/test/pack/war/Mouse.hbm.xml", path);
    File testPackage = new File(packageTargetDir, fileName);
    archive.as(ZipExporter.class).exportTo(testPackage, true);
    return testPackage;
}
Also used : ArchivePath(org.jboss.shrinkwrap.api.ArchivePath) ZipExporter(org.jboss.shrinkwrap.api.exporter.ZipExporter) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) File(java.io.File)

Example 20 with WebArchive

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

the class EntityManagerFactoryProducerTest method deploy.

@Deployment
public static WebArchive deploy() {
    // set the dummy PersistenceProviderResolver which creates our DummyEntityManagerFactory
    PersistenceProviderResolverHolder.setPersistenceProviderResolver(new TestPersistenceProviderResolver());
    JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, "unitDefinitionTest.jar").addPackage(ArchiveUtils.SHARED_PACKAGE).addPackage(EntityManagerFactoryProducerTest.class.getPackage().getName()).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml").addAsResource(new StringAsset(TestPersistenceProviderResolver.class.getName()), "META-INF/services/javax.persistence.spi.PersistenceProviderResolver");
    return ShrinkWrap.create(WebArchive.class).addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndJpaArchive()).addAsLibraries(testJar).addAsWebInfResource(ArchiveUtils.getBeansXml(), "beans.xml");
}
Also used : 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

WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)505 Deployment (org.jboss.arquillian.container.test.api.Deployment)409 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)159 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)104 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)83 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)80 HttpRequest (org.jboss.as.test.integration.common.HttpRequest)28 File (java.io.File)22 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)14 BatchTestHelper (org.javaee7.util.BatchTestHelper)13 PropertyPermission (java.util.PropertyPermission)11 ZipExporter (org.jboss.shrinkwrap.api.exporter.ZipExporter)11 SocketPermission (java.net.SocketPermission)10 ZipExporterImpl (org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl)10 CommonCriteria (org.jboss.as.test.categories.CommonCriteria)9 BeforeClass (org.junit.BeforeClass)9 Util (org.jboss.as.test.shared.integration.ejb.security.Util)7 URL (java.net.URL)6 FilePermission (java.io.FilePermission)5 BeansDescriptor (org.jboss.shrinkwrap.descriptor.api.beans10.BeansDescriptor)5