Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java')
-rw-r--r--tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java29
1 files changed, 29 insertions, 0 deletions
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);

Back to the top