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

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Sat Dec 27 21:06:24 EST 2014


Author: rsearls
Date: 2014-12-27 21:06:24 -0500 (Sat, 27 Dec 2014)
New Revision: 19285

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

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java	2014-12-28 01:15:57 UTC (rev 19284)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3477/JaxWsSpiProviderTestCase.java	2014-12-28 02:06:24 UTC (rev 19285)
@@ -28,7 +28,18 @@
 import java.util.LinkedList;
 import java.util.List;
 
-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.arquillian.container.test.api.OperateOnDeployment;
 
 import org.jboss.ws.common.IOUtils;
 import org.jboss.wsf.test.JBossWSTest;
@@ -42,44 +53,48 @@
  * @author alessio.soldano at jboss.com
  * @since 02-Apr-2012
  */
+ at RunWith(Arquillian.class)
 public class JaxWsSpiProviderTestCase extends JBossWSTest
 {
-   private String defaultProvider; 
-   
-   public static BaseDeployment<?>[] createDeployments() {
-      List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
-      list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3477-custom-provider.war") { {
+   private String defaultProvider;
+
+   @ArquillianResource
+   private URL baseURL;
+
+   @Deployment(name="jaxws-jbws3477-custom-provider", order=1, testable = false)
+   public static WebArchive createDeployment1() {
+      WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws3477-custom-provider.war");
+      archive
+         .addManifest()
+         .addAsManifestResource(new File(getTestResourcesDir() + "/jaxws/jbws3477/META-INF/services/javax.xml.ws.spi.Provider"), "services/javax.xml.ws.spi.Provider")
+         .addClass(org.jboss.test.ws.jaxws.jbws3477.DummyProvider.class)
+         .addClass(org.jboss.test.ws.jaxws.jbws3477.Helper.class)
+         .addClass(org.jboss.test.ws.jaxws.jbws3477.TestServlet.class);
+      return archive;
+   }
+
+   @Deployment(name="jaxws-jbws3477", order=2, testable = false)
+   public static WebArchive createDeployment2() {
+      WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws3477.war");
          archive
                .addManifest()
-               .addAsManifestResource(new File(getTestResourcesDir() + "/jaxws/jbws3477/META-INF/services/javax.xml.ws.spi.Provider"), "services/javax.xml.ws.spi.Provider")
-               .addClass(org.jboss.test.ws.jaxws.jbws3477.DummyProvider.class)
                .addClass(org.jboss.test.ws.jaxws.jbws3477.Helper.class)
                .addClass(org.jboss.test.ws.jaxws.jbws3477.TestServlet.class);
-         }
-      });
-      list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3477.war") { {
-         archive
-               .addManifest()
-               .addClass(org.jboss.test.ws.jaxws.jbws3477.Helper.class)
-               .addClass(org.jboss.test.ws.jaxws.jbws3477.TestServlet.class);
-         }
-      });
-      return list.toArray(new BaseDeployment<?>[list.size()]);
+      return archive;
    }
-   
-   public static Test suite()
-   {
-      return new JBossWSTestSetup(JaxWsSpiProviderTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
-   }
-   
+
    protected void setUp() {
       if (isIntegrationCXF()) {
          defaultProvider = "org.jboss.wsf.stack.cxf.client.ProviderImpl";
       }
    }
-   
+
+   @Test
+   @RunAsClient
+   @OperateOnDeployment("jaxws-jbws3477")
    public void testClientSide()
    {
+      setUp();
       Helper.verifyJaxWsSpiProvider(defaultProvider);
    }
 
@@ -88,9 +103,13 @@
     * 
     * @throws Exception
     */
+   @Test
+   @RunAsClient
+   @OperateOnDeployment("jaxws-jbws3477")
    public void testServerSideDefaultProvider() throws Exception
    {
-      runServerTest(new URL("http://" + getServerHost() + ":8080/jaxws-jbws3477?provider=" + defaultProvider));
+      setUp();
+      runServerTest(new URL(baseURL + "?provider=" + defaultProvider));
    }
    
    /**
@@ -98,9 +117,13 @@
     * 
     * @throws Exception
     */
+   @Test
+   @RunAsClient
+   @OperateOnDeployment("jaxws-jbws3477-custom-provider")
    public void testServerSideProviderCustomization() throws Exception
    {
-      runServerTest(new URL("http://" + getServerHost() + ":8080/jaxws-jbws3477-custom-provider?provider=org.jboss.test.ws.jaxws.jbws3477.DummyProvider"));
+      setUp();
+      runServerTest(new URL(baseURL + "?provider=org.jboss.test.ws.jaxws.jbws3477.DummyProvider"));
    }
    
    private static void runServerTest(URL url) throws Exception {



More information about the jbossws-commits mailing list