コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldCleanExistentLockSessionOnFinishOffChannel()
        public virtual void ShouldCleanExistentLockSessionOnFinishOffChannel()
        {
            Master master = mock(typeof(Master));
            ConversationManager conversationManager = mock(typeof(ConversationManager));
            LogEntryReader <ReadableClosablePositionAwareChannel> logEntryReader = new VersionAwareLogEntryReader <ReadableClosablePositionAwareChannel>();
            MasterServer   masterServer   = new MasterServer(master, mock(typeof(LogProvider)), mock(typeof(Server.Configuration)), mock(typeof(TxChecksumVerifier)), mock(typeof(ByteCounterMonitor)), mock(typeof(RequestMonitor)), conversationManager, logEntryReader);
            RequestContext requestContext = new RequestContext(1L, 1, 1, 0, 0L);

            masterServer.StopConversation(requestContext);

            Mockito.verify(conversationManager).stop(requestContext);
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testForceFlush()
        public virtual void TestForceFlush()
        {
            DirectRecordAccessSet recordAccessSet = Mockito.mock(typeof(DirectRecordAccessSet));

            BatchInserterImpl.BatchedFlushStrategy flushStrategy = CreateFlushStrategy(recordAccessSet, 2);

            flushStrategy.ForceFlush();
            flushStrategy.ForceFlush();
            Mockito.verify(recordAccessSet, Mockito.times(2)).commit();

            flushStrategy.Flush();
            flushStrategy.ForceFlush();
            Mockito.verify(recordAccessSet, Mockito.times(3)).commit();
        }
コード例 #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testResetBatchCounterOnForce()
        public virtual void TestResetBatchCounterOnForce()
        {
            DirectRecordAccessSet recordAccessSet = Mockito.mock(typeof(DirectRecordAccessSet));

            BatchInserterImpl.BatchedFlushStrategy flushStrategy = CreateFlushStrategy(recordAccessSet, 3);

            flushStrategy.Flush();
            flushStrategy.Flush();
            Mockito.verifyZeroInteractions(recordAccessSet);

            flushStrategy.ForceFlush();
            Mockito.verify(recordAccessSet).commit();
            Mockito.verifyNoMoreInteractions(recordAccessSet);

            flushStrategy.Flush();
            flushStrategy.Flush();
        }