hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: A question about Unit Test
Date Mon, 09 May 2011 17:35:15 GMT
Did you try it Gao?  The below looks like it might be a little
'dangerous' in that an empty address happens when the hosted
InetSocketAddress fails to resolve.  Which test is failing?  We should
for sure make it so tests pass if you are not connected to the net.

Thanks Gao,
St.Ack

On Sun, May 8, 2011 at 12:40 AM, Gaojinchao <gaojinchao@huawei.com> wrote:
>   private static final HServerAddress HSA =
>    new HServerAddress("example.org:1234");
>
> In my machine , It always failed because of DNS error.
> The example.org is hard code.  If we can add a function to get hostname.
> It likes:
>
>  public static String gethostname()
>  {
>        String hostName = null;
>        try{
>                hostName = java.net.InetAddress.getLocalHost().getHostName();
>        }
>        catch(java.net.UnknownHostException uhe)
>        {
>                ......
>        }
>
>        return hostName;
>  }
>
>
> private static final HServerAddress HSA =
>    new HServerAddress(gethostname() +":1234");
>
>
>
>

Mime
View raw message