Search in sources :

Example 1 with WebAppDescriptor

use of org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor in project tomee by apache.

the class StratocasterTest method createDeployment.

@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class).version(WebAppVersionType._3_0).createServlet().servletName("servlet").servletClass(Stratocaster.class.getName()).up().createServletMapping().servletName("servlet").urlPattern("/" + TEST_NAME).up();
    addEnvEntry(descriptor, "guitarStringGuages", "java.lang.String", "E1=0.052\nA=0.042\nD=0.030\nG=0.017\nB=0.013\nE=0.010");
    addEnvEntry(descriptor, "certificateOfAuthenticity", "java.lang.String", "/tmp/strat-certificate.txt");
    addEnvEntry(descriptor, "dateCreated", "java.lang.String", "1962-03-01");
    addEnvEntry(descriptor, "pickups", "java.lang.String", "S,S,S");
    addEnvEntry(descriptor, "style", "java.lang.String", "VINTAGE");
    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war").addClass(PojoServlet.class).addClass(Code.class).addClass(Stratocaster.class).addClass(Pickup.class).addClass(PickupEditor.class).addClass(Style.class).addAsLibraries(JarLocation.jarLocation(Test.class)).setWebXML(new StringAsset(descriptor.exportAsString()));
    return archive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) PojoServlet(org.apache.openejb.arquillian.tests.enventry.PojoServlet) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 2 with WebAppDescriptor

use of org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor in project tomee by apache.

the class ServletListenerEjbRemoteTest method createDeployment.

@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class).version("3.0").createListener().listenerClass(RemoteServletContextListener.class.getName()).up().createListener().listenerClass(RemoteServletSessionListener.class.getName()).up().createServlet().servletName("check").servletClass(ServletToCheckListener.class.getName()).up().createServletMapping().servletName("check").urlPattern("/" + TEST_NAME).up();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war").addClass(RemoteServletContextListener.class).addClass(RemoteServletSessionListener.class).addClass(ServletToCheckListener.class).addClass(CompanyRemote.class).addClass(DefaultCompany.class).addClass(ContextAttributeName.class).setWebXML(new StringAsset(descriptor.exportAsString())).addAsWebInfResource(EmptyAsset.INSTANCE, ArchivePaths.create("beans.xml"));
    return archive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with WebAppDescriptor

use of org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor in project tomee by apache.

the class IvmContextTest method createDeployment.

@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class).version(WebAppVersionType._3_0).createServlet().servletName(SERVLET_NAME).servletClass(IvmContextServlet.class.getName()).up().createServletMapping().servletName(SERVLET_NAME).urlPattern("/" + TEST_NAME).up();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war").addClass(IvmContextTest.class).addClass(IvmContextServlet.class).addClass(NamingBean.class).addClass(Runner.class).addAsLibraries(JarLocation.jarLocation(Test.class)).addAsWebInfResource(new ClassLoaderAsset(CONTENT_LOCATION_EJB_JAR_XML), RESOURCE_EJB_JAR_XML).setWebXML(new StringAsset(descriptor.exportAsString()));
    return archive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) Runner(org.apache.openejb.arquillian.tests.Runner) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Test(org.junit.Test) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ClassLoaderAsset(org.jboss.shrinkwrap.api.asset.ClassLoaderAsset) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 4 with WebAppDescriptor

use of org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor in project tomee by apache.

the class SessionSynchronizationCallbackTest method createDeployment.

@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class).version(WebAppVersionType._3_0).createServlet().servletName(SERVLET_NAME).servletClass(SessionSynchronizationCallbackServlet.class.getName()).up().createServletMapping().servletName(SERVLET_NAME).urlPattern("/" + TEST_NAME).up();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war").addClass(SessionSynchronizationCallbackServlet.class).addClass(StatefulBean.class).addClass(TestEntity.class).addClass(Runner.class).addAsLibraries(JarLocation.jarLocation(Test.class)).addAsResource(new ClassLoaderAsset(PERSISTENCE_XML_SOURCE), PERSISTENCE_XML_DESTINATION).setWebXML(new StringAsset(descriptor.exportAsString()));
    return archive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) Runner(org.apache.openejb.arquillian.tests.Runner) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Test(org.junit.Test) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ClassLoaderAsset(org.jboss.shrinkwrap.api.asset.ClassLoaderAsset) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 5 with WebAppDescriptor

use of org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor in project tomee by apache.

the class MultiplePersistenceTest method createDeployment.

@Deployment(testable = false)
public static WebArchive createDeployment() {
    WebAppDescriptor descriptor = Descriptors.create(WebAppDescriptor.class).version(WebAppVersionType._3_0).createServlet().servletName("check").servletClass(MultiplePUServlet.class.getName()).up().createServletMapping().servletName("check").urlPattern("/" + TEST_NAME).up();
    WebArchive archive = ShrinkWrap.create(WebArchive.class, TEST_NAME + ".war").addClass(MultiplePUServlet.class).addClass(Person1.class).addClass(Person2.class).addClass(Runner.class).addAsLibraries(JarLocation.jarLocation(Test.class)).addAsResource(new ClassLoaderAsset("org/apache/openejb/arquillian/tests/persistence/multiple/persistence.xml"), "META-INF/persistence.xml").setWebXML(new StringAsset(descriptor.exportAsString()));
    return archive;
}
Also used : WebAppDescriptor(org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor) Runner(org.apache.openejb.arquillian.tests.Runner) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Test(org.junit.Test) WebArchive(org.jboss.shrinkwrap.api.spec.WebArchive) ClassLoaderAsset(org.jboss.shrinkwrap.api.asset.ClassLoaderAsset) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Aggregations

WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp30.WebAppDescriptor)28 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)26 WebArchive (org.jboss.shrinkwrap.api.spec.WebArchive)25 Deployment (org.jboss.arquillian.container.test.api.Deployment)21 Test (org.junit.Test)14 HashMap (java.util.HashMap)7 Runner (org.apache.openejb.arquillian.tests.Runner)7 WebAppDescriptor (org.jboss.shrinkwrap.descriptor.api.webapp31.WebAppDescriptor)7 ClassLoaderAsset (org.jboss.shrinkwrap.api.asset.ClassLoaderAsset)6 EnterpriseArchive (org.jboss.shrinkwrap.api.spec.EnterpriseArchive)4 JavaArchive (org.jboss.shrinkwrap.api.spec.JavaArchive)4 ResourceAdapterArchive (org.jboss.shrinkwrap.api.spec.ResourceAdapterArchive)4 ApplicationDescriptor (org.jboss.shrinkwrap.descriptor.api.application6.ApplicationDescriptor)4 File (java.io.File)2 InputStream (java.io.InputStream)2 Map (java.util.Map)2 Yaml (org.yaml.snakeyaml.Yaml)2 IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1 GatewayServlet (org.apache.knox.gateway.GatewayServlet)1