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

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Tue Dec 23 11:51:49 EST 2014


Author: rsearls
Date: 2014-12-23 11:51:49 -0500 (Tue, 23 Dec 2014)
New Revision: 19230

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

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jaxbintros/JAXBIntroTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jaxbintros/JAXBIntroTestCase.java	2014-12-23 16:35:19 UTC (rev 19229)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/samples/jaxbintros/JAXBIntroTestCase.java	2014-12-23 16:51:49 UTC (rev 19230)
@@ -30,7 +30,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.ws.common.DOMUtils;
 import org.jboss.wsf.test.JBossWSTest;
@@ -47,32 +55,29 @@
  *
  * @author alessio.soldano at jboss.com
  */
+ at RunWith(Arquillian.class)
 public class JAXBIntroTestCase extends JBossWSTest
 {
-   private final String endpointAddress = "http://" + getServerHost() + ":8080/jaxws-samples-jaxbintros/EndpointService";
+   @ArquillianResource
+   private URL baseURL;
 
-   public static BaseDeployment<?>[] createDeployments() {
-      List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
-      list.add(new JBossWSTestHelper.JarDeployment("jaxws-samples-jaxbintros.jar") { {
+   @Deployment(testable = false)
+   public static JavaArchive createDeployments() {
+      JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "jaxws-samples-jaxbintros.jar");
          archive
                .addManifest()
                .addClass(org.jboss.test.ws.jaxws.samples.jaxbintros.Endpoint.class)
                .addClass(org.jboss.test.ws.jaxws.samples.jaxbintros.EndpointBean.class)
                .addClass(org.jboss.test.ws.jaxws.samples.jaxbintros.UserType.class)
                .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/samples/jaxbintros/META-INF/jaxb-intros.xml"), "jaxb-intros.xml");
-         }
-      });
-      return list.toArray(new BaseDeployment<?>[list.size()]);
+      return archive;
    }
 
-   public static Test suite()
-   {
-      return new JBossWSTestSetup(JAXBIntroTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
-   }
-
+   @Test
+   @RunAsClient
    public void testWSDLAccess() throws Exception
    {
-      URL wsdlURL = new URL(endpointAddress + "?wsdl");
+      URL wsdlURL = new URL(baseURL + "/jaxws-samples-jaxbintros/EndpointService?wsdl");
       Element wsdl = DOMUtils.parse(wsdlURL.openStream());
       assertNotNull(wsdl);
       Iterator<Element> it = DOMUtils.getChildElements(wsdl, new QName("http://www.w3.org/2001/XMLSchema","attribute"), true);
@@ -93,9 +98,11 @@
     *
     * @throws Exception
     */
+   @Test
+   @RunAsClient
    public void testAnnotatedUserEndpoint() throws Exception
    {
-      URL wsdlURL = new URL(endpointAddress + "?wsdl");
+      URL wsdlURL = new URL(baseURL + "/jaxws-samples-jaxbintros/EndpointService?wsdl");
       QName serviceName = new QName("http://org.jboss.ws/samples/jaxbintros", "EndpointBeanService");
 
       Service service = Service.create(wsdlURL, serviceName);



More information about the jbossws-commits mailing list