You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/08/12 18:08:11 UTC

svn commit: r984846 - in /cxf/branches/2.2.x-fixes: ./ systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java

Author: dkulp
Date: Thu Aug 12 16:08:10 2010
New Revision: 984846

URL: http://svn.apache.org/viewvc?rev=984846&view=rev
Log:
Merged revisions 984845 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r984845 | dkulp | 2010-08-12 12:06:48 -0400 (Thu, 12 Aug 2010) | 1 line
  
  [CXF-2384] Add another test that tests a port open, but no service there
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java?rev=984846&r1=984845&r2=984846&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/dispatch/DispatchClientServerTest.java Thu Aug 12 16:08:10 2010
@@ -168,7 +168,45 @@ public class DispatchClientServerTest ex
         }
         
     }
+    @Test
+    public void test404() throws Exception {
+        //CXF-2384
+        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
+        assertNotNull(wsdl);
 
+        //pick one of the other service/ports that would have an address
+        //without a service running
+        QName otherServiceName = new QName("http://apache.org/hello_world_soap_http",
+                "SOAPProviderService");
+        QName otherPortName = new QName("http://apache.org/hello_world_soap_http", "SoapProviderPort");
+        
+        
+        SOAPService service = new SOAPService(wsdl, otherServiceName);
+        assertNotNull(service);
+
+        Dispatch<SOAPMessage> disp = service
+            .createDispatch(otherPortName, SOAPMessage.class, Service.Mode.MESSAGE);
+        disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+                                     "http://localhost:" 
+                                     + greeterPort
+                                     + "/SomePlaceWithNoServiceRunning/SoapDispatchPort");
+        
+        InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
+        SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
+        assertNotNull(soapReqMsg);
+        
+        try {
+            disp.invoke(soapReqMsg);
+            fail("Should have faulted");
+        } catch (SOAPFaultException ex) {
+            fail("should not be a SOAPFaultException");
+        } catch (WebServiceException ex) {
+            //expected
+            assertTrue(ex.getCause().getClass().getName(),
+                       ex.getCause() instanceof java.io.IOException);
+        }
+        
+    }
     @Test
     public void testSOAPMessage() throws Exception {