Exemple #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup()
        public virtual void Setup()
        {
            HighAvailabilityMemberContext context = new SimpleHighAvailabilityMemberContext(_me, false);

            ClusterMemberEvents events = mock(typeof(ClusterMemberEvents));

            HighAvailabilityMemberStateMachineTest.ClusterMemberListenerContainer memberListenerContainer = mockAddClusterMemberListener(events);

            _election = mock(typeof(Election));

            _stateMachine = BuildMockedStateMachine(context, events, _election);
            _stateMachine.init();
            _memberListener = memberListenerContainer.Get();
            HighAvailabilityMemberStateMachineTest.HAStateChangeListener probe = new HighAvailabilityMemberStateMachineTest.HAStateChangeListener();
            _stateMachine.addHighAvailabilityMemberListener(probe);
        }
Exemple #2
0
 private HighAvailabilityMemberStateMachine BuildMockedStateMachine(HighAvailabilityMemberContext context, ClusterMemberEvents events, Election election)
 {
     return((new HighAvailabilityMemberStateMachineTest.StateMachineBuilder()).WithContext(context).withEvents(events).withElection(election).build());
 }