harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject [classlib][nio] Platform dependent tests in SocketChannelTest
Date Thu, 29 Jun 2006 03:59:42 GMT
Hello everybody,

I noticed there are 8 FIXMEs in SocketChannelTest, which are mainly caused
by platform differences.

Take following FIXME as example:


    public void testCFII_ServerStartLater_NonBlock() throws Exception {
        // ensure
        ensureServerClosed();
        this.channel1.configureBlocking(false);
        statusNotConnected_NotPending();
        // connect
        assertFalse(this.channel1.connect(localAddr1));
        statusNotConnected_Pending();

        ensureServerOpen();

        try {
            assertFalse(this.channel1.finishConnect());
            statusNotConnected_Pending();
            this.channel1.close();
        } catch (ConnectException e) {
            // FIXME: assertEquals(e.getMessage(), "Connection refused");
        }
    }
The process of this test looks like:
client socket connect (server is closed) -> open server -> finishConnect .

RI acts differently on windows and Linux:
On windows, finishConnect returns false.
On Linux, finishConnect throws ConnectException instead of returning false.

and Harmony acts the exactly SAME as RI.

Could anyone give some suggestions on such platform dependent tests?
Remove them? or other solutions?

Personally,  I prefer to remove these tests.
Any suggestions are highly appreciated!

Thanks!

Best regards,


-- 
Andrew Zhang
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message