harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-664) [classlib][nio] o.a.h.tests.java.nio.channels.SelectionKeyTest.test_readyOps() is unstable
Date Mon, 26 Jun 2006 10:46:29 GMT
[classlib][nio] o.a.h.tests.java.nio.channels.SelectionKeyTest.test_readyOps() is unstable
------------------------------------------------------------------------------------------

         Key: HARMONY-664
         URL: http://issues.apache.org/jira/browse/HARMONY-664
     Project: Harmony
        Type: Test

  Components: Classlib  
    Reporter: Andrew Zhang


o.a.h.tests.java.nio.channels.SelectionKeyTest.test_readyOps() is unstable. 

selectNow can not guarantee "OP_CONNECT" operation is available before its execution.

Use "select" instead of "selectNow" could solve this problem.

I'll upload a patch soon.

Thanks!

    public void test_readyOps() throws IOException {
        int port = Support_PortManager.getNextPort();
        ServerSocket ss = new ServerSocket(port);
        try {
            sc.connect(new InetSocketAddress(LOCAL_ADDR, port));
            assertEquals(0, selectionKey.readyOps());
            assertFalse(selectionKey.isConnectable());
            selector.selectNow();
            assertEquals(SelectionKey.OP_CONNECT, selectionKey.readyOps());
        } finally {
            ss.close();
            ss = null;
        }
      
    }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message