[jbossws-commits] JBossWS SVN: r19244 - stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/webfault.

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Dec 24 14:12:05 EST 2014


Author: rsearls
Date: 2014-12-24 14:12:05 -0500 (Wed, 24 Dec 2014)
New Revision: 19244

Modified:
   stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/webfault/WebFaultTestCase.java
Log:
arquillian migration webfault test

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/webfault/WebFaultTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/webfault/WebFaultTestCase.java	2014-12-24 19:01:22 UTC (rev 19243)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/webfault/WebFaultTestCase.java	2014-12-24 19:12:05 UTC (rev 19244)
@@ -30,7 +30,15 @@
 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.ws.common.DOMUtils;
 import org.jboss.wsf.test.JBossWSTest;
@@ -47,14 +55,17 @@
  * @author alessio.soldano at jboss.org
  * @since 21-Feb-2008
  */
+ at RunWith(Arquillian.class)
 public class WebFaultTestCase extends JBossWSTest
 {
-   private String endpointURL = "http://" + getServerHost() + ":8080/jaxws-webfault";
    private static final String TARGET_NS = "http://webfault.jaxws.ws.test.jboss.org/";
 
-   public static BaseDeployment<?>[] createDeployments() {
-      List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
-      list.add(new JBossWSTestHelper.WarDeployment("jaxws-webfault.war") { {
+   @ArquillianResource
+   private URL baseURL;
+
+   @Deployment(testable = false)
+   public static WebArchive createDeployments() {
+      WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-webfault.war");
          archive
                .addManifest()
                .addClass(org.jboss.test.ws.jaxws.webfault.CustomException.class)
@@ -62,16 +73,9 @@
                .addClass(org.jboss.test.ws.jaxws.webfault.EndpointImpl.class)
                .addClass(org.jboss.test.ws.jaxws.webfault.SimpleException.class)
                .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/webfault/WEB-INF/web.xml"));
-         }
-      });
-      return list.toArray(new BaseDeployment<?>[list.size()]);
+      return archive;
    }
 
-   public static Test suite()
-   {
-      return new JBossWSTestSetup(WebFaultTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
-   }
-   
    /**
     * Tests whether the @WebFault annotation correctly sets the fault element's name and namespace
     * (the type doesn't depend on @WebFault, see [JBWS-1904] about this)
@@ -80,6 +84,8 @@
     * 
     * @throws Exception
     */
+   @Test
+   @RunAsClient
    public void testWebFaultElement() throws Exception
    {
       if (isIntegrationCXF())
@@ -88,7 +94,7 @@
          return;
       }
       
-      Document doc = DOMUtils.getDocumentBuilder().parse(new URL(endpointURL + "?wsdl").toString());
+      Document doc = DOMUtils.getDocumentBuilder().parse(new URL(baseURL + "/jaxws-webfault?wsdl").toString());
       NodeList schemas = ((Element)doc.getDocumentElement()
          .getElementsByTagNameNS("http://schemas.xmlsoap.org/wsdl/", "types").item(0))
             .getElementsByTagNameNS("http://www.w3.org/2001/XMLSchema", "schema");
@@ -160,10 +166,12 @@
       assertTrue(firstElementFound && secondElementFound);
       assertTrue(firstTypeFound && secondTypeFound);
    }
-   
+
+   @Test
+   @RunAsClient
    public void testInvocation() throws Exception
    {
-      URL wsdlURL = new URL(endpointURL + "?wsdl");
+      URL wsdlURL = new URL(baseURL + "/jaxws-webfault?wsdl");
       QName serviceName = new QName(TARGET_NS, "EndpointService");
 
       Service service = Service.create(wsdlURL, serviceName);



More information about the jbossws-commits mailing list