JBossWS SVN: r19303 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2268.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-30 22:10:28 -0500 (Tue, 30 Dec 2014)
New Revision: 19303
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2268/JBWS2268TestCase.java
Log:
arquillian migration jbws2268 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2268/JBWS2268TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2268/JBWS2268TestCase.java 2014-12-31 01:54:54 UTC (rev 19302)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2268/JBWS2268TestCase.java 2014-12-31 03:10:28 UTC (rev 19303)
@@ -31,7 +31,17 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+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.arquillian.container.test.api.Deployer;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -43,31 +53,24 @@
* [JBWS-2268] Implement @PostConstruct and @Predestroy annotations support for POJO based endpoints
* @author richard.opalka(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public final class JBWS2268TestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2268.war") { {
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(name = "dep", testable = false, managed = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2268.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2268.EndpointImpl.class)
.addClass(org.jboss.test.ws.jaxws.jbws2268.EndpointInterface.class)
.addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2268/META-INF/permissions.xml"), "permissions.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2268/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
- }
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS2268TestCase.class, "");
- }
-
private EndpointInterface getProxy() throws Exception
{
QName serviceName = new QName("http://www.jboss.org/test/ws/jaxws/jbws2268", "EndpointService");
@@ -87,18 +90,21 @@
return retVal;
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("dep")
public void testJavaxAnnotationsSupport() throws Exception
{
File logFile = createLogFile();
- deploy("jaxws-jbws2268.war");
+ deployer.deploy("dep");
try
{
assertTrue(getProxy().setFile(logFile.getAbsolutePath()));
}
finally
{
- undeploy("jaxws-jbws2268.war");
+ deployer.undeploy("dep");
assertPostConstructAndPreDestroyLogs(logFile);
}
}
9 years, 11 months
JBossWS SVN: r19302 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3140.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-30 20:54:54 -0500 (Tue, 30 Dec 2014)
New Revision: 19302
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3140/JBWS3140TestCase.java
Log:
arquillian migration jbws3140 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3140/JBWS3140TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3140/JBWS3140TestCase.java 2014-12-31 01:33:14 UTC (rev 19301)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3140/JBWS3140TestCase.java 2014-12-31 01:54:54 UTC (rev 19302)
@@ -34,13 +34,28 @@
import org.jboss.wsf.test.JBossWSTestHelper.WarDeployment;
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+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.arquillian.container.test.api.OperateOnDeployment;
+import org.jboss.arquillian.container.test.api.Deployer;
+
+(a)RunWith(Arquillian.class)
public class JBWS3140TestCase extends JBossWSTest
{
- public final String servletClientURL = "http://" + getServerHost() + ":8080/jbws3140-client/ServletTest";
+ @ArquillianResource
+ Deployer deployer;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new WarDeployment("jbws3140-server.war") { {
+ @Deployment(name="jbws3140-server", testable = false, managed=false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jbws3140-server.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws3140.ClientHandler.class)
@@ -56,31 +71,37 @@
.addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Server/web.xml"), "web.xml")
.addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Server/webservices.xml"), "webservices.xml")
.setWebXML(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Server/web.xml"));
- }
- });
- list.add(new WarDeployment("jbws3140-responses-server.war") { {
+ return archive;
+ }
+
+ @Deployment(name = "jbws3140-responses-server", testable = false, managed=false)
+ public static WebArchive createDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jbws3140-responses-server.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.ClientHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.DataType.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.EndpointService.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.MTOMTest.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.MTOMTestImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.ObjectFactory.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.ResponseType.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3140.ServerHandler.class)
+ .addAsResource("org/jboss/test/ws/jaxws/jbws3140/client-handlers.xml")
+ .addAsResource("org/jboss/test/ws/jaxws/jbws3140/server-handlers.xml")
+ .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/wsdl/TestEndpoint.wsdl"), "wsdl/TestEndpoint.wsdl")
+ .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Responses-Server/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Responses-Server/web.xml"), "web.xml")
+ .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Responses-Server/webservices.xml"), "webservices.xml")
+ .setWebXML(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Server/web.xml"));
+ return archive;
+ }
+
+ @Deployment(name = "jbws3140-client", testable = false, managed=false)
+ public static WebArchive createDeployment3() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jbws3140-client.war");
archive
.addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws3140.ClientHandler.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.DataType.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.EndpointService.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.MTOMTest.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.MTOMTestImpl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.ObjectFactory.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.ResponseType.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3140.ServerHandler.class)
- .addAsResource("org/jboss/test/ws/jaxws/jbws3140/client-handlers.xml")
- .addAsResource("org/jboss/test/ws/jaxws/jbws3140/server-handlers.xml")
- .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/wsdl/TestEndpoint.wsdl"), "wsdl/TestEndpoint.wsdl")
- .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Responses-Server/jboss-web.xml"), "jboss-web.xml")
- .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Responses-Server/web.xml"), "web.xml")
- .addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Responses-Server/webservices.xml"), "webservices.xml")
- .setWebXML(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Server/web.xml"));
- }
- });
- list.add(new WarDeployment("jbws3140-client.war") { {
- archive
- .addManifest()
.addAsResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/large.jpg"))
.addAsResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/small.jpg"))
.addClass(org.jboss.test.ws.jaxws.jbws3140.ClientHandler.class)
@@ -97,41 +118,39 @@
.addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/wsdl/TestEndpoint.wsdl"), "wsdl/TestEndpoint.wsdl")
.addAsWebInfResource(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Client/jboss-web.xml"), "jboss-web.xml")
.setWebXML(new File(getTestResourcesDir() + "/jaxws/jbws3140/WEB-INF-Client/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
- }
+ @Test
+ @RunAsClient
public void testWsaResponses() throws Exception
{
try {
- JBossWSTestHelper.deploy("jbws3140-responses-server.war");
- JBossWSTestHelper.deploy("jbws3140-client.war");
- String result = IOUtils.readAndCloseStream(new URL(servletClientURL + "?mtom=small").openStream());
+ deployer.deploy("jbws3140-responses-server");
+ deployer.deploy("jbws3140-client");
+ String result = IOUtils.readAndCloseStream(new URL("http://" + getServerHost() + ":8080/jbws3140-client/ServletTest" + "?mtom=small").openStream());
assertTrue("SOAPFaultException is expected but received: " + result, result.indexOf("SOAPFaultException") > -1);
String expectedDetail = "A header representing a Message Addressing Property is not valid";
assertTrue("Expected message wasn't found in response: " + result, result.indexOf(expectedDetail) > -1);
} finally {
- JBossWSTestHelper.undeploy("jbws3140-responses-server.war");
- JBossWSTestHelper.undeploy("jbws3140-client.war");
+ deployer.undeploy("jbws3140-responses-server");
+ deployer.undeploy("jbws3140-client");
}
}
+ @Test
+ @RunAsClient
public void testMtomSmall() throws Exception
{
try {
- JBossWSTestHelper.deploy("jbws3140-server.war");
- JBossWSTestHelper.deploy("jbws3140-client.war");
- String result = IOUtils.readAndCloseStream(new URL(servletClientURL + "?mtom=small").openStream());
+ deployer.deploy("jbws3140-server");
+ deployer.deploy("jbws3140-client");
+ String result = IOUtils.readAndCloseStream(new URL("http://" + getServerHost() + ":8080/jbws3140-client/ServletTest" + "?mtom=small").openStream());
String expected ="--ClientMTOMEnabled--ServerMTOMEnabled--ServerAddressingEnabled--ClientAddressingEnabled";
assertTrue("Expected string wasn't found in response: " + result, result.indexOf(expected) > -1);
} finally {
- JBossWSTestHelper.undeploy("jbws3140-server.war");
- JBossWSTestHelper.undeploy("jbws3140-client.war");
+ deployer.undeploy("jbws3140-server");
+ deployer.undeploy("jbws3140-client");
}
}
}
9 years, 11 months
JBossWS SVN: r19301 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1822.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-30 20:33:14 -0500 (Tue, 30 Dec 2014)
New Revision: 19301
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1822/JBWS1822TestCase.java
Log:
arquillian migration jbws1822 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1822/JBWS1822TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1822/JBWS1822TestCase.java 2014-12-30 23:56:07 UTC (rev 19300)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1822/JBWS1822TestCase.java 2014-12-31 01:33:14 UTC (rev 19301)
@@ -27,7 +27,19 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+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.JavaArchive;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.jboss.shrinkwrap.api.exporter.ZipExporter;
+import org.jboss.arquillian.container.test.api.Deployer;
+import org.jboss.shrinkwrap.api.spec.EnterpriseArchive;
import org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface;
import org.jboss.wsf.test.JBossWSTest;
@@ -41,85 +53,98 @@
*
* @since Jan 8, 2008
*/
+(a)RunWith(Arquillian.class)
public final class JBWS1822TestCase extends JBossWSTest
{
- static {
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-jbws1822-shared.jar") { {
- archive
+ @ArquillianResource
+ Deployer deployer;
+
+ public static void createDeployment3() {
+ JavaArchive archive1 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1822-shared.jar");
+ archive1
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanIface.class)
.addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanImpl.class);
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-jbws1822-two-ejb3-inside.jar") { {
+ writeToDisk(archive1);
+ }
+
+ @Deployment(name="jaxws-jbws1822-two-ejb-modules", testable = false, managed=false)
+ public static EnterpriseArchive createDeployment2() {
+ JavaArchive archive3 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1822-one-ejb3-inside.jar");
+ archive3
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3Bean.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface.class);
+ writeToDisk(archive3);
+
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-jbws1822-two-ejb-modules.ear");
archive
.addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanIface.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanImpl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3Bean.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface.class);
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-jbws1822-one-ejb3-inside.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3Bean.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface.class);
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-jbws1822-two-ejb-modules.ear") { {
- archive
- .addManifest()
.addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-jbws1822-one-ejb3-inside.jar"))
.addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-jbws1822-shared.jar"));
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-jbws1822-one-ejb-module.ear") { {
+ return archive;
+ }
+
+ @Deployment(name = "jaxws-jbws1822-one-ejb-module", testable = false, managed = false)
+ public static EnterpriseArchive createDeployment1() {
+ JavaArchive archive2 = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1822-two-ejb3-inside.jar");
+ archive2
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanIface.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1822.shared.BeanImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3Bean.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1822.webservice.EJB3RemoteIface.class);
+ writeToDisk(archive2);
+
+ EnterpriseArchive archive = ShrinkWrap.create(EnterpriseArchive.class, "jaxws-jbws1822-one-ejb-module.ear");
archive
- .addManifest()
- .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-jbws1822-two-ejb3-inside.jar"));
- }
- });
+ .addManifest()
+ .addAsResource(new File(JBossWSTestHelper.getTestArchiveDir(), "jaxws-jbws1822-two-ejb3-inside.jar"));
+ return archive;
}
- public static Test suite()
+ public static void writeToDisk(JavaArchive archive)
{
- return new JBossWSTestSetup(JBWS1822TestCase.class, "");
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
private EJB3RemoteIface getProxy() throws Exception
{
QName serviceName = new QName("http://jbossws.org/JBWS1822", "EndpointService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1822?wsdl");
-
Service service = Service.create(wsdlURL, serviceName);
return (EJB3RemoteIface)service.getPort(EJB3RemoteIface.class);
}
-
+
+ @Test
+ @RunAsClient
public void testOneEjbModule() throws Exception
{
- deploy("jaxws-jbws1822-one-ejb-module.ear");
+ deployer.deploy("jaxws-jbws1822-one-ejb-module");
try
{
assertEquals(getProxy().getMessage(), "Injected hello message");
}
finally
{
- undeploy("jaxws-jbws1822-one-ejb-module.ear");
+ deployer.undeploy("jaxws-jbws1822-one-ejb-module");
}
}
-
+
+ @Test
+ @RunAsClient
public void testTwoEjbModules() throws Exception
{
- deploy("jaxws-jbws1822-two-ejb-modules.ear");
+ deployer.deploy("jaxws-jbws1822-two-ejb-modules");
try
{
assertEquals(getProxy().getMessage(), "Injected hello message");
}
finally
{
- undeploy("jaxws-jbws1822-two-ejb-modules.ear");
+ deployer.undeploy("jaxws-jbws1822-two-ejb-modules");
}
}
-
+
}
9 years, 11 months
JBossWS SVN: r19300 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-30 18:56:07 -0500 (Tue, 30 Dec 2014)
New Revision: 19300
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceEJB3TestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceJSETestCase.java
Log:
arquillian migration webservice test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceEJB3TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceEJB3TestCase.java 2014-12-30 16:26:29 UTC (rev 19299)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceEJB3TestCase.java 2014-12-30 23:56:07 UTC (rev 19300)
@@ -22,12 +22,29 @@
package org.jboss.test.ws.jaxws.samples.webservice;
import java.io.File;
+import java.net.URL;
-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.Deployer;
+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.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestSetup;
+//----------------
+import java.net.MalformedURLException;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
/**
* Test the JSR-181 annotation: javax.jws.WebService
*
@@ -35,75 +52,92 @@
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @since 29-Apr-2005
*/
+(a)RunWith(Arquillian.class)
public class WebServiceEJB3TestCase extends WebServiceBase
{
- static {
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-webservice02-ejb3.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3Bean02.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3RemoteInterface.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/META-INF02/wsdl/TestService.wsdl"), "wsdl/TestService.wsdl");
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-webservice01-ejb3.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3Bean01.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3RemoteInterface.class);
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.JarDeployment("jaxws-samples-webservice03-ejb3.jar") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3Bean03.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3RemoteInterface.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EndpointInterface03.class);
- }
- });
+ @ArquillianResource
+ Deployer deployer;
+
+ private static final String WEBSERVICE_02 = "jaxws-samples-webservice02-ejb3";
+
+ @Deployment(name = WEBSERVICE_02, testable = false, managed = false)
+ public static JavaArchive createDeployment2() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, WEBSERVICE_02 + ".jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3Bean02.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3RemoteInterface.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/META-INF02/wsdl/TestService.wsdl"), "wsdl/TestService.wsdl");
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceEJB3TestCase.class, "");
+ private static final String WEBSERVICE_01 = "jaxws-samples-webservice01-ejb3";
+
+ @Deployment(name = WEBSERVICE_01, testable = false, managed = false)
+ public static JavaArchive createDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, WEBSERVICE_01 + ".jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3Bean01.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3RemoteInterface.class);
+ return archive;
}
+ private static final String WEBSERVICE_03 = "jaxws-samples-webservice03-ejb3";
+
+ @Deployment(name = WEBSERVICE_03, testable = false, managed = false)
+ public static JavaArchive createDeployment3() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, WEBSERVICE_03 + ".jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3Bean03.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EJB3RemoteInterface.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EndpointInterface03.class);
+ return archive;
+ }
+
+ @Test
+ @RunAsClient
public void testWebServiceTest() throws Exception
{
- deploy("jaxws-samples-webservice01-ejb3.jar");
+ deployer.deploy(WEBSERVICE_01);
try
{
webServiceTest("jaxws-samples-webservice01-ejb3");
}
finally
{
- undeploy("jaxws-samples-webservice01-ejb3.jar");
+ deployer.undeploy(WEBSERVICE_01);
}
}
+ @Test
+ @RunAsClient
public void testWebServiceWsdlLocationTest() throws Exception
{
- deploy("jaxws-samples-webservice02-ejb3.jar");
+ deployer.deploy(WEBSERVICE_02);
try
{
webServiceWsdlLocationTest("jaxws-samples-webservice02-ejb3");
}
finally
{
- undeploy("jaxws-samples-webservice02-ejb3.jar");
+ deployer.undeploy(WEBSERVICE_02);
}
}
+ @Test
+ @RunAsClient
public void testWebServiceEndpointInterfaceTest() throws Exception
{
- deploy("jaxws-samples-webservice03-ejb3.jar");
+ deployer.deploy(WEBSERVICE_03);
try
{
webServiceEndpointInterfaceTest("jaxws-samples-webservice03-ejb3");
}
finally
{
- undeploy("jaxws-samples-webservice03-ejb3.jar");
+ deployer.undeploy(WEBSERVICE_03);
}
}
-}
+ }
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceJSETestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceJSETestCase.java 2014-12-30 16:26:29 UTC (rev 19299)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservice/WebServiceJSETestCase.java 2014-12-30 23:56:07 UTC (rev 19300)
@@ -22,8 +22,18 @@
package org.jboss.test.ws.jaxws.samples.webservice;
import java.io.File;
+import java.net.URL;
-import junit.framework.Test;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.jboss.arquillian.container.test.api.Deployer;
+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.wsf.test.JBossWSTestHelper;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -35,75 +45,93 @@
* @author <a href="jason.greene(a)jboss.com">Jason T. Greene</a>
* @since 29-Apr-2005
*/
+(a)RunWith(Arquillian.class)
public class WebServiceJSETestCase extends WebServiceBase
{
- static {
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-webservice03-jse.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.EndpointInterface03.class)
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.JSEBean03.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF03/web.xml"));
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-webservice02-jse.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.JSEBean02.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF02/wsdl/TestService.wsdl"), "wsdl/TestService.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF02/web.xml"));
- }
- });
- JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-samples-webservice01-jse.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservice.JSEBean01.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF01/web.xml"));
- }
- });
+ @ArquillianResource
+ Deployer deployer;
+
+ private static final String WEBSERVICE_03 = "jaxws-samples-webservice03-jse";
+
+ @Deployment(name = WEBSERVICE_03, testable = false, managed = false)
+ public static WebArchive createClientDeployment3() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webservice03-jse.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.EndpointInterface03.class)
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.JSEBean03.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF03/web.xml"));
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceJSETestCase.class, "");
+ private static final String WEBSERVICE_02 = "jaxws-samples-webservice02-jse";
+
+ @Deployment(name = WEBSERVICE_02, testable = false, managed = false)
+ public static WebArchive createClientDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webservice02-jse.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.JSEBean02.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF02/wsdl/TestService.wsdl"), "wsdl/TestService.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF02/web.xml"));
+ return archive;
}
+ private static final String WEBSERVICE_01 = "jaxws-samples-webservice01-jse";
+
+ @Deployment(name = WEBSERVICE_01, testable = false, managed = false)
+ public static WebArchive createClientDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webservice01-jse.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservice.JSEBean01.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservice/WEB-INF01/web.xml"));
+ return archive;
+ }
+
+ @Test
+ @RunAsClient
public void testWebServiceTest() throws Exception
{
- deploy("jaxws-samples-webservice01-jse.war");
+ deployer.deploy(WEBSERVICE_01);
try
{
webServiceTest("jaxws-samples-webservice01-jse");
}
finally
{
- undeploy("jaxws-samples-webservice01-jse.war");
+ deployer.undeploy(WEBSERVICE_01);
}
}
+ @Test
+ @RunAsClient
public void testWebServiceWsdlLocation() throws Exception
{
- deploy("jaxws-samples-webservice02-jse.war");
+ deployer.deploy(WEBSERVICE_02);
try
{
webServiceWsdlLocationTest("jaxws-samples-webservice02-jse");
}
finally
{
- undeploy("jaxws-samples-webservice02-jse.war");
+ deployer.undeploy(WEBSERVICE_02);
}
}
+ @Test
+ @RunAsClient
public void testWebServiceEndpointInterface() throws Exception
{
- deploy("jaxws-samples-webservice03-jse.war");
+ deployer.deploy(WEBSERVICE_03);
try
{
webServiceEndpointInterfaceTest("jaxws-samples-webservice03-jse");
}
finally
{
- undeploy("jaxws-samples-webservice03-jse.war");
+ deployer.undeploy(WEBSERVICE_03);
}
}
+
}
9 years, 11 months
JBossWS SVN: r19299 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2527.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-30 11:26:29 -0500 (Tue, 30 Dec 2014)
New Revision: 19299
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2527/JBWS2527TestCase.java
Log:
arquillian migration jbws2527 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2527/JBWS2527TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2527/JBWS2527TestCase.java 2014-12-30 16:16:02 UTC (rev 19298)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2527/JBWS2527TestCase.java 2014-12-30 16:26:29 UTC (rev 19299)
@@ -26,7 +26,16 @@
import java.util.LinkedList;
import java.util.List;
-import junit.framework.Test;
+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.arquillian.container.test.api.Deployer;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -39,25 +48,32 @@
*
* @author richard.opalka(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class JBWS2527TestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2527-service.war") { {
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(name="jaxws-jbws2527-service", managed=false, testable = false)
+ public static WebArchive createClientDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2527-service.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws2527.Hello.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2527.HelloImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws2527.HelloService.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/jboss-web.xml"), "jboss-web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/web.xml"), "web.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/web.xml"));
+ return archive;
+ }
+
+ @Deployment(name="jaxws-jbws2527-client", managed=false, testable = false)
+ public static WebArchive createClientDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2527-client.war");
archive
.addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws2527.Hello.class)
- .addClass(org.jboss.test.ws.jaxws.jbws2527.HelloImpl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws2527.HelloService.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/jboss-web.xml"), "jboss-web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/web.xml"), "web.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-service/web.xml"));
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2527-client.war") { {
- archive
- .addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2527.ClientServlet.class)
.addClass(org.jboss.test.ws.jaxws.jbws2527.Hello.class)
.addClass(org.jboss.test.ws.jaxws.jbws2527.HelloService.class)
@@ -65,20 +81,11 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-client/web.xml"), "web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-client/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2527/WEB-INF-client/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
- }
-
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS2527TestCase.class, "", true);
- }
+ @Test
+ @RunAsClient
public void test() throws Exception
{
for (int i = 0; i < 2; i++)
@@ -92,15 +99,14 @@
{
try
{
- deploy("jaxws-jbws2527-service.war");
- deploy("jaxws-jbws2527-client.war");
-
+ deployer.deploy("jaxws-jbws2527-service");
+ deployer.deploy("jaxws-jbws2527-client");
assertEquals("true", IOUtils.readAndCloseStream(new URL("http://" + getServerHost() + ":8080/jaxws-jbws2527-client/jbws2527").openStream()));
}
finally
{
- undeploy("jaxws-jbws2527-client.war");
- undeploy("jaxws-jbws2527-service.war");
+ deployer.undeploy("jaxws-jbws2527-client");
+ deployer.undeploy("jaxws-jbws2527-service");
}
}
}
9 years, 11 months
JBossWS SVN: r19298 - in stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2074: usecase2/client and 2 other directories.
by jbossws-commits@lists.jboss.org
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);
}
}
9 years, 11 months
JBossWS SVN: r19297 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-29 10:50:04 -0500 (Mon, 29 Dec 2014)
New Revision: 19297
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
Log:
arquillian migration jbws2307 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java 2014-12-29 14:56:57 UTC (rev 19296)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/DeploymentArchives.java 2014-12-29 15:50:04 UTC (rev 19297)
@@ -24,10 +24,15 @@
import java.io.File;
import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
public final class DeploymentArchives
{
- public static final String SERVER = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-jbws2307-service.war") { {
+ public static final String SERVER_DEPLOYMENT = "jaxws-jbws2307-service";
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, SERVER_DEPLOYMENT + ".war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2307.Hello.class)
@@ -36,10 +41,12 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-service/web.xml"), "web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-service/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-service/web.xml"));
- }
- });
-
- public static final String CLIENT_2 = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client-2.war") { {
+ return archive;
+ }
+
+ public static final String CLIENT_2_DEPLOYMENT = "jaxws-jbws2307-client-2";
+ public static WebArchive createDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, CLIENT_2_DEPLOYMENT + ".war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet2.class)
@@ -49,10 +56,12 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/web2.xml"), "web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/web2.xml"));
- }
- });
-
- public static final String CLIENT_3 = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client-3.war") { {
+ return archive;
+ }
+
+ public static final String CLIENT_3_DEPLOYMENT = "jaxws-jbws2307-client-3";
+ public static WebArchive createDeployment3() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, CLIENT_3_DEPLOYMENT + ".war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet3.class)
@@ -62,10 +71,12 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/web3.xml"), "web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/web3.xml"));
- }
- });
-
- public static final String CLIENT = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-jbws2307-client.war") { {
+ return archive;
+ }
+
+ public static final String CLIENT_DEPLOYMENT = "jaxws-jbws2307-client";
+ public static WebArchive createDeployment4() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws2307-client.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2307.ClientServlet.class)
@@ -75,9 +86,9 @@
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/web.xml"), "web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/wsdl/HelloService.wsdl"), "wsdl/HelloService.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws2307/WEB-INF-client/web.xml"));
- }
- });
-
+ return archive;
+ }
+
private DeploymentArchives() {
//NOOP
}
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java 2014-12-29 14:56:57 UTC (rev 19296)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/JBWS2307MTOMTestCase.java 2014-12-29 15:50:04 UTC (rev 19297)
@@ -26,8 +26,17 @@
import java.net.HttpURLConnection;
import java.net.URL;
-import junit.framework.Test;
+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.spec.WebArchive;
+import org.jboss.arquillian.container.test.api.Deployer;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -37,21 +46,36 @@
*
* @author alessio.soldano(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class JBWS2307MTOMTestCase extends JBossWSTest
{
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS2307MTOMTestCase.class, DeploymentArchives.SERVER + " " + DeploymentArchives.CLIENT, true);
+ @ArquillianResource
+ private URL baseURL;
+
+ @Deployment(name= DeploymentArchives.SERVER_DEPLOYMENT, order=1, testable = false)
+ public static WebArchive createClientDeployment() {
+ return DeploymentArchives.createDeployment();
}
-
+
+ @Deployment(name = DeploymentArchives.CLIENT_DEPLOYMENT, order=2, testable = false)
+ public static WebArchive createDeployment4() {
+ return DeploymentArchives.createDeployment4();
+ }
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(DeploymentArchives.CLIENT_DEPLOYMENT)
public void testMTOM() throws Exception
{
- assertEquals("true", IOUtils.readAndCloseStream(new URL("http://" + getServerHost() + ":8080/jaxws-jbws2307-client/jbws2307?mtom=true").openStream()));
+ assertEquals("true", IOUtils.readAndCloseStream(new URL("http://" + baseURL.getHost() + ":8080/jaxws-jbws2307-client/jbws2307?mtom=true").openStream()));
}
-
+
+ @Test
+ @RunAsClient
+ @OperateOnDeployment(DeploymentArchives.CLIENT_DEPLOYMENT)
public void testClient() throws Exception
{
- HttpURLConnection con = (HttpURLConnection)new URL("http://" + getServerHost() + ":8080/jaxws-jbws2307-client/jbws2307").openConnection();
+ HttpURLConnection con = (HttpURLConnection)new URL("http://" + baseURL.getHost() + ":8080/jaxws-jbws2307-client/jbws2307").openConnection();
BufferedReader isr = new BufferedReader(new InputStreamReader(con.getInputStream()));
assertEquals("true", isr.readLine());
}
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java 2014-12-29 14:56:57 UTC (rev 19296)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2307/WebServiceRefMTOMTestCase.java 2014-12-29 15:50:04 UTC (rev 19297)
@@ -26,7 +26,14 @@
import java.net.HttpURLConnection;
import java.net.URL;
-import junit.framework.Test;
+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.spec.WebArchive;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -38,32 +45,52 @@
*
* @author alessio.soldano(a)jboss.com
*/
+(a)RunWith(Arquillian.class)
public class WebServiceRefMTOMTestCase extends JBossWSTest
{
+ @ArquillianResource
+ private URL baseURL;
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceRefMTOMTestCase.class, DeploymentArchives.SERVER, true);
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(testable = false)
+ public static WebArchive createClientDeployment() {
+ return DeploymentArchives.createDeployment();
}
-
+
+ @Deployment(name = DeploymentArchives.CLIENT_3_DEPLOYMENT, testable = false, managed = false)
+ public static WebArchive createDeployment3() {
+ return DeploymentArchives.createDeployment3();
+ }
+
+ @Deployment(name = DeploymentArchives.CLIENT_2_DEPLOYMENT, testable = false, managed = false)
+ public static WebArchive createDeployment2() {
+ return DeploymentArchives.createDeployment2();
+ }
+
+ @Test
+ @RunAsClient
public void testUsingClientArchive3() throws Exception
{
try {
- JBossWSTestHelper.deploy(DeploymentArchives.CLIENT_3);
- assertEquals("true", IOUtils.readAndCloseStream(new URL("http://" + getServerHost() + ":8080/jaxws-jbws2307-client-3/jbws2307?mtom=true").openStream()));
- HttpURLConnection con = (HttpURLConnection)new URL("http://" + getServerHost() + ":8080/jaxws-jbws2307-client-3/jbws2307").openConnection();
+ deployer.deploy(DeploymentArchives.CLIENT_3_DEPLOYMENT);
+ assertEquals("true", IOUtils.readAndCloseStream(new URL("http://" + baseURL.getHost() + ":8080/jaxws-jbws2307-client-3/jbws2307?mtom=true").openStream()));
+ HttpURLConnection con = (HttpURLConnection)new URL("http://" + baseURL.getHost() + ":8080/jaxws-jbws2307-client-3/jbws2307").openConnection();
BufferedReader isr = new BufferedReader(new InputStreamReader(con.getInputStream()));
assertEquals("true", isr.readLine());
} finally {
- JBossWSTestHelper.undeploy(DeploymentArchives.CLIENT_3);
+ deployer.undeploy(DeploymentArchives.CLIENT_3_DEPLOYMENT);
}
}
-
+
+ @Test
+ @RunAsClient
public void testUsingClientArchive2() throws Exception
{
try {
- JBossWSTestHelper.deploy(DeploymentArchives.CLIENT_2);
- URL url = new URL("http://" + getServerHost() + ":8080/jaxws-jbws2307-client-2/jbws2307?mtom=true");
+ deployer.deploy(DeploymentArchives.CLIENT_2_DEPLOYMENT);
+ URL url = new URL("http://" + baseURL.getHost() + ":8080/jaxws-jbws2307-client-2/jbws2307?mtom=true");
final HttpURLConnection c = (HttpURLConnection)url.openConnection();
c.connect();
assertEquals(500, c.getResponseCode());
@@ -71,7 +98,7 @@
c.disconnect();
assertTrue(error.contains("Could not instantiate ClientServlet2"));
} finally {
- JBossWSTestHelper.undeploy(DeploymentArchives.CLIENT_2);
+ deployer.undeploy(DeploymentArchives.CLIENT_2_DEPLOYMENT);
}
}
}
9 years, 11 months
JBossWS SVN: r19296 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-29 09:56:57 -0500 (Mon, 29 Dec 2014)
New Revision: 19296
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
Log:
arquillian migration jbws1666 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2014-12-28 22:59:59 UTC (rev 19295)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1666/JBWS1666TestCase.java 2014-12-29 14:56:57 UTC (rev 19296)
@@ -30,7 +30,19 @@
import javax.xml.ws.spi.Provider;
-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.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSTest;
@@ -46,51 +58,58 @@
* @author alessio.soldano(a)jboss.com
* @since 14-Jun-2007
*/
+(a)RunWith(Arquillian.class)
public class JBWS1666TestCase extends JBossWSTest
{
private static final String FS = System.getProperty("file.separator"); // '/' on unix, '\' on windows
java.util.Properties props = System.getProperties();
-
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws1666.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1666.TestEndpointImpl.class)
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1666/WEB-INF/web.xml"));
- }
- });
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-jbws1666-client.jar") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Main-Class: org.jboss.test.ws.jaxws.jbws1666.TestClient\n"
- + "Dependencies: javax.jws.api,javax.xml.ws.api\n"))
- .addClass(org.jboss.test.ws.jaxws.jbws1666.TestClient.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1666.TestEndpoint.class);
- }
- });
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-jbws1666-b-client.jar") { {
- archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Main-Class: org.jboss.test.ws.jaxws.jbws1666.TestClient\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.jbws1666.TestClient.class)
- .addClass(org.jboss.test.ws.jaxws.jbws1666.TestEndpoint.class);
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+
+ @Deployment(name="jaxws-jbws1666", testable = false)
+ public static WebArchive createClientDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws1666.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws1666.TestEndpointImpl.class)
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1666/WEB-INF/web.xml"));
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
+
+ @Deployment(name = "jaxws-jbws1666-client", testable = false, managed=false)
+ public static JavaArchive createClientDeployment1() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1666-client.jar");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Main-Class: org.jboss.test.ws.jaxws.jbws1666.TestClient\n"
+ + "Dependencies: javax.jws.api,javax.xml.ws.api\n"))
+ .addClass(org.jboss.test.ws.jaxws.jbws1666.TestClient.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1666.TestEndpoint.class);
+ writeToDisk(archive);
+ return archive;
}
- public static Test suite()
+ @Deployment(name = "jaxws-jbws1666-b-client", testable = false, managed = false)
+ public static JavaArchive createClientDeployment2() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-jbws1666-b-client.jar");
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Main-Class: org.jboss.test.ws.jaxws.jbws1666.TestClient\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.jbws1666.TestClient.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1666.TestEndpoint.class);
+ writeToDisk(archive);
+ return archive;
+ }
+
+ public static void writeToDisk(JavaArchive archive)
{
- return new JBossWSTestSetup(JBWS1666TestCase.class, "jaxws-jbws1666.war");
+ File file = new File(JBossWSTestHelper.getTestArchiveDir(), archive.getName());
+ archive.as(ZipExporter.class).exportTo(file, true);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws1666")
public void testClientInTestsuiteJVM() throws Exception
{
String resStr = TestClient.testPortAccess(getServerHost());
9 years, 11 months
JBossWS SVN: r19295 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1582.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-28 17:59:59 -0500 (Sun, 28 Dec 2014)
New Revision: 19295
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1582/JBWS1582TestCase.java
Log:
arquillian migration jbws1582 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1582/JBWS1582TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1582/JBWS1582TestCase.java 2014-12-28 22:35:19 UTC (rev 19294)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1582/JBWS1582TestCase.java 2014-12-28 22:59:59 UTC (rev 19295)
@@ -36,7 +36,18 @@
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
-import junit.framework.Test;
+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.exporter.ZipExporter;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+import org.jboss.arquillian.container.test.api.Deployer;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -49,45 +60,47 @@
*
* @author <a href="mailto:richard.opalka@jboss.org">Richard Opalka</a>
*/
+(a)RunWith(Arquillian.class)
public class JBWS1582TestCase extends JBossWSTest
{
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws1582-attacked.war") { {
+ @ArquillianResource
+ private URL baseURL;
+
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(name="jaxws-jbws1582-attacked", testable = false, managed=false)
+ public static WebArchive createDeployment() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws1582-attacked.war");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws1582.AttackedEndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws1582.Endpoint.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1582/WEB-INF/wsdl/attack-service.wsdl"), "wsdl/attack-service.wsdl")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1582/WEB-INF/attack-web.xml"));
+ return archive;
+ }
+
+ @Deployment(name="jaxws-jbws1582", testable = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws1582.war");
archive
.addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1582.AttackedEndpointImpl.class)
.addClass(org.jboss.test.ws.jaxws.jbws1582.Endpoint.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1582/WEB-INF/wsdl/attack-service.wsdl"), "wsdl/attack-service.wsdl")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1582/WEB-INF/attack-web.xml"));
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws1582.war") { {
- archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws1582.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.jbws1582.EndpointImpl.class)
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1582/WEB-INF/wsdl/service.wsdl"), "wsdl/service.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1582/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
-
- static {
- JBossWSTestHelper.writeToFile(createDeployments());
- }
- private String endpointURL = "http://" + getServerHost() + ":8080/jaxws-jbws1582/TestService";
private String targetNS = "http://jbws1582.jaxws.ws.test.jboss.org/";
- public static Test suite()
- {
- return new JBossWSTestSetup(JBWS1582TestCase.class, "jaxws-jbws1582.war");
- }
-
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws1582")
public void testLegalAccess() throws Exception
{
+ String endpointURL = "http://" + baseURL.getHost() + ":8080/jaxws-jbws1582/TestService";
URL wsdlURL = new URL(endpointURL + "?wsdl");
QName serviceName = new QName(targetNS, "EndpointService");
@@ -98,6 +111,9 @@
assertEquals("Hello", retObj);
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws1582")
public void testSOAPMessage() throws Exception
{
String response = getResponse("jaxws/jbws1582/message.xml");
@@ -105,6 +121,9 @@
assertTrue(response.contains("<return>Hello</return>"));
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws1582")
public void testSOAPMessageAttack1() throws Exception
{
String response = getResponse("jaxws/jbws1582/attack-message-1.xml");
@@ -119,6 +138,9 @@
}
}
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-jbws1582")
public void testSOAPMessageAttack2() throws Exception
{
String response = getResponse("jaxws/jbws1582/attack-message-2.xml");
@@ -158,11 +180,14 @@
return response;
}
+
+ @Test
+ @RunAsClient
public void testAttackedArchiveDeployment() throws Exception
{
try
{
- deploy("jaxws-jbws1582-attacked.war");
+ deployer.deploy("jaxws-jbws1582-attacked");
if (isIntegrationCXF())
{
// Apache CXF ignores DOCTYPE section in WSDLs
@@ -181,7 +206,7 @@
}
finally
{
- undeploy("jaxws-jbws1582-attacked.war");
+ deployer.undeploy("jaxws-jbws1582-attacked");
}
}
9 years, 11 months
JBossWS SVN: r19294 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-12-28 17:35:19 -0500 (Sun, 28 Dec 2014)
New Revision: 19294
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
Log:
arquillian migration webservicerefsec test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2014-12-28 22:21:02 UTC (rev 19293)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2014-12-28 22:35:19 UTC (rev 19294)
@@ -26,7 +26,17 @@
import java.util.LinkedList;
import java.util.List;
-import junit.framework.Test;
+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.arquillian.container.test.api.OperateOnDeployment;
import org.jboss.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
@@ -40,40 +50,41 @@
* @author alessio.soldano(a)jboss.com
* @since 12-May-2010
*/
+(a)RunWith(Arquillian.class)
public class WebServiceRefSecTestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-webservicerefsec";
+ @ArquillianResource
+ private URL baseURL;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-webservicerefsec.jar") { {
+ @Deployment(name="jaxws-samples-webservicerefsec", order=1, testable = false)
+ public static JavaArchive createDeployment() {
+ JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-webservicerefsec.jar");
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.EndpointImpl.class);
+ return archive;
+ }
+
+ @Deployment(name="jaxws-samples-webservicerefsec-servlet-client", order=2, testable = false)
+ public static WebArchive createDeployment1() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-samples-webservicerefsec-servlet-client.war");
archive
.addManifest()
- .addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.EndpointImpl.class);
- }
- });
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-samples-webservicerefsec-servlet-client.war") { {
- archive
- .addManifest()
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.Client.class)
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.samples.webservicerefsec.EndpointService.class)
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml"), "jboss-web.xml")
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl"), "wsdl/Endpoint.wsdl")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/webservicerefsec/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceRefSecTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()), true);
- }
-
+ @Test
+ @RunAsClient
+ @OperateOnDeployment("jaxws-samples-webservicerefsec-servlet-client")
public void testServletClient() throws Exception
{
- URL url = new URL(TARGET_ENDPOINT_ADDRESS + "-servlet-client?echo=HelloWorld");
+ URL url = new URL("http://" + baseURL.getHost() + ":8080/jaxws-samples-webservicerefsec-servlet-client?echo=HelloWorld");
assertEquals("HelloWorld", IOUtils.readAndCloseStream(url.openStream()));
}
}
9 years, 11 months