public ClusterManagerServiceTests()
 {
     TestUtils.ResetDirectory("c:\\brightstar\\coreA");
     TestUtils.ResetDirectory("c:\\brightstar\\coreB");
     Thread.Sleep(2000);
     _coreA = new NodeCore("c:\\brightstar\\coreA");
     _coreB = new NodeCore("c:\\brightstar\\coreB");
 }
示例#2
0
 private void WaitForState(NodeCore node, CoreState expectedState, int timeToWait)
 {
     for (int i = 0; i < 10; i++)
     {
         Thread.Sleep(timeToWait / 10);
         if (node.GetStatus() == expectedState)
         {
             return;
         }
     }
     Thread.Sleep(timeToWait / 10);
     Assert.AreEqual(expectedState, node.GetStatus(), "Node did not enter the expected state after {0} milliseconds", timeToWait);
 }
示例#3
0
 public TwoNodeClusterTests()
 {
     TestUtils.ResetDirectory("c:\\brightstar\\coreA");
     TestUtils.ResetDirectory("c:\\brightstar\\coreB");
     Thread.Sleep(2000);
     _coreA             = new NodeCore("c:\\brightstar\\coreA");
     _coreB             = new NodeCore("c:\\brightstar\\coreB");
     _testConfiguration = new ClusterConfiguration
     {
         ClusterNodes =
             new List <NodeConfiguration>
         {
             new NodeConfiguration("127.0.0.1", 10001, 8090, 8095),
             new NodeConfiguration("127.0.0.1", 10002, 8091, 8096)
         },
         MasterConfiguration = new MasterConfiguration {
             WriteQuorum = 1
         }
     };
     _clusterManager = new ManagerNode(_testConfiguration);
 }