JBossWS SVN: r19304 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2015-01-01 16:56:28 -0500 (Thu, 01 Jan 2015)
New Revision: 19304
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java
Log:
arquillian migration jbws3282 test
Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java 2014-12-31 03:10:28 UTC (rev 19303)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java 2015-01-01 21:56:28 UTC (rev 19304)
@@ -22,6 +22,7 @@
package org.jboss.test.ws.jaxws.jbws3282;
import java.io.File;
+import java.lang.System;
import java.net.URL;
import java.util.LinkedList;
import java.util.List;
@@ -29,9 +30,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.Deployer;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.container.test.api.OperateOnDeployment;
+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.ws.common.IOUtils;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -47,51 +57,54 @@
* @author alessio.soldano(a)jboss.com
* @since 03-Oct-2014
*/
+(a)RunWith(Arquillian.class)
public class HandlerChainTestCaseForked extends JBossWSTest
{
private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
-
- public static BaseDeployment<?>[] createDeployments() {
+ private static final String INCONTAINER_CLIENT = "jaxws-jbws3832-f-inContainer-client";
+ private static final String DEP = "jaxws-jbws3282-f";
+
+ @ArquillianResource
+ Deployer deployer;
+
+ @Deployment(name = INCONTAINER_CLIENT, testable = false)
+ public static WebArchive createDeployments() {
List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3832-f-inContainer-client.war") { {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, INCONTAINER_CLIENT + ".war");
archive
- .setManifest(new StringAsset("Manifest-Version: 1.0\n"
- + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Helper.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.TestUtils.class)
- .addClass(org.jboss.test.helper.ClientHelper.class)
- .addClass(org.jboss.test.helper.TestServlet.class)
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/META-INF/permissions.xml"), "permissions.xml");
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Helper.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.TestUtils.class)
+ .addClass(org.jboss.test.helper.ClientHelper.class)
+ .addClass(org.jboss.test.helper.TestServlet.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/META-INF/permissions.xml"), "permissions.xml");
+ return archive;
}
-
- private static String DEP = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-jbws3282-f.war") { {
+
+ @Deployment(name = DEP, testable = false, managed = false)
+ public static WebArchive createDeployment2() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class, DEP + ".war");
archive
- .addManifest()
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointHandler.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint3Impl.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.LogHandler.class)
- .addClass(org.jboss.test.ws.jaxws.jbws3282.RoutingHandler.class)
- .addAsResource("org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/web-f.xml"));
- }
- });
-
- public static Test suite()
- {
- return new JBossWSTestSetup(HandlerChainTestCaseForked.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint3Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.LogHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.RoutingHandler.class)
+ .addAsResource("org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/web-f.xml"));
+ return archive;
}
- public void testHandlerChainVanillaServer() throws Exception
+ @Test
+ @RunAsClient
+ public void testHandlerChainVanillaServer() throws Exception
{
try {
- JBossWSTestHelper.deploy(DEP);
-
+ deployer.deploy(DEP);
QName serviceName = new QName(targetNS, "Endpoint2ImplService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282-f/ep2?wsdl");
Service service = Service.create(wsdlURL, serviceName);
@@ -106,17 +119,18 @@
resStr = port.echo("Kermit");
assertEquals("Kermit|EpIn|endpoint3|EpOut", resStr);
} finally {
- JBossWSTestHelper.undeploy(DEP);
+ deployer.undeploy(DEP);
}
}
+ @Test
+ @RunAsClient
public void testHandlerChainModifiedServer() throws Exception
{
try {
assertEquals("1", runTestInContainer("setupConfigurations"));
try {
- JBossWSTestHelper.deploy(DEP);
-
+ deployer.deploy(DEP);
QName serviceName = new QName(targetNS, "Endpoint2ImplService");
URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282-f/ep2?wsdl");
Service service = Service.create(wsdlURL, serviceName);
@@ -131,7 +145,7 @@
resStr = port.echo("Kermit");
assertEquals("Kermit|LogIn|EpIn|endpoint3|EpOut|LogOut", resStr);
} finally {
- JBossWSTestHelper.undeploy(DEP);
+ deployer.undeploy(DEP);
}
} finally {
assertEquals("1", runTestInContainer("restoreConfigurations"));
@@ -142,9 +156,10 @@
private String runTestInContainer(String test) throws Exception
{
+
URL url = new URL("http://" + getServerHost()
- + ":8080/jaxws-jbws3832-f-inContainer-client?path=/jaxws-jbws3282-f&method=" + test
- + "&helper=" + Helper.class.getName());
+ + ":8080/jaxws-jbws3832-f-inContainer-client?path=/jaxws-jbws3282-f&method=" + test
+ + "&helper=" + Helper.class.getName());
return IOUtils.readAndCloseStream(url.openStream());
}
}
9 years, 11 months