use of org.jboss.shrinkwrap.api.spec.WebArchive in project deltaspike by apache.
the class TestDeployments method initDeployment.
/**
* Create a basic deployment with dependencies, beans.xml and persistence descriptor.
*
* @return Basic web archive.
*/
public static WebArchive initDeployment() {
Logging.reconfigure();
WebArchive archive = ShrinkWrap.create(WebArchive.class, "test.war").addAsLibraries(getDeltaSpikeDataWithDependencies()).addAsWebInfResource("test-persistence.xml", "classes/META-INF/persistence.xml").addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
return archive;
}
use of org.jboss.shrinkwrap.api.spec.WebArchive in project deltaspike by apache.
the class MethodLevelInterceptorTest method war.
@Deployment
public static WebArchive war() {
Asset beansXml = new StringAsset("<beans><interceptors><class>" + CustomInterceptorImpl.class.getName() + "</class></interceptors></beans>");
String simpleName = MethodLevelInterceptorTest.class.getSimpleName();
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
//don't create a completely empty web-archive
if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0)) {
return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
}
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(MethodLevelInterceptorTest.class.getPackage()).addPackage(TestPartialBeanBinding.class.getPackage()).addAsManifestResource(beansXml, "beans.xml");
return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(beansXml, "beans.xml");
}
use of org.jboss.shrinkwrap.api.spec.WebArchive in project deltaspike by apache.
the class ClassLevelInterceptorTest method war.
@Deployment
public static WebArchive war() {
Asset beansXml = new StringAsset("<beans><interceptors><class>" + CustomInterceptorImpl.class.getName() + "</class></interceptors></beans>");
String simpleName = ClassLevelInterceptorTest.class.getSimpleName();
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
//don't create a completely empty web-archive
if (CdiContainerUnderTest.is(CONTAINER_WELD_2_0_0)) {
return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive());
}
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(ClassLevelInterceptorTest.class.getPackage()).addPackage(TestPartialBeanBinding.class.getPackage()).addAsManifestResource(beansXml, "beans.xml");
return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(beansXml, "beans.xml");
}
use of org.jboss.shrinkwrap.api.spec.WebArchive in project deltaspike by apache.
the class PartialBeanWithProducerWarFileTest method deploy.
@Deployment
public static WebArchive deploy() {
String simpleName = PartialBeanWithProducerWarFileTest.class.getSimpleName();
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(PartialBeanWithProducerWarFileTest.class.getPackage()).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
return ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
}
use of org.jboss.shrinkwrap.api.spec.WebArchive in project deltaspike by apache.
the class PartialBeanAsAbstractClassTest method war.
@Deployment
public static WebArchive war() {
String simpleName = PartialBeanAsAbstractClassTest.class.getSimpleName();
String archiveName = simpleName.substring(0, 1).toLowerCase() + simpleName.substring(1);
JavaArchive testJar = ShrinkWrap.create(JavaArchive.class, archiveName + ".jar").addPackage(PartialBeanAsAbstractClassTest.class.getPackage()).addPackage(TestPartialBeanBinding.class.getPackage()).addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
WebArchive webArchive = ShrinkWrap.create(WebArchive.class, archiveName + ".war").addAsLibraries(ArchiveUtils.getDeltaSpikeCoreAndPartialBeanArchive()).addAsLibraries(testJar).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
return webArchive;
}
Aggregations