cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <>
Subject [GitHub] joel-shemtov commented on issue #345: When failing to close conduit, distinct read faults from write faults
Date Thu, 01 Jan 1970 00:00:00 GMT
joel-shemtov commented on issue #345: When failing to close conduit, distinct read faults from
write faults
   Hi Sergey, I checked and found that there actually is a method called testTimeout() in
_org.apache.cxf.systest.dispatch.DispatchClientServerTest_. However I'm not sure if it really
tests timeout.  
   This is the current code on master
       public void testTimeout() throws Exception {
           URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
           //pick one of the other service/ports that would have an address
           //without a service running
           QName otherServiceName = new QName("",
           QName otherPortName = new QName("", "SoapProviderPort");
           SOAPService service = new SOAPService(wsdl, otherServiceName);
           Dispatch<SOAPMessage> disp = service
               .createDispatch(otherPortName, SOAPMessage.class, Service.Mode.MESSAGE);
                                        + TestUtil.getPortNumber("fake-port")
                                        + "/SOAPDispatchService/SoapDispatchPort");
           DispatchImpl<?> dispImpl = (DispatchImpl<?>)disp;
           HTTPConduit cond = (HTTPConduit)dispImpl.getClient().getConduit();
           InputStream is = getClass().getResourceAsStream("resources/GreetMeDocLiteralReq.xml");
           SOAPMessage soapReqMsg = MessageFactory.newInstance().createMessage(null, is);
           try {
               fail("Should have faulted");
           } catch (SOAPFaultException ex) {
               fail("should not be a SOAPFaultException");
           } catch (WebServiceException ex) {
                          ex.getCause() instanceof
                          || ex.getCause() instanceof;
   To me it seems that the usage of "fake-port", guarantees that only ConnectionException
gets caught. SocketTimeoutException is never actually thrown.
   As far as I understand, these are two different scenarios. Shouldn't they be in two separate
tests? As you suggested I'll try to run it locally. When I have it modified and tried, I'll
open a new pull request.

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

With regards,
Apache Git Services

View raw message