harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r810849 - /harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
Date Thu, 03 Sep 2009 09:45:17 GMT
Author: hindessm
Date: Thu Sep  3 09:45:16 2009
New Revision: 810849

URL: http://svn.apache.org/viewvc?rev=810849&view=rev
Log:
Applying patch from "[#HARMONY-6324] [classlib][nio]
SocketChannelTest.test_finishConnect may failed when the port number has
been occupied".

Modified:
    harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java?rev=810849&r1=810848&r2=810849&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/SocketChannelTest.java
Thu Sep  3 09:45:16 2009
@@ -1711,7 +1711,7 @@
      * Regression test for Harmony-1947.
      */
     public void test_finishConnect() throws Exception {
-        SocketAddress address = new InetSocketAddress("localhost", 2046);
+        SocketAddress address = new InetSocketAddress("localhost", 0);
 
         ServerSocketChannel theServerChannel = ServerSocketChannel.open();
         ServerSocket serversocket = theServerChannel.socket();
@@ -1727,7 +1727,7 @@
             // Set the SocketChannel to non-blocking so that connect(..) does
             // not block
             channel1.configureBlocking(false);
-            boolean connected = channel1.connect(address);
+            boolean connected = channel1.connect(new InetSocketAddress("localhost",serversocket.getLocalPort()));
             if (!connected) {
                 // Now set the SocketChannel back to blocking so that
                 // finishConnect() blocks.



Mime
View raw message