You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Andrew Zhang <zh...@gmail.com> on 2006/06/29 05:59:42 UTC

[classlib][nio] Platform dependent tests in SocketChannelTest

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

Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Paulex Yang wrote:
> If no one objects, I'm volunteer to re-layout the nio module's test 
> according to our test convention proposal to accommodate the platform 
> dependent tests.
> 
+1 :)

> Jimmy, Jing Lv wrote:
>> Andrew Zhang wrote:
>>> 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.
>>>
>>
>> Deeply trace into Harmony code, I find it is the difference of 
>> windows/Linux system call. In both platform the test try to call a 
>> select to detect whether connected, however the return value differs, 
>> (Linux return a value means "connect refused" ,which cause a 
>> exception). I believe Harmony is correct in code as it behaves the 
>> same as RI.
>>
>> Maybe the testcase shall be refactored, I remember there's discussion 
>> on mailing but draw no good conclusion, though there are 3 idea about 
>> platform dependent testcase in my memory:
>> 1. add it to platform dependent list, like Harmony's exclude list, run 
>> only on certain platform. Is it Mark or George's idea?
>> 2. check platform in the testcase and run, e.g., check system property 
>> "OS.name". But it seems a bad practice;
>> 3. remove them all until we find a better way.
>> IMO, the first way suggests here is reasonable, but need a 
>> modification on build.xml. Otherwise let's remove them until we find a 
>> better way.
>>
>> However it is very interesting, Java says it "build once, run 
>> everywhere", but it does not always appear the same in the same 
>> operation :)
>>
>>> 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,
>>>
>>>
>>
>>
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Andrew Zhang <zh...@gmail.com>.
Paulex,

Great!

Thank you very much !

Best regards,
Andrew

On 6/29/06, Paulex Yang <pa...@gmail.com> wrote:
>
> If no one objects, I'm volunteer to re-layout the nio module's test
> according to our test convention proposal to accommodate the platform
> dependent tests.
>
> Jimmy, Jing Lv wrote:
> > Andrew Zhang wrote:
> >> 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.
> >>
> >
> > Deeply trace into Harmony code, I find it is the difference of
> > windows/Linux system call. In both platform the test try to call a
> > select to detect whether connected, however the return value differs,
> > (Linux return a value means "connect refused" ,which cause a
> > exception). I believe Harmony is correct in code as it behaves the
> > same as RI.
> >
> > Maybe the testcase shall be refactored, I remember there's discussion
> > on mailing but draw no good conclusion, though there are 3 idea about
> > platform dependent testcase in my memory:
> > 1. add it to platform dependent list, like Harmony's exclude list, run
> > only on certain platform. Is it Mark or George's idea?
> > 2. check platform in the testcase and run, e.g., check system property
> > "OS.name". But it seems a bad practice;
> > 3. remove them all until we find a better way.
> > IMO, the first way suggests here is reasonable, but need a
> > modification on build.xml. Otherwise let's remove them until we find a
> > better way.
> >
> > However it is very interesting, Java says it "build once, run
> > everywhere", but it does not always appear the same in the same
> > operation :)
> >
> >> 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,
> >>
> >>
> >
> >
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Andrew Zhang
China Software Development Lab, IBM

Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Paulex Yang <pa...@gmail.com>.
Andrew,

I've raised HARMONY-782, and thanks Mark, the patch has been applied, 
but I must say sorry that it breaks your patch for HARMONY-767(many 
thanks to Mark again, he provided a updated patch for this). Please 
check it can meet your requirement so far.

And FYI, you may interest another thread discussing the TestNG adoption 
proposal, which is related to the test layout convention.

