Author: veithen Date: Sun Aug 14 11:07:55 2011 New Revision: 1157517 URL: http://svn.apache.org/viewvc?rev=1157517&view=rev Log: Added a test case providing evidence for the issue described in AXIS2-5062.
Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatchTests.java Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatchTests.java URL: http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatchTests.java?rev=1157517&r1=1157516&r2=1157517&view=diff ============================================================================== --- axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatchTests.java (original) +++ axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/dispatch/SOAPMessageDispatchTests.java Sun Aug 14 11:07:55 2011 @@ -180,4 +180,25 @@ public class SOAPMessageDispatchTests ex response.writeTo(System.out); } + /** + * Tests that HTTP connections are properly released if {@link Dispatch#invokeOneWay(Object)} is + * used to invoke a service that actually uses the in-out MEP. This is a regression test for + * AXIS2-5062. + * + * @throws Exception + */ + public void _testConnectionReleaseForInvokeOneWayWithMEPMismatch() throws Exception { + Service svc = Service.create(serviceName); + svc.addPort(portName, null, url); + Dispatch<SOAPMessage> dispatch = svc.createDispatch(portName, + SOAPMessage.class, Service.Mode.MESSAGE); + MessageFactory factory = MessageFactory.newInstance(); + SOAPMessage message = factory.createMessage(); + message.getSOAPBody().addBodyElement(new QName("urn:test", "test")); + // If HTTP connections are not properly released, then this will end up with a + // ConnectionPoolTimeoutException. + for (int i=0; i<200; i++) { + dispatch.invokeOneWay(message); + } + } }