harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Blewitt" <alex.blew...@gmail.com>
Subject Re: RE: [classlib][test] Configuration dependent test of InetAddress.getHostName
Date Wed, 25 Oct 2006 07:49:25 GMT
Not sure if this is covered in a test elsewhere, but we could check
that the getLocalName() returns a non-null, non-empty string? After
all, both localhost and 127.0.0.1 should return valid lookups.

The other possibiltiy is to fork an 'nslookup' or 'host' command
(depending on platform) to find out what the platform thinks is the
local host name, and then comparing it to Java's result.

Alex.


On 25/10/06, Fedotov, Alexei A <alexei.a.fedotov@intel.com> wrote:
> Denis wrote,
> >It's possible but it will be another test
> Agreed
>
> >+1 exclude this test (not whole test but localhost check)
> +1
>
> With best regards,
> Alexei Fedotov,
> Intel Java & XML Engineering
>
> >-----Original Message-----
> >From: Denis Kishenko [mailto:dkishenko@gmail.com]
> >Sent: Tuesday, October 24, 2006 3:31 PM
> >To: harmony-dev@incubator.apache.org
> >Subject: Re: [classlib][test] Configuration dependent test of
> >InetAddress.getHostName
> >
> >2006/10/24, Fedotov, Alexei A <alexei.a.fedotov@intel.com>:
> >> I wonder about the first option. Is there any way to check that
> symbolic
> >> name corresponds to the local computer? I can imagine the following
> >> condition to check this.
> >>
> >>
> InetAddress.getByName(InetAddress.getByName("127.0.0.1").getHostName()).
> >> isLoopbackAddress()
> >This test failed because isLoopbackAddress() expected 127.X.X.X
> >
> >2006/10/24, Fedotov, Alexei A <alexei.a.fedotov@intel.com>:
> >> Andrew,
> >>
> >> I agree that test should be fixed. I suggested using one of the
> >> following checks to validate that the host is localhost.
> >>
> >> InetAddress.getByName(host).isLoopbackAddress()
> >> InetAddress.getByName(host).isSiteLocalAddress()
> >It's possible but it will be another test
> >
> >IMHO
> >+1 exclude this test (not whole test but localhost check)
>

Mime
View raw message