} catch (HelixException e)
{
// OK
}
InstanceConfig config = new InstanceConfig("host1_9999");
config.setHostName("host1");
config.setPort("9999");
tool.addInstance(clusterName, config);
tool.enableInstance(clusterName, "host1_9999", true);
String path = PropertyPathConfig.getPath(PropertyType.INSTANCES,
clusterName, "host1_9999");
AssertJUnit.assertTrue(_gZkClient.exists(path));
try
{
tool.addInstance(clusterName, config);
Assert.fail("should fail if add an alredy-existing instance");
} catch (HelixException e)
{
// OK
}
config = tool.getInstanceConfig(clusterName, "host1_9999");
AssertJUnit.assertEquals(config.getId(), "host1_9999");
tool.dropInstance(clusterName, config);
try
{
tool.getInstanceConfig(clusterName, "host1_9999");