@Test public void proxyAutodetect() throws Exception { profile.setProxyPreferences(new Proxy().setAutodetect(true)); List<String> prefLines = readGeneratedProperties(profile); String prefs = new ArrayList<String>(prefLines).toString(); assertThat(prefs, containsString("network.proxy.type\", 4")); }
@Test public void proxyAutoconfigUrl() throws Exception { profile.setProxyPreferences(new Proxy().setProxyAutoconfigUrl("http://foo/bar.pac")); List<String> prefLines = readGeneratedProperties(profile); String prefs = new ArrayList<String>(prefLines).toString(); assertThat(prefs, containsString("network.proxy.autoconfig_url\", \"http://foo/bar.pac\"")); assertThat(prefs, containsString("network.proxy.type\", 2")); }
@Test public void manualProxy() throws Exception { profile.setProxyPreferences( new Proxy() .setHttpProxy("foo:123") .setFtpProxy("bar:234") .setSslProxy("baz:345") .setNoProxy("localhost")); List<String> prefLines = readGeneratedProperties(profile); String prefs = new ArrayList<String>(prefLines).toString(); assertThat(prefs, containsString("network.proxy.http\", \"foo\"")); assertThat(prefs, containsString("network.proxy.http_port\", 123")); assertThat(prefs, containsString("network.proxy.ftp\", \"bar\"")); assertThat(prefs, containsString("network.proxy.ftp_port\", 234")); assertThat(prefs, containsString("network.proxy.ssl\", \"baz\"")); assertThat(prefs, containsString("network.proxy.ssl_port\", 345")); assertThat(prefs, containsString("network.proxy.no_proxies_on\", \"localhost\"")); assertThat(prefs, containsString("network.proxy.type\", 1")); }