Package net.sf.jproxyloader.config

Examples of net.sf.jproxyloader.config.ProxyConfig


    // given
    CustomProxySelector customProxySelector = new CustomProxySelector(defaultProxySelectorMock, config);

    when(config.hasProxyConfigForHost("my.proxified.host.com")).thenReturn(true);
    when(config.getProxyConfigForHost("my.proxified.host.com")).thenReturn(
      new ProxyConfig("proxyhost", "1030", "http",
        new HashSet(asList("my.proxified.host.com"))));

    when(config.hasProxyConfigForHost("my.proxified.host2.com")).thenReturn(true);
    when(config.getProxyConfigForHost("my.proxified.host2.com")).thenReturn(
      new ProxyConfig("proxyhost2", "1040",
        "socks",
        new HashSet(asList("my.proxified.host2.com"))));

    // when
    List<Proxy> proxiesForProxifiedHost = customProxySelector.select(URI.create("some://my.proxified.host.com:5040"));
View Full Code Here


    }

  }

  private List<Proxy> getCustomProxyFor(URI uri) {
    ProxyConfig proxyConfig = config.getProxyConfigForHost(uri.getHost());
    return asList(proxyConfig.toJavaProxy());
  }
View Full Code Here

        String proxyHostname = trim(properties.getProperty(hostnameProperty));
        String proxyPort = trim(properties.getProperty(portProperty));
        String proxyType = trim(properties.getProperty(typeProperty));
        Set<String> proxyProxifiedHosts = parseProxifiedHosts(properties.getProperty(proxifiedHostsProperty));

        validProxies.add(new ProxyConfig(proxyHostname, proxyPort, proxyType, proxyProxifiedHosts));
      }
    }

    getLogger().debug(getClass().getSimpleName() + " - discovered following valid proxies: " + validProxies);
View Full Code Here

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(2));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(customProxies, hasItem(new ProxyConfig("192.168.1.200", "7070", "socks", EMPTY_SET)));

  }
View Full Code Here

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(1));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(logger.getLogBuffer(),
      containsString("Missing system property defining port for custom proxy: myProxy2"));

  }
View Full Code Here

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(1));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(logger.getLogBuffer(),
      containsString("Missing system property defining type for custom proxy: myProxy2"));

  }
View Full Code Here

    List<ProxyConfig> customProxies = systemPropertiesConfig.getCustomProxies();

    // then
    assertThat(customProxies, notNullValue());
    assertThat(customProxies.size(), equalTo(1));
    assertThat(customProxies, hasItem(new ProxyConfig("www.myhost1.com", "8080", "http", EMPTY_SET)));
    assertThat(logger.getLogBuffer(),
      containsString("Missing system property defining hostname for custom proxy: myProxy2"));

  }
View Full Code Here

TOP

Related Classes of net.sf.jproxyloader.config.ProxyConfig

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.