Package com.google.api.ads.adwords.awreporting.proxy

Examples of com.google.api.ads.adwords.awreporting.proxy.JaxWsProxySelector.select()


  @Test
  public void testSelect_Direct() {
    JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault());
    ProxySelector.setDefault(ps);

    List<Proxy> list = ps.select(testUri);
    assertEquals(list.get(0), Proxy.NO_PROXY);
  }

  /**
   * Tests select(URI) HTTP
View Full Code Here


    System.getProperties().put(HTTP_PROXY_PORT, "8888");

    JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault());
    ProxySelector.setDefault(ps);

    List<Proxy> list = ps.select(testUri);

    assertEquals(list.get(0),
        new Proxy(Type.HTTP, new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 8888)));

    System.getProperties().remove(HTTP_PROXY_HOST);
View Full Code Here

    System.getProperties().put(HTTPS_PROXY_PORT, "8888");

    JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault());
    ProxySelector.setDefault(ps);

    List<Proxy> list = ps.select(testUri);
    assertEquals(list.get(0),
        new Proxy(Type.HTTP, new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 8888)));

    System.getProperties().remove(HTTPS_PROXY_HOST);
    System.getProperties().remove(HTTPS_PROXY_PORT);
View Full Code Here

    System.getProperties().put(FTP_PROXY_PORT, "8888");

    JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault());
    ProxySelector.setDefault(ps);

    List<Proxy> list = ps.select(testUri);
    assertEquals(list.get(0),
        new Proxy(Type.HTTP, new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 8888)));

    System.getProperties().remove(FTP_PROXY_HOST);
    System.getProperties().remove(FTP_PROXY_PORT);
View Full Code Here

    System.getProperties().put(SOCKS_PROXY_PORT, "8888");

    JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault());
    ProxySelector.setDefault(ps);

    List<Proxy> list = ps.select(testUri);
    assertEquals(list.get(0),
        new Proxy(Type.SOCKS, new InetSocketAddress(InetAddress.getByName("127.0.0.1"), 8888)));

    System.getProperties().remove(SOCKS_PROXY_HOST);
    System.getProperties().remove(SOCKS_PROXY_PORT);
View Full Code Here

   * Tests select(URI) IllegalArgumentException
   */
  @Test(expected = IllegalArgumentException.class)
  public void testSelect_IllegalArgumentException() {
    JaxWsProxySelector ps = new JaxWsProxySelector(ProxySelector.getDefault());
    ps.select(null);
  }

  /**
   * Tests the connectFailed(URI, SocketAddress, IOException)
   */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.