use of org.jboss.shrinkwrap.api.asset.ClassLoaderAsset in project dwoss by gg-net.
the class ArquillianProjectArchive method createDeployment.
@Deployment
public static WebArchive createDeployment() {
File[] libs = Maven.resolver().loadPomFromFile("pom.xml").importRuntimeDependencies().addDependency(// The Sample Mandator is needed on many places.
MavenDependencies.createDependency("eu.ggnet.dwoss:dwoss-mandator-sample", RUNTIME, false)).addDependency(// Log4J API
MavenDependencies.createDependency("org.slf4j:slf4j-log4j12", RUNTIME, false)).addDependency(// AssertJ Fluent Assertions
MavenDependencies.createDependency("org.assertj:assertj-core", RUNTIME, false)).resolve().withTransitivity().asFile();
WebArchive war = ShrinkWrap.create(WebArchive.class, "customer-persistence-test.war").addPackages(true, // Compile safe package "eu.ggnet.dwoss.customer.itest"
Filters.exclude(// Compile safe package "eu.ggnet.dwoss.customer.itest"
PersistenceIT.class.getPackage(), // Compile safe package "eu.ggnet.dwoss.customer.test"
CustomerTest.class.getPackage()), "eu.ggnet.dwoss.customer").addClass(// The Datasource Configuration and the Static Producers
MandatorSupportProducer.class).addClass(// Alle Datasources. More than we need.
SampleDataSourceDefinition.class).addClass(// Need this cause of the maven resolver is part of the deployment
Coordinate.class).addClass(// The local deployer configuration
ArquillianProjectArchive.class).addAsResource(new ClassLoaderAsset("META-INF/persistence.xml"), "META-INF/persistence.xml").addAsResource(new ClassLoaderAsset("log4j.properties"), "log4j.properties").addAsWebInfResource(// Needed for jboss/wildfly h2 enablement
"jboss-deployment-structure.xml").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsLibraries(libs);
return war;
}
Aggregations