Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 78195 invoked from network); 17 Apr 2010 16:32:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Apr 2010 16:32:35 -0000 Received: (qmail 14703 invoked by uid 500); 17 Apr 2010 16:32:35 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 14637 invoked by uid 500); 17 Apr 2010 16:32:35 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 14630 invoked by uid 99); 17 Apr 2010 16:32:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Apr 2010 16:32:35 +0000 X-ASF-Spam-Status: No, hits=-1627.3 required=10.0 tests=ALL_TRUSTED,AWL X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 17 Apr 2010 16:32:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A3B3623889B3; Sat, 17 Apr 2010 16:31:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r935201 - /harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java Date: Sat, 17 Apr 2010 16:31:52 -0000 To: commits@harmony.apache.org From: hindessm@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100417163152.A3B3623889B3@eris.apache.org> Author: hindessm Date: Sat Apr 17 16:31:52 2010 New Revision: 935201 URL: http://svn.apache.org/viewvc?rev=935201&view=rev Log: Applying patches from "[#HARMONY-6500] [classlib][luni] HttpURLConnectionTest.testUsingProxy2 doesn't throw ConnectException when port is already in use". Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java Modified: harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java URL: http://svn.apache.org/viewvc/harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java?rev=935201&r1=935200&r2=935201&view=diff ============================================================================== --- harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java (original) +++ harmony/enhanced/java/trunk/classlib/modules/luni/src/test/api/common/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java Sat Apr 17 16:31:52 2010 @@ -437,13 +437,18 @@ public class HttpURLConnectionTest exten urlConnect.getInputStream(); assertTrue(urlConnect.usingProxy()); - System.setProperty("http.proxyPort", "81"); + // find a free port + ServerSocket serverSocket = new ServerSocket(0); + int port = serverSocket.getLocalPort(); + serverSocket.close(); + + System.setProperty("http.proxyPort", port + ""); url = new URL(jettyURL); urlConnect = (HttpURLConnection) url.openConnection(); urlConnect.getInputStream(); assertFalse(urlConnect.usingProxy()); - url = new URL("http://localhost"); + url = new URL("http://localhost:" + port); urlConnect = (HttpURLConnection) url.openConnection(); try { urlConnect.getInputStream();