示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testPendingMasterIsElected()
        public virtual void TestPendingMasterIsElected()
        {
            // CASE 1: Got MasterIsElected for me - should switch to TO_MASTER
            HighAvailabilityMemberState newState = PENDING.masterIsElected(_context, _myId);

            assertEquals(TO_MASTER, newState);

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

            assertEquals(PENDING, newStateCase2);
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testPendingSlaveIsAvailable()
        public virtual void TestPendingSlaveIsAvailable()
        {
            // CASE 1: Got SlaveIsAvailable for me - should not happen, that's what TO_SLAVE exists for
            HighAvailabilityMemberState illegal = PENDING.slaveIsAvailable(_context, _myId, SampleUri);

            assertEquals(ILLEGAL, illegal);

            // CASE 2: Got SlaveIsAvailable for someone else - it's ok, remain in PENDING
            HighAvailabilityMemberState newState = PENDING.slaveIsAvailable(_context, new InstanceId(2), SampleUri);

            assertEquals(PENDING, newState);
        }
示例#3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testPendingMasterIsAvailable()
        public virtual void TestPendingMasterIsAvailable()
        {
            // CASE 1: Got MasterIsAvailable for me - should not happen
            HighAvailabilityMemberState illegal = PENDING.masterIsAvailable(_context, _myId, SampleUri);

            assertEquals(ILLEGAL, illegal);

            // CASE 2: Got MasterIsAvailable for someone else - should transition to TO_SLAVE
            // TODO test correct info is passed through to context
            HighAvailabilityMemberState newState = PENDING.masterIsAvailable(_context, new InstanceId(2), SampleUri);

            assertEquals(TO_SLAVE, newState);
        }