Andrew Zhang wrote:
> Paulex,
>
> I also noticed there are several platform-dependent behaviours of
> FileChannel.
>
> So I can't wait to see the revised test layout. :)
>
> Will you plan to re-layout NIO test structure recently?
>
> Thank you very much!
>
> On 6/29/06, Paulex Yang <pa...@gmail.com> wrote:
>>
>> If no one objects, I'm volunteer to re-layout the nio module's test
>> according to our test convention proposal to accommodate the platform
>> dependent tests.
>>
>> Jimmy, Jing Lv wrote:
>> > Andrew Zhang wrote:
>> >> 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.
>> >>
>> >
>> > Deeply trace into Harmony code, I find it is the difference of
>> > windows/Linux system call. In both platform the test try to call a
>> > select to detect whether connected, however the return value differs,
>> > (Linux return a value means "connect refused" ,which cause a
>> > exception). I believe Harmony is correct in code as it behaves the
>> > same as RI.
>> >
>> > Maybe the testcase shall be refactored, I remember there's discussion
>> > on mailing but draw no good conclusion, though there are 3 idea about
>> > platform dependent testcase in my memory:
>> > 1. add it to platform dependent list, like Harmony's exclude list, run
>> > only on certain platform. Is it Mark or George's idea?
>> > 2. check platform in the testcase and run, e.g., check system property
>> > "OS.name". But it seems a bad practice;
>> > 3. remove them all until we find a better way.
>> > IMO, the first way suggests here is reasonable, but need a
>> > modification on build.xml. Otherwise let's remove them until we find a
>> > better way.
>> >
>> > However it is very interesting, Java says it "build once, run
>> > everywhere", but it does not always appear the same in the same
>> > operation :)
>> >
>> >> 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,
>> >>
>> >>
>> >
>> >
>>
>>
>> -- 
>> Paulex Yang
>> China Software Development Lab
>> IBM
>>
>>
>>
>> ---------------------------------------------------------------------
>> Terms of use : http://incubator.apache.org/harmony/mailing.html
>> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
>> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>>
>>
>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Andrew Zhang <zh...@gmail.com>.
Paulex,

I also noticed there are several platform-dependent behaviours of
FileChannel.

So I can't wait to see the revised test layout. :)

Will you plan to re-layout NIO test structure recently?

Thank you very much!

On 6/29/06, Paulex Yang <pa...@gmail.com> wrote:
>
> If no one objects, I'm volunteer to re-layout the nio module's test
> according to our test convention proposal to accommodate the platform
> dependent tests.
>
> Jimmy, Jing Lv wrote:
> > Andrew Zhang wrote:
> >> 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.
> >>
> >
> > Deeply trace into Harmony code, I find it is the difference of
> > windows/Linux system call. In both platform the test try to call a
> > select to detect whether connected, however the return value differs,
> > (Linux return a value means "connect refused" ,which cause a
> > exception). I believe Harmony is correct in code as it behaves the
> > same as RI.
> >
> > Maybe the testcase shall be refactored, I remember there's discussion
> > on mailing but draw no good conclusion, though there are 3 idea about
> > platform dependent testcase in my memory:
> > 1. add it to platform dependent list, like Harmony's exclude list, run
> > only on certain platform. Is it Mark or George's idea?
> > 2. check platform in the testcase and run, e.g., check system property
> > "OS.name". But it seems a bad practice;
> > 3. remove them all until we find a better way.
> > IMO, the first way suggests here is reasonable, but need a
> > modification on build.xml. Otherwise let's remove them until we find a
> > better way.
> >
> > However it is very interesting, Java says it "build once, run
> > everywhere", but it does not always appear the same in the same
> > operation :)
> >
> >> 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,
> >>
> >>
> >
> >
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>
>
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>


-- 
Andrew Zhang
China Software Development Lab, IBM

Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Paulex Yang <pa...@gmail.com>.
If no one objects, I'm volunteer to re-layout the nio module's test 
according to our test convention proposal to accommodate the platform 
dependent tests.

