Hi Freeman, I don't understand the logic below - why is it only setting the timeouts if they are equal to a certain value?
Colm. On Thu, Jun 13, 2019 at 8:25 PM <[email protected]> wrote: > > + private void propagateJaxwsSpecTimeoutSettings(Message message, > HTTPClientPolicy csPolicy) { > + int receiveTimeout = determineReceiveTimeout(message, csPolicy); > + if (csPolicy.getReceiveTimeout() == 60000) { > + csPolicy.setReceiveTimeout(receiveTimeout); > + } > + int connectionTimeout = determineConnectionTimeout(message, > csPolicy); > + if (csPolicy.getConnectionTimeout() == 30000) { > + csPolicy.setConnectionTimeout(connectionTimeout); > + } > + } > > + > > protected OutputStream createOutputStream(Message message, > boolean needToCacheRequest, > diff --git > a/rt/transports/http-hc/src/test/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitTest.java > b/rt/transports/http-hc/src/test/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitTest.java > index ed20f7b..9ed69af 100644 > --- > a/rt/transports/http-hc/src/test/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitTest.java > +++ > b/rt/transports/http-hc/src/test/java/org/apache/cxf/transport/http/asyncclient/AsyncHTTPConduitTest.java > @@ -154,6 +154,21 @@ public class AsyncHTTPConduitTest extends > AbstractBusClientServerTestBase { > //expected!!! > } > } > + > + > + @Test > + public void testTimeoutWithPropertySetting() throws Exception { > + ((javax.xml.ws > .BindingProvider)g).getRequestContext().put("javax.xml.ws.client.receiveTimeout", > + "3000"); > + updateAddressPort(g, PORT); > + > + try { > + assertEquals("Hello " + request, g.greetMeLater(-5000)); > + fail(); > + } catch (Exception ex) { > + //expected!!! > + } > + } > > @Test > public void testTimeoutAsync() throws Exception { > @@ -168,6 +183,21 @@ public class AsyncHTTPConduitTest extends > AbstractBusClientServerTestBase { > //expected!!! > } > } > + > + @Test > + public void testTimeoutAsyncWithPropertySetting() throws Exception { > + updateAddressPort(g, PORT); > + ((javax.xml.ws > .BindingProvider)g).getRequestContext().put("javax.xml.ws.client.receiveTimeout", > + "3000"); > + try { > + Response<GreetMeLaterResponse> future = > g.greetMeLaterAsync(-5000L); > + future.get(); > + fail(); > + } catch (Exception ex) { > + //expected!!! > + } > + } > + > @Test > public void testConnectIssue() throws Exception { > updateAddressPort(g, PORT_INV); > > -- Colm O hEigeartaigh Talend Community Coder http://coders.talend.com
