this.clearUpFiles(TestConf.tmpPath);
}
// change local file before update
public void testSetConfigOK2() throws Exception{
ZooKeeper zk = this.initZK();
CountDownLatch connectedSignal = new CountDownLatch(1);
IService iservice = new IService(TestConf.host,null,null,null,"./src/test/tmp");
iservice.setEventHandle(Constants.CONNECT_EVENT, new TestHandler(connectedSignal));
iservice.init();
connectedSignal.await();
Config config = iservice.createConfig("/iserviceTest/node1");
DefaultData data = (DefaultData) config.get("node3", 123);
Assert.assertEquals("node3", data.getData());
FS.dump(TestConf.tmpPath + "/" + Extends.getPid() + "/iserviceTest/node1/node4.data", "version:1\r\nnew-node4");
CountDownLatch connectedSignal2 = new CountDownLatch(1);
config.setEventHandle(Constants.DUMP_FAIL_EVENT, new TestHandler(connectedSignal2));
zk.setData("/iserviceTest/node1/node3", "new-node3".getBytes(), -1);
zk.setData("/iserviceTest/node1", "new-node1".getBytes(), -1);
connectedSignal2.await();
DefaultData data2 = (DefaultData) config.get("node3", 123);
Assert.assertEquals("node3", data2.getData());
this.clearUpZK(zk);