Exemple #1
0
        public void ZKHelperCreateTest()
        {
            var data = Guid.NewGuid().ToString();

            ZkHelper.Create("/nscrapy/conf/1/dev", data);
            var returnedData = ZkHelper.GetAsync("/nscrapy/conf/1/dev").Result;

            Assert.AreEqual(data, returnedData);
        }
Exemple #2
0
        public void ZookeeperConfigProviderTest()
        {
            var config = new ZookeeperConfigProvider();

            ZkHelper.Create("/nscrapy/conf", $"appsetting.{Guid.NewGuid().ToString()}.json");
            ZkHelper.GetAsync("/nscrapy/conf");
            ZkHelper.SetAsync("/nscrapy/conf", $"appsetting.{Guid.NewGuid().ToString()}.json");
            ZkHelper.GetAsync("/nscrapy/conf");
            ZkHelper.SetAsync("/nscrapy/conf", $"appsetting.{Guid.NewGuid().ToString()}.json");
            Thread.Sleep(10000);
        }
Exemple #3
0
        public void ZKHelperDeleteTest()
        {
            var data = Guid.NewGuid().ToString();

            ZkHelper.Create("/nscrapy/conf/1/dev", data);
            if (!ZkHelper.Exists("/nscrapy/conf/1/dev"))
            {
                Assert.Fail("path not created successfully");
            }
            ZkHelper.Delete("/nscrapy/conf/1/dev");

            Assert.IsFalse(ZkHelper.Exists("/nscrapy/conf/1/dev"));
        }
Exemple #4
0
 public SingleClientTests()
 {
     this.zkHelper = new ZkHelper();
 }
 public MultiClientTests()
 {
     this.zkHelper = new ZkHelper();
 }
Exemple #6
0
        public void ZKHeperCreateConfigTest()
        {
            var data = File.ReadAllText("appsetting.json");

            ZkHelper.SetAsync("/nscrapy/conf", data);
        }
Exemple #7
0
 public RandomisedResourceBarrierTests()
 {
     this.zkHelper = new ZkHelper();
 }
Exemple #8
0
 protected CommonClient()
 {
     _logger   = HBaseConfig.Instance.LoggerFactory?.CreateLogger <CommonClient>() ?? new DebugLogger <CommonClient>();
     _zkHelper = new ZkHelper();
     DefaultCancellationSource = new CancellationTokenSource();
 }