Пример #1
0
        public virtual void TestResourceUpdateOnRebootedNode()
        {
            RMNodeImpl node        = GetRebootedNode();
            Resource   oldCapacity = node.GetTotalCapability();

            NUnit.Framework.Assert.AreEqual("Memory resource is not match.", oldCapacity.GetMemory
                                                (), 4096);
            NUnit.Framework.Assert.AreEqual("CPU resource is not match.", oldCapacity.GetVirtualCores
                                                (), 4);
            node.Handle(new RMNodeResourceUpdateEvent(node.GetNodeID(), ResourceOption.NewInstance
                                                          (Resource.NewInstance(2048, 2), RMNode.OverCommitTimeoutMillisDefault)));
            Resource newCapacity = node.GetTotalCapability();

            NUnit.Framework.Assert.AreEqual("Memory resource is not match.", newCapacity.GetMemory
                                                (), 2048);
            NUnit.Framework.Assert.AreEqual("CPU resource is not match.", newCapacity.GetVirtualCores
                                                (), 2);
            NUnit.Framework.Assert.AreEqual(NodeState.Rebooted, node.GetState());
        }