Code example for ProxySelector

Methods: select

0
        System.clearProperty("proxyHost");
        System.clearProperty("proxyPort");
        // RoboVM note: socksProxyHost and socksProxyPort must be cleared too 
        System.clearProperty("socksProxyHost");
        System.clearProperty("socksProxyPort");
    } 
 
    public void testNoProxySystemProperty() throws URISyntaxException { 
        assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(ftpUri));
        assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(httpUri));
        assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(httpsUri));
        assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(socketUri));
        assertEquals(Arrays.asList(Proxy.NO_PROXY), proxySelector.select(otherUri));
    } 
 
    public void testProxyHostOnly() throws URISyntaxException { 
        System.setProperty("ftp.proxyHost", "a");
        System.setProperty("http.proxyHost", "b");
        System.setProperty("https.proxyHost", "c");
        System.setProperty("other.proxyHost", "d");
        System.setProperty("socket.proxyHost", "d");