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

jbossws-commits at lists.jboss.org jbossws-commits at lists.jboss.org
Fri Jan 9 02:28:51 EST 2015


Author: jim.ma
Date: 2015-01-09 02:28:51 -0500 (Fri, 09 Jan 2015)
New Revision: 19351

Modified:
   stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
   stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
Log:
Fix EndpointTestCase

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java	2015-01-08 20:33:47 UTC (rev 19350)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointServlet.java	2015-01-09 07:28:51 UTC (rev 19351)
@@ -56,6 +56,7 @@
 {
    private Endpoint endpoint1;
    private Endpoint endpoint2;
+   private String hostName;
    private static final String TEST_ELEMENT = "<fabrikam:CustomerKey xmlns:fabrikam='http://example.com/fabrikam'>123456789</fabrikam:CustomerKey>";
    
    @Override
@@ -64,7 +65,7 @@
       super.init(config);
       
       endpoint1 = Endpoint.create(SOAPBinding.SOAP11HTTP_BINDING, new EndpointBean());
-      String hostName = System.getProperty("jboss.bind.address", "localhost");
+      hostName = System.getProperty("jboss.bind.address", "localhost");
       hostName = hostName.indexOf(":") != -1 ? "[" + hostName + "]" : hostName;
       endpoint1.publish("http://" + hostName + ":8081/jaxws-endpoint");
       endpoint2 = Endpoint.publish("http://" + hostName + ":8081/jaxws-endpoint2/endpoint/long/path", new EndpointBean());
@@ -82,8 +83,6 @@
    protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    {
       // Create the port
-      String hostName = System.getProperty("jboss.bind.address", "localhost");
-      hostName = hostName.indexOf(":") != -1 ? "[" + hostName + "]" : hostName;
 //    URL wsdlURL = getServletContext().getResource("/WEB-INF/wsdl/TestService.wsdl");
       URL wsdlURL = new URL("http://" + hostName + ":8081/jaxws-endpoint?wsdl");
       QName qname = new QName("http://org.jboss.ws/jaxws/endpoint", "EndpointService");
@@ -114,10 +113,13 @@
       assert("http://www.w3.org/2005/08/addressing".equals(endpointReference.getAttribute("xmlns")));
       NodeList addresses = endpointReference.getElementsByTagName("Address");
       assert(addresses.getLength() == 1);
-      assert("http://127.0.0.1:8080/jaxws-endpoint".equals(addresses.item(0).getFirstChild().getNodeValue()));
+      assert(("http://" + hostName + ":8081/jaxws-endpoint").equals(addresses.item(0).getFirstChild().getNodeValue()));
       if (refPar != null)
       {
-         assert(epr.toString().contains(refPar));
+    	 Element refEle = DOMUtils.parse(refPar, builder);
+    	 NodeList nodeList = endpointReference.getElementsByTagNameNS(refEle.getNamespaceURI(), refEle.getLocalName());
+    	 assert(nodeList.getLength() == 1);
+    	 assert(refEle.getTextContent().equals(nodeList.item(0).getTextContent()));   	 
       }
    }
    

Modified: stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java
===================================================================
--- stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java	2015-01-08 20:33:47 UTC (rev 19350)
+++ stack/cxf/branches/arquillian/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/endpoint/EndpointTestCase.java	2015-01-09 07:28:51 UTC (rev 19351)
@@ -65,6 +65,7 @@
                .addClass(org.jboss.test.ws.jaxws.endpoint.EndpointServlet.class)
                .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/endpoint/WEB-INF/wsdl/TestService.wsdl"), "wsdl/TestService.wsdl")
                .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/endpoint/WEB-INF/web.xml"));
+      JBossWSTestHelper.writeToFile(archive);
       return archive;
    }
 
@@ -112,7 +113,7 @@
    @OperateOnDeployment("jaxws-endpoint-servlet")
    public void testServletAccess() throws Exception
    {
-      URL url = new URL("http://" + baseURL.getHost() + ":8080/jaxws-endpoint-servlet?param=hello-world");
+      URL url = new URL("http://" + baseURL.getHost() + ":" + baseURL.getPort() + "/jaxws-endpoint-servlet/?param=hello-world");
       assertEquals("hello-world", IOUtils.readAndCloseStream(url.openStream()));
    }
 



More information about the jbossws-commits mailing list