harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6324) [classlib][nio]SocketChannelTest.test_finishConnect may failed when the port number has been occupied
Date Fri, 28 Aug 2009 05:26:59 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12748674#action_12748674
] 

Mark Hindess commented on HARMONY-6324:
---------------------------------------

Thanks Ray, but why not just do:

@@ -1711,13 +1711,12 @@
      * Regression test for Harmony-1947.
      */
     public void test_finishConnect() throws Exception {
-        SocketAddress address = new InetSocketAddress("localhost", 2046);
-
         ServerSocketChannel theServerChannel = ServerSocketChannel.open();
         ServerSocket serversocket = theServerChannel.socket();
         serversocket.setReuseAddress(true);
         // Bind the socket
-        serversocket.bind(address);
+        serversocket.bind(new InetSocketAddress("localhost", 0));
+        InetAddress address = serversocket.getInetAddress();
 
         boolean doneNonBlockingConnect = false;
         // Loop so that we make sure we're definitely testing finishConnect()



> [classlib][nio]SocketChannelTest.test_finishConnect may failed when the port number has
been occupied
> -----------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-6324
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6324
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>    Affects Versions: 5.0M11
>         Environment: all platform
>            Reporter: Ray Chen
>            Assignee: Mark Hindess
>            Priority: Minor
>             Fix For: 5.0M11
>
>         Attachments: 6324.diff
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> If the port number has been occupied, the test case failed because of java.net.BindException

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message