Package data

Examples of data.DefaultData


    iservice.setEventHandle(Constants.CONNECT_EVENT, th);
    iservice.init();
    connectedSignal.await();
   
    Config config = iservice.createConfig("/iserviceTest/node1");
    DefaultData data = (DefaultData) config.get("node3", 123);
    Assert.assertEquals("node3", data.getData());
   
    this.clearUpZK(zk);
    this.clearUpFiles(TestConf.tmpPath);
  }
View Full Code Here


    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());
   
   
    CountDownLatch connectedSignal2 = new CountDownLatch(1);
    config.setEventHandle(Constants.DATA_CHANGE_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("new-node3", data2.getData());
   
    this.clearUpZK(zk);
    this.clearUpFiles(TestConf.tmpPath);
  }
View Full Code Here

    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);
    this.clearUpFiles(TestConf.tmpPath);
  }
View Full Code Here

    iservice.setEventHandle(Constants.DISCONNECT_EVENT, th);
    iservice.init();
    connectedSignal.await();
   
    Config config = iservice.createConfig("/root/node1");
    DefaultData data = (DefaultData) config.get("info", 111);
    Assert.assertEquals("i'm in newer node", data.getData());
   
    this.clearUpFiles(TestConf.tmpPath);
  }
View Full Code Here

public class DefaultParser implements Parser{

  @Override
  public Data parse(String content) {
    return new DefaultData(content);
  }
View Full Code Here

TOP

Related Classes of data.DefaultData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.