harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r410495 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
Date Wed, 31 May 2006 10:58:24 GMT
Author: tellison
Date: Wed May 31 03:58:23 2006
New Revision: 410495

URL: http://svn.apache.org/viewvc?rev=410495&view=rev
Log:
Apply patch HARMONY-530 ([luni] unstable test HttpURLConnectionTest)

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java?rev=410495&r1=410494&r2=410495&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
Wed May 31 03:58:23 2006
@@ -31,11 +31,16 @@
  */
 public class HttpURLConnectionTest extends TestCase {
     
+    private final Object bound = new Object();
+
     //TODO: replace with connection to a mock server
     Thread httpServer = new Thread(new Runnable() {
         public void run() {
             try {
                 ServerSocket ss = new ServerSocket(port);
+                synchronized(bound) {
+                    bound.notify();
+                }
                 ss.setSoTimeout(1000);
                 try {
                     ss.accept().close();
@@ -65,9 +70,11 @@
      */
     public void testGetOutputStream() throws Exception {
         // Regression for HARMONY-482
+        synchronized(bound) {
+            bound.wait(5000);
+        }
         HttpURLConnection c = (HttpURLConnection) new URL("http://127.0.0.1:"
                 + port).openConnection();
-
         c.setDoOutput(true);
         //use new String("POST") instead of simple "POST" to obtain other 
         //object instances then those that are in HttpURLConnection classes 



Mime
View raw message