import org.apache.helix.tools.ClusterSetup;
public class IntegrationTest {
public static void main(String[] args) throws InterruptedException {
ZkServer server = null;
;
try {
String baseDir = "/tmp/IntegrationTest/";
final String dataDir = baseDir + "zk/dataDir";
final String logDir = baseDir + "/tmp/logDir";
FileUtils.deleteDirectory(new File(dataDir));
FileUtils.deleteDirectory(new File(logDir));
IDefaultNameSpace defaultNameSpace = new IDefaultNameSpace() {
@Override
public void createDefaultNameSpace(ZkClient zkClient) {
}
};
int zkPort = 2199;
final String zkAddress = "localhost:" + zkPort;
server = new ZkServer(dataDir, logDir, defaultNameSpace, zkPort);
server.start();
ClusterSetup setup = new ClusterSetup(zkAddress);
final String clusterName = "file-store-test";
setup.deleteCluster(clusterName);
setup.addCluster(clusterName, true);
setup.addInstanceToCluster(clusterName, "localhost_12001");