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

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Dec 23 12:25:31 EST 2014


Author: rsearls
Date: 2014-12-23 12:25:31 -0500 (Tue, 23 Dec 2014)
New Revision: 19231

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

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java	2014-12-23 16:51:49 UTC (rev 19230)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/swaref/SWARefTestCase.java	2014-12-23 17:25:31 UTC (rev 19231)
@@ -29,7 +29,15 @@
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
 
-import junit.framework.Test;
+import org.junit.runner.RunWith;
+import org.junit.Test;
+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.wsf.test.CleanupOperation;
 import org.jboss.wsf.test.JBossWSTest;
@@ -42,21 +50,21 @@
  *
  * @author Heiko.Braun at jboss.com
  */
+ at RunWith(Arquillian.class)
 public class SWARefTestCase extends JBossWSTest
 {
-   private String bareEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/BareEndpointService/BareEndpoint";
-   private String wrappedEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/WrappedEndpointService/WrappedEndpoint";
-   private String rpclitEndpointURL = "http://" + getServerHost() + ":8080/jaxws-swaref/RpcLitEndpointService/RpcLitEndpoint";
-
    private QName bareServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "BareEndpointService");
    private QName wrappedServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "WrappedEndpointService");
    private QName rpcLitServiceQName = new QName("http://swaref.samples.jaxws.ws.test.jboss.org/", "RpcLitEndpointService");
 
    private static DataHandler data;
 
-   public static BaseDeployment<?>[] createDeployments() {
-      List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
-      list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-swaref.jar") { {
+   @ArquillianResource
+   private URL baseURL;
+
+   @Deployment(testable = false)
+   public static JavaArchive createDeployments() {
+      JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-swaref.jar");
          archive
                .addManifest()
                .addClass(org.jboss.test.ws.jaxws.samples.swaref.BareEndpoint.class)
@@ -72,47 +80,42 @@
                .addClass(org.jboss.test.ws.jaxws.samples.swaref.jaxws.BeanAnnotationResponse.class)
                .addClass(org.jboss.test.ws.jaxws.samples.swaref.jaxws.ParameterAnnotation.class)
                .addClass(org.jboss.test.ws.jaxws.samples.swaref.jaxws.ParameterAnnotationResponse.class);
-         }
-      });
-      return list.toArray(new BaseDeployment<?>[list.size()]);
+      return archive;
    }
 
-   public static Test suite()
-   {
-      return new JBossWSTestSetup(SWARefTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()), new CleanupOperation() {
-         @Override
-         public void cleanUp() {
-            data = null;
-         }
-      });
-   }
-   
    protected void setUp() throws Exception {
-      if (data == null) {
-         data = new DataHandler("Client data", "text/plain");
-      }
+      data = new DataHandler("Client data", "text/plain");
    }
 
+   @Test
+   @RunAsClient
    public void testBeanAnnotationWithBare() throws Exception
    {
-      Service service = Service.create(new URL(bareEndpointURL +"?wsdl"), bareServiceQName);
+      setUp();
+      Service service = Service.create(new URL(baseURL + "/jaxws-swaref/BareEndpointService/BareEndpoint?wsdl"), bareServiceQName);
       BareEndpoint port = service.getPort(BareEndpoint.class);
       DocumentPayload response = port.beanAnnotation(new DocumentPayload(data));
       assertTrue(response.getData().getContent().equals("Server data"));
    }
 
+   @Test
+   @RunAsClient
    public void testBeanAnnotationWithWrapped() throws Exception
    {
-      Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+      setUp();
+      Service service = Service.create(new URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"), wrappedServiceQName);
       WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
 
       DocumentPayload response = port.beanAnnotation(new DocumentPayload(data), "Wrapped test");
       assertTrue(response.getData().getContent().equals("Server data"));
    }
 
+   @Test
+   @RunAsClient
    public void testParameterAnnotationWithWrapped() throws Exception
    {
-      Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+      setUp();
+      Service service = Service.create(new URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"), wrappedServiceQName);
       WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
 
       DataHandler response = port.parameterAnnotation(new DocumentPayload(data), "Wrapped test", data);
@@ -120,9 +123,12 @@
       assertTrue("Contents are not equal", response.getContent().equals("Server data"));
    }
 
+   @Test
+   @RunAsClient
    public void testBeanAnnotationWithRPC() throws Exception
    {
-      Service service = Service.create(new URL(rpclitEndpointURL+"?wsdl"), rpcLitServiceQName);
+      setUp();
+      Service service = Service.create(new URL(baseURL+"/jaxws-swaref/RpcLitEndpointService/RpcLitEndpoint?wsdl"), rpcLitServiceQName);
       RpcLitEndpoint port = service.getPort(RpcLitEndpoint.class);
 
       DocumentPayload response = port.beanAnnotation( new DocumentPayload(data));
@@ -130,10 +136,13 @@
       assertTrue(response.getData().getContent().equals("Server data"));
    }
 
+   @Test
+   @RunAsClient
    public void testListAnnotationWithWrapped() throws Exception
    {
+      setUp();
       //[JBWS-2708]
-      Service service = Service.create(new URL(wrappedEndpointURL+"?wsdl"), wrappedServiceQName);
+      Service service = Service.create(new URL(baseURL+"/jaxws-swaref/WrappedEndpointService/WrappedEndpoint?wsdl"), wrappedServiceQName);
       WrappedEndpoint port = service.getPort(WrappedEndpoint.class);
       DocumentPayloadWithList payload = new DocumentPayloadWithList();
       payload.getData().add(data);



More information about the jbossws-commits mailing list