Ejemplo n.º 1
0
 private static void Initialize()
 {
     var init = new ResourceTestSystemInitiation();
     var res = init.CreateResources(ResourceSpaceDescriptions.Count);
     ResourceSpaceDescriptions.ResourceAssembly = res;
     AppDomain.CurrentDomain.AssemblyResolve +=
         (e, a) =>
             {
                 if (a.Name.Contains("TestResources"))
                     return res;
                 throw new Exception();
             };
     var store = new Store();
    
     _upnode1 = new CacheNode("Client1",res,store);
     _upnode2 = new CacheNode("Client2",res,store);
     _upnode3 = new CacheNode("Client3", res, store);
     _upnode4 = new CacheNode("Client4", res, store);
     _centnode = new CacheNode("Central", res, store);
     _upnode1.ConnectToDownNode(_centnode,TimeSpan.FromMilliseconds(30));
     _upnode2.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
     _upnode3.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
     _upnode4.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
     _upnode1.Start();
     _upnode2.Start();
     _upnode3.Start();
     _upnode4.Start();
     _centnode.Start();
 }
Ejemplo n.º 2
0
        private static void Initialize()
        {
            var init = new ResourceTestSystemInitiation();
            var res  = init.CreateResources(ResourceSpaceDescriptions.Count);

            ResourceSpaceDescriptions.ResourceAssembly = res;
            AppDomain.CurrentDomain.AssemblyResolve   +=
                (e, a) =>
            {
                if (a.Name.Contains("TestResources"))
                {
                    return(res);
                }
                throw new Exception();
            };
            var store = new Store();

            _upnode1  = new CacheNode("Client1", res, store);
            _upnode2  = new CacheNode("Client2", res, store);
            _upnode3  = new CacheNode("Client3", res, store);
            _upnode4  = new CacheNode("Client4", res, store);
            _centnode = new CacheNode("Central", res, store);
            _upnode1.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
            _upnode2.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
            _upnode3.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
            _upnode4.ConnectToDownNode(_centnode, TimeSpan.FromMilliseconds(30));
            _upnode1.Start();
            _upnode2.Start();
            _upnode3.Start();
            _upnode4.Start();
            _centnode.Start();
        }