use of com.helger.network.proxy.settings.ProxySettings in project ph-web by phax.
the class ProxyAutoConfigHelperTest method testExplicit.
@Test
public void testExplicit() throws ScriptException {
assertEquals(new ProxySettings(Proxy.Type.HTTP, "1.2.3.4", 8080), _getResolved("return 'PROXY 1.2.3.4:8080';"));
assertEquals(ProxySettings.createNoProxySettings(), _getResolved("return isInNetEx('127.0.0.1', '127.0.0.0/16') ? 'DIRECT' : 'PROXY 1.2.3.4:8080';"));
assertEquals(ProxySettings.createNoProxySettings(), _getResolved("return isInNetEx('127.0.0.1', '127.0.0.0/24') ? 'DIRECT' : 'PROXY 1.2.3.4:8080';"));
assertEquals(ProxySettings.createNoProxySettings(), _getResolved("return isInNetEx('127.0.1.0', '127.0.0.0/24') ? 'PROXY 1.2.3.4:8080' : 'DIRECT';"));
}
Aggregations