harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apavle...@apache.org
Subject svn commit: r587038 - /harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/net/Socket/SocketTest.java
Date Mon, 22 Oct 2007 08:51:53 GMT
Author: apavlenko
Date: Mon Oct 22 01:51:51 2007
New Revision: 587038

URL: http://svn.apache.org/viewvc?rev=587038&view=rev
Log:
Patch for HARMONY-4986: [buildtest][func] java.net.SocketTest intermittently fails

Modified:
    harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/net/Socket/SocketTest.java

Modified: harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/net/Socket/SocketTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/net/Socket/SocketTest.java?rev=587038&r1=587037&r2=587038&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/net/Socket/SocketTest.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/functional/src/test/functional/org/apache/harmony/test/func/api/java/net/Socket/SocketTest.java
Mon Oct 22 01:51:51 2007
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.net.ConnectException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
@@ -57,9 +58,11 @@
             try {
                 client.connect(addr, 1);
                 return failed("Expected SocketTimeoutException had not been thrown");
-
             } catch (SocketTimeoutException e) {
                 assertFalse(client.isConnected());
+            } catch (ConnectException ex) {
+              // Sometimes the above code throws "Connection refused" for localhost.
+              assertFalse(client.isConnected());
             }
             
         } catch (IOException e) {



Mime
View raw message