Jimmy, Jing Lv wrote:
> Andrew Zhang wrote:
>> 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.
>>
>
> Deeply trace into Harmony code, I find it is the difference of 
> windows/Linux system call. In both platform the test try to call a 
> select to detect whether connected, however the return value differs, 
> (Linux return a value means "connect refused" ,which cause a 
> exception). I believe Harmony is correct in code as it behaves the 
> same as RI.
>
> Maybe the testcase shall be refactored, I remember there's discussion 
> on mailing but draw no good conclusion, though there are 3 idea about 
> platform dependent testcase in my memory:
> 1. add it to platform dependent list, like Harmony's exclude list, run 
> only on certain platform. Is it Mark or George's idea?
> 2. check platform in the testcase and run, e.g., check system property 
> "OS.name". But it seems a bad practice;
> 3. remove them all until we find a better way.
> IMO, the first way suggests here is reasonable, but need a 
> modification on build.xml. Otherwise let's remove them until we find a 
> better way.
>
> However it is very interesting, Java says it "build once, run 
> everywhere", but it does not always appear the same in the same 
> operation :)
>
>> 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,
>>
>>
>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by "Jimmy, Jing Lv" <fi...@gmail.com>.
Andrew Zhang wrote:
> 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.
> 

Deeply trace into Harmony code, I find it is the difference of 
windows/Linux system call. In both platform the test try to call a 
select to detect whether connected, however the return value differs, 
(Linux return a value means "connect refused" ,which cause a exception). 
I believe Harmony is correct in code as it behaves the same as RI.

Maybe the testcase shall be refactored, I remember there's discussion on 
mailing but draw no good conclusion, though there are 3 idea about 
platform dependent testcase in my memory:
1. add it to platform dependent list, like Harmony's exclude list, run 
only on certain platform. Is it Mark or George's idea?
2. check platform in the testcase and run, e.g., check system property 
"OS.name". But it seems a bad practice;
3. remove them all until we find a better way.
IMO, the first way suggests here is reasonable, but need a modification 
on build.xml. Otherwise let's remove them until we find a better way.

However it is very interesting, Java says it "build once, run 
everywhere", but it does not always appear the same in the same operation :)

> 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,
> 
> 


-- 

Best Regards!

Jimmy, Jing Lv
China Software Development Lab, IBM

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Geir Magnusson Jr wrote:
> 
> Andrew Zhang wrote:
>>
>> RI acts differently on windows and Linux:
>> On windows, finishConnect returns false.
>> On Linux, finishConnect throws ConnectException instead of returning false.
> 
> You're kidding... Is there a bug report filed w/ Sun?  If not, we should
> file it and keep track of the bugs we find and file...
> 
>> and Harmony acts the exactly SAME as RI.
>>
>> Could anyone give some suggestions on such platform dependent tests?
>> Remove them? or other solutions?
> 
> I don't think we should remove them.  The only thing I can think of is
> adding a platform dimension to our "testing parameter space"

meaning of course the plan we already have ...

http://incubator.apache.org/harmony/subcomponents/classlibrary/testing.html

(it's early, little coffee, up late...  usual excuse...)

:)

geir

> 
>> Personally,  I prefer to remove these tests.
>> Any suggestions are highly appreciated!
>>
>> Thanks!
>>
>> Best regards,
>>
>>
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Geir Magnusson Jr <ge...@pobox.com>.

Andrew Zhang wrote:
> 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.

You're kidding... Is there a bug report filed w/ Sun?  If not, we should
file it and keep track of the bugs we find and file...

> 
> and Harmony acts the exactly SAME as RI.
> 
> Could anyone give some suggestions on such platform dependent tests?
> Remove them? or other solutions?

I don't think we should remove them.  The only thing I can think of is
adding a platform dimension to our "testing parameter space"

> 
> Personally,  I prefer to remove these tests.
> Any suggestions are highly appreciated!
> 
> Thanks!
> 
> Best regards,
> 
> 

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Re: [classlib][nio] Platform dependent tests in SocketChannelTest

Posted by Paulex Yang <pa...@gmail.com>.
Andrew,

I think we have test conventions discussion on this topic, and the 
discussion result are summarized here:

http://incubator.apache.org/harmony/subcomponents/classlibrary/testing.html

Andrew Zhang wrote:
> 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,
>
>


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org