Author: rsearls
Date: 2015-01-02 09:21:47 -0500 (Fri, 02 Jan 2015)
New Revision: 19306
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
Log:
arquillian migration jbws2978 test
Modified:
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java
===================================================================
---
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2015-01-02
14:19:22 UTC (rev 19305)
+++
stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2978/JBWS2978TestCase.java 2015-01-02
14:21:47 UTC (rev 19306)
@@ -35,7 +35,15 @@
import javax.xml.ws.Service;
import javax.xml.ws.soap.SOAPFaultException;
-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.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestHelper;
@@ -47,22 +55,14 @@
*
* @author <a href="ema(a)redhat.com">Jim Ma</a>
*/
+(a)RunWith(Arquillian.class)
public class JBWS2978TestCase extends JBossWSTest
{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() +
":8080/jaxws-jbws2978";
-
- private final String requestMessage = "<S:Envelope
xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Head...
xmlns='http://www.w3.org/2005/08/addressing'>"
- + TARGET_ENDPOINT_ADDRESS
- + "</To><Action
xmlns='http://www.w3.org/2005/08/addressing'>inputAction</A...
- + "<MessageID
xmlns='http://www.w3.org/2005/08/addressing'>uuid:56d586f8-980...
- + "<ReplyTo
xmlns='http://www.w3.org/2005/08/addressing'><Address>ht...
- + "</S:Header><S:Body><ns1:addNumbers
xmlns:ns1='http://ws.jboss.org'><arg0>10</arg0><arg1>10</arg1></ns1:addNumbers></S:Body></S:Envelope>";
-
public Service service = null;
- public static BaseDeployment<?>[] createDeployments() {
- List<BaseDeployment<?>> list = new
LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws2978.war") { {
+ @Deployment(testable = false)
+ public static WebArchive createDeployments() {
+ WebArchive archive = ShrinkWrap.create(WebArchive.class,
"jaxws-jbws2978.war");
archive
.addManifest()
.addClass(org.jboss.test.ws.jaxws.jbws2978.AddNumbers.class)
@@ -71,27 +71,31 @@
.addClass(org.jboss.test.ws.jaxws.jbws2978.AddNumbersResponse.class)
.addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2978/WEB-INF/jboss-web.xml"), "jboss-web.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() +
"/jaxws/jbws2978/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
+ return archive;
}
- public static Test suite() throws Exception
- {
- return new JBossWSTestSetup(JBWS2978TestCase.class,
JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
@Override
public void setUp() throws Exception
{
super.setUp();
- URL wsdlURL = new URL(TARGET_ENDPOINT_ADDRESS + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() +
":8080/jaxws-jbws2978" + "?wsdl");
QName serviceName = new QName("http://ws.jboss.org",
"AddNumbers");
service = Service.create(wsdlURL, serviceName);
}
+ @Test
+ @RunAsClient
public void testCall() throws Exception
{
+ setUp();
+ String text = "http://" + getServerHost() +
":8080/jaxws-jbws2978";
+ String requestMessage = "<S:Envelope
xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'><S:Head...
xmlns='http://www.w3.org/2005/08/addressing'>"
+ + text
+ + "</To><Action
xmlns='http://www.w3.org/2005/08/addressing'>inputAction</A...
+ + "<MessageID
xmlns='http://www.w3.org/2005/08/addressing'>uuid:56d586f8-980...
+ + "<ReplyTo
xmlns='http://www.w3.org/2005/08/addressing'><Address>ht...
+ + "</S:Header><S:Body><ns1:addNumbers
xmlns:ns1='http://ws.jboss.org'><arg0>10</arg0><arg1>10</arg1></ns1:addNumbers></S:Body></S:Envelope>";
+
try
{
Dispatch<SOAPMessage> dispatch = service.createDispatch(new
QName("http://ws.jboss.org", "AddNumbersPort"), SOAPMessage.class ,