harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r585949 - /harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java
Date Thu, 18 Oct 2007 12:51:33 GMT
Author: tellison
Date: Thu Oct 18 05:51:33 2007
New Revision: 585949

URL: http://svn.apache.org/viewvc?rev=585949&view=rev
Log:
Regression test for HARMONY-4961 (SocketChannel.socket().getLocalPort() returns -1 from ServerSocketChannel)

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

Modified: harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.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/ServerSocketChannelTest.java?rev=585949&r1=585948&r2=585949&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/nio/src/test/java/common/org/apache/harmony/nio/tests/java/nio/channels/ServerSocketChannelTest.java
Thu Oct 18 05:51:33 2007
@@ -572,4 +572,19 @@
             // expected
         }
     }
+    /**
+     * Regression test for HARMONY-4961
+     */
+    public void test_socket_getLocalPort() throws IOException {
+        serverChannel.socket().bind(localAddr1);
+        clientChannel.connect(localAddr1); 
+        SocketChannel myChannel = serverChannel.accept();
+        int port = myChannel.socket().getLocalPort();
+        assertEquals(localAddr1.getPort(), port);
+        myChannel.close();
+        clientChannel.close();
+        serverChannel.close();
+    }
+
+    
 }



Mime
View raw message