@Test
public void testDistributedProtocol() {

  YarnConfiguration conf = new YarnConfiguration();
  try {
    ServerRMProxy.createRMProxy(conf, DistributedSchedulingAMProtocol.class);
  } catch (Exception e) {
    Assert.fail("DistributedSchedulingAMProtocol fail in non HA");
  }
  // HA is enabled
  conf.setBoolean(YarnConfiguration.RM_HA_ENABLED, true);
  conf.set(YarnConfiguration.RM_HA_IDS, "rm1,rm2");
  conf.set(HAUtil.addSuffix(YarnConfiguration.RM_HOSTNAME, "rm1"), "0.0.0.0");
  conf.set(HAUtil.addSuffix(YarnConfiguration.RM_HOSTNAME, "rm2"), "0.0.0.0");
  try {
    ServerRMProxy.createRMProxy(conf, DistributedSchedulingAMProtocol.class);
  } catch (Exception e) {
    Assert.fail("DistributedSchedulingAMProtocol fail in HA");
  }
}