Author: rsearls
Date: 2014-12-30 11:16:02 -0500 (Tue, 30 Dec 2014)
New Revision: 19298
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase3/client/JBWS2074TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java
Log:
arquillian migration jbws2074 test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java 2014-12-29
15:50:04 UTC (rev 19297)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase1/client/JBWS2074TestCase.java 2014-12-30
16:16:02 UTC (rev 19298)
@@ -27,7 +27,21 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOIface;
@@ -40,34 +54,44 @@
*
* @author ropalka(a)redhat.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2074TestCase extends JBossWSTest
{
- static {
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2074-usecase1.war") { {
+ @ArquillianResource
+ Deployer deployer;
+
+ private static final String WAR_DEPLOYMENT = "jaxws-jbws2074-usecase1";
+ @Deployment(name = WAR_DEPLOYMENT, testable = false, managed = false)
+ public static WebArchive createClientDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, WAR_DEPLOYMENT +
".war");
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.ManualResourcesHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOIface.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOImpl.class)
-
.addAsResource("org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase1/WEB-INF/web.xml"));
- }
- });
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-jbws2074-usecase1.ear") { {
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.ManualResourcesHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOIface.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase1.service.POJOImpl.class)
+
.addAsResource("org/jboss/test/ws/jaxws/jbws2074/usecase1/service/jaxws-service-handlers.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase1/WEB-INF/web.xml"));
+ writeToDisk(archive);
+ return archive;
+ }
+
+ @Deployment(name = "jaxws-jbws2074-ear-usecase1", testable = false, managed
= false)
+ public static EnterpriseArchive createClientDeployment() {
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class,
"jaxws-jbws2074-usecase1.ear");
archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(),
"jaxws-jbws2074-usecase1.war"))
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase1-ear/META-INF/application.xml"),
"application.xml");
- }
- });
+ .addManifest()
+ .addAsModule(new File(JBossWSTestHelper.getTestArchiveDir(), WAR_DEPLOYMENT +
".war"))
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase1-ear/META-INF/application.xml"),
"application.xml");
+ return archive;
}
- public static Test suite()
+ public static void writeToDisk(WebArchive archive)
{
- return new JBossWSTestSetup(JBWS2074TestCase.class, "");
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
public void executeTest() throws Exception
@@ -90,29 +114,33 @@
assertEquals(expStr.toString(), retStr);
}
+ @Test
+ @RunAsClient
public void testUsecase1WithoutEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase1.war");
+ deployer.deploy(WAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase1.war");
+ deployer.undeploy(WAR_DEPLOYMENT);
}
}
+ @Test
+ @RunAsClient
public void testUsecase1WithEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase1.ear");
+ deployer.deploy("jaxws-jbws2074-ear-usecase1");
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase1.ear");
+ deployer.undeploy("jaxws-jbws2074-ear-usecase1");
}
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java 2014-12-29
15:50:04 UTC (rev 19297)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase2/client/JBWS2074TestCase.java 2014-12-30
16:16:02 UTC (rev 19298)
@@ -27,7 +27,21 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Iface;
@@ -40,30 +54,41 @@
*
* @author ropalka(a)redhat.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2074TestCase extends JBossWSTest
{
- static {
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-jbws2074-usecase2.jar") { {
+ @ArquillianResource
+ Deployer deployer;
+
+ private static final String JAR_DEPLOYMENT = "jaxws-jbws2074-usecase2";
+ @Deployment(name = JAR_DEPLOYMENT, testable = false, managed = false)
+ public static JavaArchive createClientDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, JAR_DEPLOYMENT +
".jar");
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Iface.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Impl.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase2/META-INF/ejb-jar.xml"), "ejb-jar.xml");
- }
- });
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-jbws2074-usecase2.ear") { {
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Iface.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase2.service.EJB3Impl.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase2/META-INF/ejb-jar.xml"), "ejb-jar.xml");
+ writeToDisk(archive);
+ return archive;
+ }
+
+ private static final String EAR_DEPLOYMENT = "jaxws-jbws2074-ear-usecase2";
+ @Deployment(name = EAR_DEPLOYMENT, testable = false, managed = false)
+ public static EnterpriseArchive createClientDeployment() {
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class,
"jaxws-jbws2074-usecase2.ear");
archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(),
"jaxws-jbws2074-usecase2.jar"))
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase2-ear/META-INF/application.xml"),
"application.xml");
- }
- });
+ .addManifest()
+ .addAsModule(new File(JBossWSTestHelper.getTestArchiveDir(), JAR_DEPLOYMENT +
".jar"))
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase2-ear/META-INF/application.xml"),
"application.xml");
+ return archive;
}
- public static Test suite()
+ public static void writeToDisk(JavaArchive archive)
{
- return new JBossWSTestSetup(JBWS2074TestCase.class, "");
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
public void executeTest() throws Exception
@@ -80,29 +105,33 @@
assertEquals(expStr.toString(), retStr);
}
+ @Test
+ @RunAsClient
public void testUsecase2WithoutEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase2.jar");
+ deployer.deploy(JAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase2.jar");
+ deployer.undeploy(JAR_DEPLOYMENT);
}
}
+ @Test
+ @RunAsClient
public void testUsecase2WithEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase2.ear");
+ deployer.deploy(EAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase2.ear");
+ deployer.undeploy(EAR_DEPLOYMENT);
}
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase3/client/JBWS2074TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase3/client/JBWS2074TestCase.java 2014-12-29
15:50:04 UTC (rev 19297)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase3/client/JBWS2074TestCase.java 2014-12-30
16:16:02 UTC (rev 19298)
@@ -29,7 +29,21 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.test.ws.jaxws.jbws2074.usecase3.service.POJOIface;
@@ -43,30 +57,41 @@
*
* @author ropalka(a)redhat.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2074TestCase extends JBossWSTest
{
- static {
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.WarDeployment("jaxws-jbws2074-usecase3.war") { {
+ @ArquillianResource
+ Deployer deployer;
+
+ private static final String WAR_DEPLOYMENT = "jaxws-jbws2074-usecase3";
+ @Deployment(name = WAR_DEPLOYMENT, testable = false, managed = false)
+ public static WebArchive createClientDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, WAR_DEPLOYMENT +
".war");
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase3.service.POJOIface.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase3.service.POJOImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase3/WEB-INF/web.xml"));
- }
- });
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-jbws2074-usecase3.ear") { {
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase3.service.POJOIface.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase3.service.POJOImpl.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase3/WEB-INF/web.xml"));
+ writeToDisk(archive);
+ return archive;
+ }
+
+ private static final String EAR_DEPLOYMENT = "jaxws-jbws2074-ear-usecase3";
+ @Deployment(name = EAR_DEPLOYMENT, testable = false, managed = false)
+ public static EnterpriseArchive createClientDeployment() {
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class,
EAR_DEPLOYMENT + ".ear");
archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(),
"jaxws-jbws2074-usecase3.war"))
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase3-ear/META-INF/application.xml"),
"application.xml");
- }
- });
+ .addManifest()
+ .addAsModule(new File(JBossWSTestHelper.getTestArchiveDir(),
"jaxws-jbws2074-usecase3.war"))
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase3-ear/META-INF/application.xml"),
"application.xml");
+ return archive;
}
- public static Test suite()
+ public static void writeToDisk(WebArchive archive)
{
- return new JBossWSTestSetup(JBWS2074TestCase.class, "");
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
public void executeTest() throws Exception
@@ -83,29 +108,33 @@
assertEquals(expStr.toString(), retStr);
}
+ @Test
+ @RunAsClient
public void testUsecase3WithoutEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase3.war");
+ deployer.deploy(WAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase3.war");
+ deployer.undeploy(WAR_DEPLOYMENT);
}
}
+ @Test
+ @RunAsClient
public void testUsecase3WithEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase3.ear");
+ deployer.deploy(EAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase3.ear");
+ deployer.undeploy(EAR_DEPLOYMENT);
}
}
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java 2014-12-29
15:50:04 UTC (rev 19297)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074/usecase4/client/JBWS2074TestCase.java 2014-12-30
16:16:02 UTC (rev 19298)
@@ -27,7 +27,21 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.RunAsClient;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.api.ArquillianResource;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.spec.JavaArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
+import org.jboss.shrinkwrap.api.Archive;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Iface;
@@ -40,34 +54,45 @@
*
* @author ropalka(a)redhat.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2074TestCase extends JBossWSTest
{
- static {
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-jbws2074-usecase4.jar") { {
+ @ArquillianResource
+ Deployer deployer;
+
+ private static final String JAR_DEPLOYMENT = "jaxws-jbws2074-usecase4";
+ @Deployment(name = JAR_DEPLOYMENT, testable = false, managed = false)
+ public static JavaArchive createClientDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, JAR_DEPLOYMENT +
".jar");
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.logging\n"))
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.ManualResourcesHandler.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Iface.class)
-
.addClass(org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Impl.class)
-
.addAsResource("org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml")
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase4/META-INF/ejb-jar.xml"), "ejb-jar.xml");
- }
- });
- JBossWSTestHelper.writeToFile(new
JBossWSTestHelper.JarDeployment("jaxws-jbws2074-usecase4.ear") { {
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.logging\n"))
+
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.DescriptorResourcesHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.JavaResourcesHandler.class)
+
.addClass(org.jboss.test.ws.jaxws.jbws2074.handler.ManualResourcesHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Iface.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2074.usecase4.service.EJB3Impl.class)
+
.addAsResource("org/jboss/test/ws/jaxws/jbws2074/usecase4/service/jaxws-service-handlers.xml")
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase4/META-INF/ejb-jar.xml"), "ejb-jar.xml");
+ writeToDisk(archive);
+ return archive;
+ }
+
+ private static final String EAR_DEPLOYMENT = "jaxws-jbws2074-ear-usecase4";
+ @Deployment(name = EAR_DEPLOYMENT, testable = false, managed = false)
+ public static EnterpriseArchive createClientDeployment() {
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class,
"jaxws-jbws2074-usecase4.ear");
archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(),
"jaxws-jbws2074-usecase4.jar"))
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase4-ear/META-INF/application.xml"),
"application.xml");
- }
- });
+ .addManifest()
+ .addAsModule(new File(JBossWSTestHelper.getTestArchiveDir(), JAR_DEPLOYMENT +
".jar"))
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2074/usecase4-ear/META-INF/application.xml"),
"application.xml");
+ return archive;
}
- public static Test suite()
+ public static void writeToDisk(JavaArchive archive)
{
- return new JBossWSTestSetup(JBWS2074TestCase.class, "");
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
public void executeTest() throws Exception
@@ -90,29 +115,33 @@
assertEquals(expStr.toString(), retStr);
}
+ @Test
+ @RunAsClient
public void testUsecase4WithoutEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase4.jar");
+ deployer.deploy(JAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase4.jar");
+ deployer.undeploy(JAR_DEPLOYMENT);
}
}
+ @Test
+ @RunAsClient
public void testUsecase4WithEar() throws Exception
{
try
{
- deploy("jaxws-jbws2074-usecase4.ear");
+ deployer.deploy(EAR_DEPLOYMENT);
executeTest();
}
finally
{
- undeploy("jaxws-jbws2074-usecase4.ear");
+ deployer.undeploy(EAR_DEPLOYMENT);
}
}