@Test
public void testSetData() throws Exception {

    final ZooKeeper zk = createClient();
    ZooKeeperMain zkMain = new ZooKeeperMain(zk);
    String cmdstring1 = "create -e /node4 data";
    String cmdstring2 = "set /node4 " + "data";
    String cmdstring3 = "delete /node4";
    Stat stat = new Stat();
    int version = 0;
    zkMain.cl.parseCommand(cmdstring1);
    Assert.assertTrue(zkMain.processZKCmd(zkMain.cl));
    stat = zk.exists("/node4", true);
    version = stat.getVersion();
    zkMain.cl.parseCommand(cmdstring2);
    Assert.assertFalse(zkMain.processZKCmd(zkMain.cl));
    stat = zk.exists("/node4", true);
    Assert.assertEquals(version + 1, stat.getVersion());
    zkMain.cl.parseCommand(cmdstring3);
    Assert.assertFalse(zkMain.processZKCmd(zkMain.cl));
}