*/
@Test
public void testConnectionReleaseWith404() throws Exception {
// Create a Jetty server instance without any contexts. It will always return HTTP 404.
Server server = new Server();
SocketListener listener = new SocketListener();
server.addListener(listener);
server.start();
try {
ConfigurationContext configurationContext =
ConfigurationContextFactory.createConfigurationContextFromURIs(
CommonsHTTPTransportSenderTest.class.getResource("axis2.xml"), null);
ServiceClient serviceClient = new ServiceClient(configurationContext, null);
Options options = serviceClient.getOptions();
options.setTo(new EndpointReference("http://localhost:" + listener.getPort() + "/nonexisting"));
OMElement request = OMAbstractFactory.getOMFactory().createOMElement(new QName("urn:test", "test"));
// If connections are not properly released then we will end up with a
// ConnectionPoolTimeoutException here.
for (int i=0; i<200; i++) {
try {