Package com.googlecode.jmeter.plugins.webdriver.proxy

Examples of com.googlecode.jmeter.plugins.webdriver.proxy.ProxyHostPort


                return proxyFactory.getDirectProxy();
            case AUTO_DETECT:
                return proxyFactory.getAutodetectProxy();
            case MANUAL:
                if(isUseHttpSettingsForAllProtocols()) {
                    ProxyHostPort proxy = new ProxyHostPort(getHttpHost(), getHttpPort());
                    return proxyFactory.getManualProxy(proxy, proxy, proxy, proxy, getNoProxyHost());
                }
                ProxyHostPort http = new ProxyHostPort(getHttpHost(), getHttpPort());
                ProxyHostPort https = new ProxyHostPort(getHttpsHost(), getHttpsPort());
                ProxyHostPort ftp = new ProxyHostPort(getFtpHost(), getFtpPort());
                ProxyHostPort socks = new ProxyHostPort(getSocksHost(), getSocksPort());
                return proxyFactory.getManualProxy(http, https, ftp, socks, getNoProxyHost());
            default:
                return proxyFactory.getSystemProxy();
        }
    }
View Full Code Here


        verify(proxyFactory, times(1)).getAutodetectProxy();
    }

    @Test
    public void shouldDelegateToProxyFactoryWhenCreatingManualProxyWithAllValuesSpecified() {
        final ProxyHostPort http = new ProxyHostPort("http", 1);
        final ProxyHostPort https = new ProxyHostPort("https", 2);
        final ProxyHostPort ftp = new ProxyHostPort("ftp", 3);
        final ProxyHostPort socks = new ProxyHostPort("socks", 4);
        final String noProxy = "host1, host2";
        config.setHttpHost(http.getHost());
        config.setHttpPort(http.getPort());
        config.setUseHttpSettingsForAllProtocols(false);
        config.setHttpsHost(https.getHost());
        config.setHttpsPort(https.getPort());
        config.setFtpHost(ftp.getHost());
        config.setFtpPort(ftp.getPort());
        config.setSocksHost(socks.getHost());
        config.setSocksPort(socks.getPort());
        config.setNoProxyHost(noProxy);
        when(proxyFactory.getManualProxy(http, https, ftp, socks, noProxy)).thenReturn(new Proxy());
        config.setProxyType(ProxyType.MANUAL);

        Proxy proxy = config.createProxy();
View Full Code Here

        verify(proxyFactory, times(1)).getManualProxy(http, https, ftp, socks, noProxy);
    }

    @Test
    public void shouldDelegateToProxyFactoryWhenCreatingManualProxyWithHttpAsDefault() {
        final ProxyHostPort http = new ProxyHostPort("http", 1);
        final String noProxy = "host1, host2";
        config.setHttpHost(http.getHost());
        config.setHttpPort(http.getPort());
        config.setUseHttpSettingsForAllProtocols(true);
        config.setNoProxyHost(noProxy);
        when(proxyFactory.getManualProxy(http, http, http, http, noProxy)).thenReturn(new Proxy());
        config.setProxyType(ProxyType.MANUAL);
View Full Code Here

TOP

Related Classes of com.googlecode.jmeter.plugins.webdriver.proxy.ProxyHostPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.