コード例 #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testConversationStop()
        public virtual void TestConversationStop()
        {
            RequestContext requestContext = RequestContext;

            _conversationManager = ConversationManager;

            Conversation conversation = mock(typeof(Conversation));

            when(conversation.Active).thenReturn(true);

            TimedRepository conversationStorage = mock(typeof(TimedRepository));

            when(conversationStorage.end(requestContext)).thenReturn(conversation);
            _conversationManager.conversations = conversationStorage;

            _conversationManager.stop(requestContext);

            verify(conversationStorage).end(requestContext);
            verify(conversation).stop();
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testConversationWorkflow() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void TestConversationWorkflow()
        {
            RequestContext requestContext = RequestContext;

            _conversationManager = ConversationManager;
            TimedRepository conversationStorage = mock(typeof(TimedRepository));

            _conversationManager.conversations = conversationStorage;

            _conversationManager.begin(requestContext);
            _conversationManager.acquire(requestContext);
            _conversationManager.release(requestContext);
            _conversationManager.end(requestContext);

            InOrder conversationOrder = inOrder(conversationStorage);

            conversationOrder.verify(conversationStorage).begin(requestContext);
            conversationOrder.verify(conversationStorage).acquire(requestContext);
            conversationOrder.verify(conversationStorage).release(requestContext);
            conversationOrder.verify(conversationStorage).end(requestContext);
        }
コード例 #3
0
 protected internal override TimedRepository <RequestContext, Conversation> CreateConversationStore()
 {
     ConversationStore = new TimedRepository <RequestContext, Conversation>(ConversationFactory, ConversationReaper, 1, Clocks.systemClock());
     return(ConversationStore);
 }
コード例 #4
0
 public override void Stop()
 {
     _staleReaperJob.cancel(false);
     Conversations = null;
 }
コード例 #5
0
 public override void Start()
 {
     Conversations   = CreateConversationStore();
     _staleReaperJob = _spi.scheduleRecurringJob(Group.SLAVE_LOCKS_TIMEOUT, _activityCheckIntervalMillis, Conversations);
 }