public void TestSetUp()
 {
     _counters  = new TestCounters();
     _mreConfig = new ManualResetEventSlim();
     _cluster   = new CouchbaseCluster(new MemcacheClientConfiguration()
     {
         TransportConnectTimerPeriod = Timeout.InfiniteTimeSpan
     }, "Some.Bucket", new[] { new IPEndPoint(0, 0) });
     _cluster.NodeAdded   += _ => _counters.IncrementNodesAdded();
     _cluster.NodeRemoved += _ => _counters.IncrementNodesRemoved();
     _cluster.OnError     += e => { _counters.IncrementErrors(); Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); };
     _cluster.OnConfig    += () => _mreConfig.Set();
 }
Exemplo n.º 2
0
        public void TestSetUp()
        {
            _counters  = new TestCounters();
            _mreConfig = new ManualResetEventSlim();

            var config = new MemcacheClientConfiguration()
            {
                TransportConnectTimerPeriod = Timeout.InfiniteTimeSpan,
                NodeFactory = (ipendpoint, _) => new NodeMock {
                    EndPoint = ipendpoint, DefaultResponse = Status.NoError
                },
            };

            _cluster              = new CouchbaseCluster(config, "Some.Bucket", TimeSpan.FromSeconds(30), new[] { new IPEndPoint(0, 0) });
            _cluster.NodeAdded   += _ => _counters.IncrementNodesAdded();
            _cluster.NodeRemoved += _ => _counters.IncrementNodesRemoved();
            _cluster.OnError     += e => { _counters.IncrementErrors(); Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); };
            _cluster.OnConfig    += () => _mreConfig.Set();
        }
 public void TestSetUp()
 {
     _counters = new TestCounters();
     _mreConfig = new ManualResetEventSlim();
     _cluster = new CouchbaseCluster(new MemcacheClientConfiguration() { TransportConnectTimerPeriod = Timeout.InfiniteTimeSpan }, "Some.Bucket", new[] { new IPEndPoint(0, 0) });
     _cluster.NodeAdded += _ => _counters.IncrementNodesAdded();
     _cluster.NodeRemoved += _ => _counters.IncrementNodesRemoved();
     _cluster.OnError += e => { _counters.IncrementErrors(); Console.Error.WriteLine(e.Message); Console.Error.WriteLine(e.StackTrace); };
     _cluster.OnConfig += () => _mreConfig.Set();
 }