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

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Wed Dec 24 14:44:28 EST 2014


Author: rsearls
Date: 2014-12-24 14:44:28 -0500 (Wed, 24 Dec 2014)
New Revision: 19248

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

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java	2014-12-24 19:37:19 UTC (rev 19247)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws1357/JBWS1357TestCase.java	2014-12-24 19:44:28 UTC (rev 19248)
@@ -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.IOUtils;
 import org.jboss.wsf.test.JBossWSTest;
@@ -43,29 +51,26 @@
  * 
  * @author <a href="jason.greene at jboss.com">Jason T. Greene</a>
  */
+ at RunWith(Arquillian.class)
 public class JBWS1357TestCase extends JBossWSTest
 {
    private String targetNS = "http://jbws1357.jaxws.ws.test.jboss.org/";
    private JBWS1357 proxy;
 
-   public static BaseDeployment<?>[] createDeployments() {
-      List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
-      list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws1357.war") { {
+   @ArquillianResource
+   private URL baseURL;
+
+   @Deployment(testable = false)
+   public static WebArchive createDeployments() {
+      WebArchive archive = ShrinkWrap.create(WebArchive.class, "jaxws-jbws1357.war");
          archive
                .addManifest()
                .addAsWebResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1357/hello.jsp"))
                .addClass(org.jboss.test.ws.jaxws.jbws1357.JBWS1357.class)
                .addClass(org.jboss.test.ws.jaxws.jbws1357.JBWS1357Impl.class)
                .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws1357/WEB-INF/web.xml"));
-         }
-      });
-      return list.toArray(new BaseDeployment<?>[list.size()]);
+      return archive;
    }
-   
-   public static Test suite()
-   {
-      return new JBossWSTestSetup(JBWS1357TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
-   }
 
    @Override
    protected void setUp() throws Exception
@@ -73,20 +78,25 @@
       super.setUp();
 
       QName serviceName = new QName(targetNS, "JBWS1357Service");
-      URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1357/JBWS1357Service?wsdl");
+      URL wsdlURL = new URL(baseURL + "/JBWS1357Service?wsdl");
 
       Service service = Service.create(wsdlURL, serviceName);
       proxy = (JBWS1357)service.getPort(JBWS1357.class);
    }
 
+   @Test
+   @RunAsClient
    public void testEcho() throws Exception
    {
+      setUp();
       assertEquals("hi there", proxy.echo("hi there"));
    }
 
+   @Test
+   @RunAsClient
    public void testJSP() throws Exception
    {
-      URL jsp = new URL("http://" + getServerHost() + ":8080/jaxws-jbws1357/hello.jsp");
+      URL jsp = new URL(baseURL + "/hello.jsp");
       HttpURLConnection conn = (HttpURLConnection) jsp.openConnection();
       assertEquals(conn.getResponseCode(), 200);
       IOUtils.readAndCloseStream(conn.getInputStream());



More information about the jbossws-commits mailing list