You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ap...@apache.org on 2006/11/29 00:00:38 UTC

svn commit: r480265 - /harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java

Author: apetrenko
Date: Tue Nov 28 15:00:37 2006
New Revision: 480265

URL: http://svn.apache.org/viewvc?view=rev&rev=480265
Log:
Patch for HARMONY-1879 "[drlvm][unit] org.apache.harmony.tests.internal.net.www.protocol.http.HttpURLConnectionTest fails"

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

Modified: 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/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java?view=diff&rev=480265&r1=480264&r2=480265
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/test/java/org/apache/harmony/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java Tue Nov 28 15:00:37 2006
@@ -46,6 +46,7 @@
     static class MockServer extends Thread {
         ServerSocket serverSocket;
         boolean accepted = false;
+        boolean started = false;
 
         public MockServer(String name) throws IOException {
             super(name);
@@ -61,6 +62,7 @@
         public void run() {
             try {
                 synchronized (bound) {
+                    started = true;
                     bound.notify();
                 }
                 try {
@@ -195,11 +197,11 @@
 
         server.start();
         synchronized(bound) {
-            bound.wait(5000);
+            if (!server.started) bound.wait(5000);
         }
         proxy.start();
         synchronized(bound) {
-            bound.wait(5000);
+            if (!proxy.started) bound.wait(5000);
         }
 
         connection.connect();
@@ -240,11 +242,11 @@
 
             server.start();
             synchronized(bound) {
-                bound.wait(5000);
+                if (!server.started) bound.wait(5000);
             }
             proxy.start();
             synchronized(bound) {
-                bound.wait(5000);
+                if (!proxy.started) bound.wait(5000);
             }
             connection.connect();