harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r554557 - in /harmony/enhanced/classlib/trunk/modules/luni/src: main/java/java/net/ProxySelectorImpl.java test/api/common/tests/api/java/net/ProxySelectorTest.java
Date Mon, 09 Jul 2007 08:23:13 GMT
Author: leoli
Date: Mon Jul  9 01:23:12 2007
New Revision: 554557

URL: http://svn.apache.org/viewvc?view=rev&rev=554557
Log:
Fix bug for HARMONY-4281([classlib][net] test tests.api.java.net.ProxySelectorTest failed
if proxy defined in the classlib\depends\files\net.properties
)

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
    harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/ProxySelectorTest.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java?view=diff&rev=554557&r1=554556&r2=554557
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/net/ProxySelectorImpl.java
Mon Jul  9 01:23:12 2007
@@ -236,7 +236,7 @@
      */
     private boolean isNonProxyHost(String host, String nonProxyHosts) {
         // nonProxyHosts is not set
-        if (null == nonProxyHosts) {
+        if (null == host || null == nonProxyHosts) {
             return false;
         }
         // Construct regex expression of nonProxyHosts

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/ProxySelectorTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/ProxySelectorTest.java?view=diff&rev=554557&r1=554556&r2=554557
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/ProxySelectorTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/api/common/tests/api/java/net/ProxySelectorTest.java
Mon Jul  9 01:23:12 2007
@@ -200,7 +200,7 @@
         // no proxy, return a proxyList only contains NO_PROXY
         proxyList = selector.select(httpUri);
         assertProxyEquals(proxyList, Proxy.NO_PROXY);
-
+        
         // set http proxy
         System.setProperty("http.proxyHost", HTTP_PROXY_HOST);
         System.setProperty("http.proxyPort", String.valueOf(HTTP_PROXY_PORT));
@@ -230,6 +230,26 @@
         assertProxyEquals(proxyList, Proxy.Type.SOCKS, SOCKS_PROXY_HOST,
                 SOCKS_PROXY_PORT);
 
+    }
+    
+    //Regression for HARMONY-4281
+    public void test_selectLjava_net_URI_SelectExact_NullHost_withNoProxyHostsProperty(){
+        System.setProperty("http.nonProxyHosts", "localhost|127.0.0.1");
+        System.setProperty("http.proxyHost", HTTP_PROXY_HOST);
+        System.setProperty("http.proxyPort", String.valueOf(HTTP_PROXY_PORT));
+        // set https proxy
+        System.setProperty("https.proxyHost", HTTPS_PROXY_HOST);
+        System.setProperty("https.proxyPort", String.valueOf(HTTPS_PROXY_PORT));
+        // set ftp proxy
+        System.setProperty("ftp.proxyHost", FTP_PROXY_HOST);
+        System.setProperty("ftp.proxyPort", String.valueOf(FTP_PROXY_PORT));
+        // set socks proxy
+        System.setProperty("socksProxyHost", SOCKS_PROXY_HOST);
+        System.setProperty("socksProxyPort", String.valueOf(SOCKS_PROXY_PORT));
+
+        proxyList = selector.select(httpUri);
+        assertProxyEquals(proxyList, Proxy.Type.HTTP, HTTP_PROXY_HOST,
+                HTTP_PROXY_PORT);
     }
 
 	/**



Mime
View raw message