diff options
author | Pawel Pogorzelski | 2010-04-19 10:20:55 +0000 |
---|---|---|
committer | Pawel Pogorzelski | 2010-04-19 10:20:55 +0000 |
commit | 10e2008e3c6558b5b8bc65a4811ac3d1a36bf78d (patch) | |
tree | 5cc53d2a35b602b41bcdace184195e45bae2b584 /tests/org.eclipse.core.tests.net | |
parent | 6f34b2818c198a550bc2bb302654eb9800ce38dd (diff) | |
download | eclipse.platform.team-10e2008e3c6558b5b8bc65a4811ac3d1a36bf78d.tar.gz eclipse.platform.team-10e2008e3c6558b5b8bc65a4811ac3d1a36bf78d.tar.xz eclipse.platform.team-10e2008e3c6558b5b8bc65a4811ac3d1a36bf78d.zip |
Bug 284540 - [Net] Changing nonProxiedHosts does not update the system properties
Diffstat (limited to 'tests/org.eclipse.core.tests.net')
-rw-r--r-- | tests/org.eclipse.core.tests.net/src/org/eclipse/core/tests/net/NetTest.java | 27 |
1 files changed, 26 insertions, 1 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 0928feaec..ad926b78b 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -401,6 +401,31 @@ public class NetTest extends TestCase { } + public void testNonProxyHosts() throws CoreException { + setDataTest(IProxyData.HTTP_PROXY_TYPE); + setDataTest(IProxyData.HTTPS_PROXY_TYPE); + setDataTest(IProxyData.SOCKS_PROXY_TYPE); + + String[] oldHosts = this.getProxyManager().getNonProxiedHosts(); + + // add new host to the nonProxiedHosts list + String testHost = "bug284540.com"; + ArrayList hostsList = new ArrayList(); + Collections.addAll(hostsList, oldHosts); + hostsList.add(testHost); + String[] newHosts = (String[]) hostsList.toArray(new String[] {}); + + this.getProxyManager().setNonProxiedHosts(newHosts); + + // check if system properties are updated + String sysPropNonProxyHosts = System.getProperty("http.nonProxyHosts"); + String assertMessage = "http.nonProxyHost should contain '" + testHost + + "', but its current value is '" + sysPropNonProxyHosts + "'"; + assertTrue(assertMessage, sysPropNonProxyHosts.contains(testHost)); + + this.getProxyManager().setNonProxiedHosts(oldHosts); + } + private void validateSystemProperties(boolean present) { validateProperty("http.proxySet", "true", present); validateProperty("http.proxyHost", "www.eclipse.org", present); |