use of org.jboss.arquillian.container.test.api.Deployment in project quickstarts by jboss-switchyard.
the class JCAInflowBindingTest method createTestArchive.
@Deployment
public static Archive<?> createTestArchive() {
File artifact = new File(QUICKSTART_JAR);
if (!artifact.exists()) {
String error = QUICKSTART_JAR + " not found. Do \"mvn package\" before the test";
_logger.error(error);
throw new RuntimeException(error);
}
try {
JBossCliUtil.executeCliScript(CLI_CONFIG_FILE);
return ShrinkWrap.create(ZipImporter.class, artifact.getName()).importFrom(new ZipFile(artifact)).as(JavaArchive.class);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
use of org.jboss.arquillian.container.test.api.Deployment 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");
}
use of org.jboss.arquillian.container.test.api.Deployment 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.arquillian.container.test.api.Deployment 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.arquillian.container.test.api.Deployment 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");
}
Aggregations