@Test
public void test_maxThreadsPropertyOverrides() throws Exception
{
final String expected_mtc = "100";
final String expected_mcph = "50";
ConfigTree parent_config = new ConfigTree("parent");
parent_config.setAttribute(ListenerTagNames.MAX_THREADS_TAG, "1");
ConfigTree child_config = new ConfigTree("child", parent_config);
child_config.setAttribute("endpointUrl", "http://localhost"); // required attribute
ConfigTree mtc_config = new ConfigTree(HttpClientFactory.HTTP_CLIENT_PROPERTY, child_config);
mtc_config.setAttribute("name", Connection.MAX_TOTAL_CONNECTIONS);
mtc_config.setAttribute("value", expected_mtc);
ConfigTree mcph_config = new ConfigTree(HttpClientFactory.HTTP_CLIENT_PROPERTY, child_config);
mcph_config.setAttribute("name", Connection.MAX_CONNECTIONS_PER_HOST);
mcph_config.setAttribute("value", expected_mcph);
HttpSOAPProxyTransport transport = new HttpSOAPProxyTransport(child_config, null, null);
Properties httpClientProps = transport.getHttpRouter().getHttpClientProps();
final String actual_mtc = httpClientProps.getProperty(Connection.MAX_TOTAL_CONNECTIONS);
assertEquals(expected_mtc, actual_mtc);
final String actual_mcph = httpClientProps.getProperty(Connection.MAX_CONNECTIONS_PER_HOST);