hadoop-ozone/client/src/test/java/org/apache/hadoop/ozone/client/TestHddsClientUtils.java
@Test
  public void testGetScmClientAddress() {
    final Configuration conf = new OzoneConfiguration();

    // First try a client address with just a host name. Verify it falls
    // back to the default port.
    conf.set(ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY, "1.2.3.4");
    InetSocketAddress addr = getScmAddressForClients(conf);
    assertThat(addr.getHostString(), is("1.2.3.4"));
    assertThat(addr.getPort(), is(ScmConfigKeys.OZONE_SCM_CLIENT_PORT_DEFAULT));

    // Next try a client address with a host name and port. Verify both
    // are used correctly.
    conf.set(ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY, "1.2.3.4:100");
    addr = getScmAddressForClients(conf);
    assertThat(addr.getHostString(), is("1.2.3.4"));
    assertThat(addr.getPort(), is(100));
  }
/**
   * Verify that the client endpoint can be correctly parsed from
   * configuration.
   */
Verify that the client endpoint can be correctly parsed from
configuration.
Verify that the client endpoint can be correctly parsed from configuration .
@Test
  public void testGetScmClientAddress() {
    final Configuration conf = new OzoneConfiguration();
    conf.set(ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY, "1.2.3.4");
    InetSocketAddress addr = getScmAddressForClients(conf);
    assertThat(addr.getHostString(), is("1.2.3.4"));
    assertThat(addr.getPort(), is(ScmConfigKeys.OZONE_SCM_CLIENT_PORT_DEFAULT));
    conf.set(ScmConfigKeys.OZONE_SCM_CLIENT_ADDRESS_KEY, "1.2.3.4:100");
    addr = getScmAddressForClients(conf);
    assertThat(addr.getHostString(), is("1.2.3.4"));
    assertThat(addr.getPort(), is(100));
  }
@ Test public void testGetScmClientAddress ( ) { final Configuration conf = new OzoneConfiguration ( ) ; conf . set ( ScmConfigKeys . OZONE_SCM_CLIENT_ADDRESS_KEY , "1.2.3.4" ) ; InetSocketAddress addr = getScmAddressForClients ( conf ) ; assertThat ( addr . getHostString ( ) , is ( "1.2.3.4" ) ) ; assertThat ( addr . getPort ( ) , is ( ScmConfigKeys . OZONE_SCM_CLIENT_PORT_DEFAULT ) ) ; conf . set ( ScmConfigKeys . OZONE_SCM_CLIENT_ADDRESS_KEY , "1.2.3.4:100" ) ; addr = getScmAddressForClients ( conf ) ; assertThat ( addr . getHostString ( ) , is ( "1.2.3.4" ) ) ; assertThat ( addr . getPort ( ) , is ( 100 ) ) ; }
Verify that the client endpoint can be correctly parsed from
 configuration.
Verify that the client endpoint can be correctly parsed from configuration .
// First try a client address with just a host name. Verify it falls // back to the default port. // Next try a client address with a host name and port. Verify both // are used correctly.