コード例 #1
0
 private void NotifyCommitted(long commitIndex)
 {
     _applicationProcess.notifyCommitted(commitIndex);
 }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldApplyCommittedCommand() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldApplyCommittedCommand()
        {
            // given
            RaftLogCommitIndexMonitor listener = mock(typeof(RaftLogCommitIndexMonitor));

            _monitors.addMonitorListener(listener);

            InOrder inOrder = inOrder(_coreState, _commandDispatcher);

            _raftLog.append(new RaftLogEntry(0, Operation(_nullTx)));
            _raftLog.append(new RaftLogEntry(0, Operation(_nullTx)));
            _raftLog.append(new RaftLogEntry(0, Operation(_nullTx)));

            // when
            _applicationProcess.notifyCommitted(2);
            _applicationProcess.start();

            // then
            inOrder.verify(_coreState).commandDispatcher();
            inOrder.verify(_commandDispatcher).dispatch(eq(_nullTx), eq(0L), AnyCallback());
            inOrder.verify(_commandDispatcher).dispatch(eq(_nullTx), eq(1L), AnyCallback());
            inOrder.verify(_commandDispatcher).dispatch(eq(_nullTx), eq(2L), AnyCallback());
            inOrder.verify(_commandDispatcher).close();

            verify(listener).commitIndex(2);
        }