harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [classlib][luni] new test in tests.api.java.net.SocketTest failed on my Windows XP sp2
Date Wed, 18 Apr 2007 08:30:23 GMT
Nathan Beyer wrote:
> For the slow (and lazy), can you point me to one of the tests that
> just uses port 0.

Here's a really simple one from [1] :

/**
 * @tests java.net.ServerSocket#toString()
 */
public void test_toString() throws Exception {
    s = new ServerSocket(0);
    try {
        int portNumber = s.getLocalPort();
        assertEquals("ServerSocket[addr=0.0.0.0/0.0.0.0,port=0,localport="
                + portNumber + "]", s.toString());
    } finally {
        s.close();
    }
}


[1]
http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/test/java/tests/api/java/net/ServerSocketTest.java?revision=515492&view=markup

Regards,
Tim


Mime
View raw message