diff options
author | Omair Majid <[email protected]> | 2013-09-24 13:42:31 -0400 |
---|---|---|
committer | Omair Majid <[email protected]> | 2013-09-24 13:42:31 -0400 |
commit | fcd5c4c69fc5ea84b04f309eb40e295eab921fd8 (patch) | |
tree | 3bed81f2b2be0c9b7ac4148605a22c0d75dc9c3d /tests/netx/unit/net/sourceforge | |
parent | 0b4378d462bf9e44afe71d8c87adf682dd116c50 (diff) |
PR1474: Can't get javaws to use SOCKS proxy
If there is a SOCKS proxy specified, use it for https, http,
and ftp protocols too (as a fallback).
'sameProxy' now affects the https, http and ftp protocols,
but not the socket protocol.
Diffstat (limited to 'tests/netx/unit/net/sourceforge')
-rw-r--r-- | tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java b/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java index d522772..bef9745 100644 --- a/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java +++ b/tests/netx/unit/net/sourceforge/jnlp/runtime/JNLPProxySelectorTest.java @@ -45,7 +45,6 @@ import java.net.InetAddress; import java.net.InetSocketAddress; import java.net.Proxy; import java.net.Proxy.Type; -import java.net.SocketAddress; import java.net.URI; import java.net.URISyntaxException; import java.net.UnknownHostException; @@ -116,9 +115,11 @@ public class JNLPProxySelectorTest { assertEquals(Proxy.NO_PROXY, result.get(0)); } + // TODO implement this + @Ignore("Implement this") @Test public void testLocalProxyBypassListIsIgnoredForNonLocal() { - + fail(); } @Test @@ -210,6 +211,23 @@ public class JNLPProxySelectorTest { } @Test + public void testHttpFallsBackToManualSocksProxy() throws URISyntaxException { + String SOCKS_HOST = "example.org"; + int SOCKS_PORT = 42; + + DeploymentConfiguration config = new DeploymentConfiguration(); + config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); + config.setProperty(DeploymentConfiguration.KEY_PROXY_SOCKS4_HOST, SOCKS_HOST); + config.setProperty(DeploymentConfiguration.KEY_PROXY_SOCKS4_PORT, String.valueOf(SOCKS_PORT)); + + JNLPProxySelector selector = new TestProxySelector(config); + List<Proxy> result = selector.select(new URI("http://example.org/")); + + assertEquals(1, result.size()); + assertEquals(new Proxy(Type.SOCKS, new InetSocketAddress(SOCKS_HOST, SOCKS_PORT)), result.get(0)); + } + + @Test public void testManualUnknownProtocolProxy() throws URISyntaxException { DeploymentConfiguration config = new DeploymentConfiguration(); config.setProperty(DeploymentConfiguration.KEY_PROXY_TYPE, String.valueOf(JNLPProxySelector.PROXY_TYPE_MANUAL)); @@ -239,11 +257,6 @@ public class JNLPProxySelectorTest { assertEquals(1, result.size()); assertEquals(new Proxy(Type.HTTP, new InetSocketAddress(HTTP_HOST, HTTP_PORT)), result.get(0)); - - result = selector.select(new URI("socket://example.org/")); - - assertEquals(1, result.size()); - assertEquals(new Proxy(Type.SOCKS, new InetSocketAddress(HTTP_HOST, HTTP_PORT)), result.get(0)); } @Test |