@Test
public void testHttpProxyDefined() throws HttpException {

    System.setProperty("http.proxyHost", "httpProxy");
    System.setProperty("http.proxyPort", "9090");
    assertEquals("httpProxy:9090", ProxyAddressSelector.getProxyForUrl("http://www.jahia.com"));
    assertNull(ProxyAddressSelector.getProxyForUrl("https://www.jahia.com"));
    assertEquals("httpProxy:9090", ProxyAddressSelector.getProxyForUrl("http://localhost:8080"));
    assertNull(ProxyAddressSelector.getProxyForUrl("https://localhost:8080"));
    assertEquals("httpProxy:9090", ProxyAddressSelector.getProxyForUrl("www.jahia.com:9090"));
    assertEquals("httpProxy:9090", ProxyAddressSelector.getProxyForUrl("localhost:9090"));
    assertEquals("httpProxy:9090",
            ProxyAddressSelector.getProxyForUrl("localhost:9090/aaa/bb/test.jsp?a=aaa&b=bbb"));
    assertNull(ProxyAddressSelector.getProxyForUrl("/aaa.html"));
    System.setProperty("http.proxyPort", "");
    assertEquals("httpProxy:80", ProxyAddressSelector.getProxyForUrl("http://www.jahia.com"));
}