use of com.baidu.disconf.core.common.zookeeper.inner.ResilientActiveKeyValueStore in project disconf by knightliao.
the class ZookeeperMgr method initInternal.
/**
* @return void
*
* @throws IOException
* @throws InterruptedException
* @Description: 初始化
* @author liaoqiqi
* @date 2013-6-14
*/
private void initInternal(String hosts, String defaultPrefixString, boolean debug) throws IOException, InterruptedException {
curHost = hosts;
curDefaultPrefixString = defaultPrefixString;
store = new ResilientActiveKeyValueStore(debug);
store.connect(hosts);
LOGGER.info("zoo prefix: " + defaultPrefixString);
// 新建父目录
makeDir(defaultPrefixString, ZooUtils.getIp());
}
use of com.baidu.disconf.core.common.zookeeper.inner.ResilientActiveKeyValueStore in project disconf by knightliao.
the class ZookeeperMgrTest method testGetRootChildren.
/**
* 测试获取Root子节点
*/
@Test
public final void testGetRootChildren() {
final ZookeeperMgr obj = ZookeeperMgr.getInstance();
//
// 注入
//
new NonStrictExpectations(obj) {
{
ResilientActiveKeyValueStore store = new ResilientActiveKeyValueStoreMock();
this.setField(obj, "store", store);
}
};
List<String> list = ZookeeperMgr.getInstance().getRootChildren();
for (String item : list) {
System.out.println(item);
}
Assert.assertTrue(list.size() > 0);
}
Aggregations