From a4fb61b98bec0b2ef52afbe248f21b0195781dbf Mon Sep 17 00:00:00 2001 From: Markus Keller Date: Thu, 13 Oct 2016 17:46:49 +0200 Subject: Bug 505906: UnixProxyProvider's support for no_proxy environment variable is non-standard Change-Id: I501d19073526f796d05892f2557ed63f4f59cf4a Signed-off-by: Markus Keller --- .../src/org/eclipse/core/tests/net/NetTest.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'tests') diff --git a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java index 5a68028cc..6ae0f1daa 100644 --- a/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java +++ b/tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java @@ -338,6 +338,35 @@ public class NetTest extends TestCase { this.getProxyManager().setNonProxiedHosts(oldHosts); } + public void testHostPatternBug505906() throws CoreException { + setDataTest(IProxyData.HTTP_PROXY_TYPE); + setDataTest(IProxyData.HTTPS_PROXY_TYPE); + setDataTest(IProxyData.SOCKS_PROXY_TYPE); + + String[] oldHosts = this.getProxyManager().getNonProxiedHosts(); + this.getProxyManager().setNonProxiedHosts(new String[] { "ignore.com" }); + + IProxyData[] allData = this.getProxyManager().getProxyDataForHost("ignore.com.randomhot.com"); + assertEquals(3, allData.length); + + IProxyData data = this.getProxyManager().getProxyDataForHost("ignore.com.randomhot.com", IProxyData.HTTP_PROXY_TYPE); + assertNotNull(data); + + allData = this.getProxyManager().getProxyDataForHost("www.ignore.com"); + assertEquals(0, allData.length); + + data = this.getProxyManager().getProxyDataForHost("www.ignore.com", IProxyData.HTTP_PROXY_TYPE); + assertNull(data); + + allData = this.getProxyManager().getProxyDataForHost("ignore.com"); + assertEquals(0, allData.length); + + data = this.getProxyManager().getProxyDataForHost("ignore.com", IProxyData.HTTP_PROXY_TYPE); + assertNull(data); + + this.getProxyManager().setNonProxiedHosts(oldHosts); + } + public void testBug238796() throws CoreException { setDataTest(IProxyData.HTTP_PROXY_TYPE); setDataTest(IProxyData.HTTPS_PROXY_TYPE); -- cgit v1.2.3