Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testToMasterMasterIsAvailable()
        public virtual void TestToMasterMasterIsAvailable()
        {
            // CASE 1: Got MasterIsAvailable for me - it's ok, that means we completed switching and should to to MASTER
            HighAvailabilityMemberState newState = TO_MASTER.masterIsAvailable(_context, _myId, SampleUri);

            assertEquals(MASTER, newState);

            // CASE 2: Got MasterIsAvailable for someone else - should not happen, should have received a MasterIsElected
            HighAvailabilityMemberState illegal = TO_MASTER.masterIsAvailable(_context, new InstanceId(2), SampleUri);

            assertEquals(ILLEGAL, illegal);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testToMasterSlaveIsAvailable()
        public virtual void TestToMasterSlaveIsAvailable()
        {
            // CASE 1: Got SlaveIsAvailable for me - not ok, i'm currently switching to master
            HighAvailabilityMemberState illegal = TO_MASTER.slaveIsAvailable(_context, _myId, SampleUri);

            assertEquals(ILLEGAL, illegal);

            // CASE 2: Got SlaveIsAvailable for someone else - don't really care
            HighAvailabilityMemberState newState = TO_MASTER.slaveIsAvailable(_context, new InstanceId(2), SampleUri);

            assertEquals(TO_MASTER, newState);
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testToMasterMasterIsElected()
        public virtual void TestToMasterMasterIsElected()
        {
            // CASE 1: Got MasterIsElected for me - it's ok, continue in TO_MASTER
            HighAvailabilityMemberState newState = TO_MASTER.masterIsElected(_context, _myId);

            assertEquals(TO_MASTER, newState);

            // CASE 2: Got MasterIsElected for someone else - switch to PENDING
            HighAvailabilityMemberState newStateCase2 = TO_MASTER.masterIsElected(_context, new InstanceId(2));

            assertEquals(PENDING, newStateCase2);
        }