RFR 8004925: java/net/Socks/SocksV4Test.java failing on all platforms
Alan Bateman
Alan.Bateman at oracle.com
Wed Dec 12 06:14:36 PST 2012
On 12/12/2012 14:02, Chris Hegarty wrote:
>
> The test tries to connect (through a socks proxy on the localhost) to
> a domain that does not exist, "doesnt.exist.name". Guess what, someone
> just registered a domain with that name!
>
> The test should be updated to use a domain name that really doesn't
> exist.
>
> >: hg diff SocksV4Test.java
> diff -r 806cf26e5063 test/java/net/Socks/SocksV4Test.java
> --- a/test/java/net/Socks/SocksV4Test.java Wed Dec 12 11:35:18
> 2012 +0000
> +++ b/test/java/net/Socks/SocksV4Test.java Wed Dec 12 13:59:27
> 2012 +0000
> @@ -39,7 +39,7 @@ public class SocksV4Test {
> Proxy sp = new Proxy(Proxy.Type.SOCKS,
> new InetSocketAddress("localhost",
> srvr.getPort()));
> // Let's create an unresolved address
> - InetSocketAddress ad = new
> InetSocketAddress("doesnt.exist.name", 1234);
> + InetSocketAddress ad = new
> InetSocketAddress("d.o.e.s.not.e.x.i.s.t", 1234);
> try (Socket s = new Socket(sp)) {
> s.connect(ad, 10000);
> } catch (UnknownHostException ex) {
>
> -Chris.
Would it be better if the test SocksServer had a list of knows that it
always rejects? That might speed up the test too as it would avoid is
trying to resolve host names or connect to hosts that don't exist.
-Alan
More information about the net-dev
mailing list