use of org.apache.curator.test.TestingServer in project drill by apache.
the class TestZookeeperClient method setUp.
@Before
public void setUp() throws Exception {
server = new TestingServer();
final RetryPolicy policy = new RetryNTimes(1, 1000);
curator = CuratorFrameworkFactory.newClient(server.getConnectString(), policy);
client = new ClientWithMockCache(curator, root, mode);
server.start();
curator.start();
client.start();
}
use of org.apache.curator.test.TestingServer in project ignite by apache.
the class TestKafkaBroker method setupZooKeeper.
/**
* Sets up ZooKeeper test server.
*
* @throws Exception If failed.
*/
private void setupZooKeeper() throws Exception {
zkServer = new TestingServer(ZK_PORT, true);
Tuple2<ZkClient, ZkConnection> zkTuple = ZkUtils.createZkClientAndConnection(zkServer.getConnectString(), ZK_SESSION_TIMEOUT, ZK_CONNECTION_TIMEOUT);
zkUtils = new ZkUtils(zkTuple._1(), zkTuple._2(), false);
}
Aggregations