Пример #1
0
 public void DoWork_CalledAfterAbortAll()
 {
     Assert.Throws <InvalidOperationException>(() =>
     {
         _unitUnderTest.AbortAll();
         _unitUnderTest.DoWork(() => System.Threading.Thread.Sleep(10));
     });
 }
Пример #2
0
        protected virtual void CheckForHardStopRequest()
        {
            if (_crawlContext.IsCrawlHardStopRequested)
            {
                if (!_crawlStopReported)
                {
                    _logger.InfoFormat("Hard crawl stop requested for site [{0}]!", _crawlContext.RootUri);
                    _crawlStopReported = true;
                }

                _scheduler.Clear();
                _threadManager.AbortAll();
                _scheduler.Clear();//to be sure nothing was scheduled since first call to clear()

                //Set all events to null so no more events are fired
                PageCrawlStarting             = null;
                PageCrawlCompleted            = null;
                PageCrawlDisallowed           = null;
                PageLinksCrawlDisallowed      = null;
                PageCrawlStartingAsync        = null;
                PageCrawlCompletedAsync       = null;
                PageCrawlDisallowedAsync      = null;
                PageLinksCrawlDisallowedAsync = null;
            }
        }
Пример #3
0
        protected virtual void CheckForHardStopRequest()
        {
            if (_crawlContext.IsCrawlHardStopRequested)
            {
                if (!_crawlStopReported)
                {
                    _crawlStopReported = true;
                }

                _scheduler.Clear();
                _threadManager.AbortAll();
                _scheduler.Clear(); //to be sure nothing was scheduled since first call to clear()

                //Set all events to null so no longer raised.
                PageCrawlCompletedAsync = null;
                //PageCrawlStarting = null;
                //PageCrawlCompleted = null;
                //PageCrawlDisallowed = null;
                //PageLinksCrawlDisallowed = null;
            }
        }
Пример #4
0
        protected virtual void CheckForHardStopRequest()
        {
            if (_crawlContext.IsCrawlHardStopRequested)
            {
                _scheduler.Clear();
                _threadManager.AbortAll();
                _scheduler.Clear();

                //Set all events to null so no more events are fired
                //PageCrawlStarting = null;
                //PageCrawlCompleted = null;
                //PageCrawlDisallowed = null;
                //PageLinksCrawlDisallowed = null;
                //PageCrawlStartingAsync = null;
                //PageCrawlCompletedAsync = null;
                //PageCrawlDisallowedAsync = null;
                //PageLinksCrawlDisallowedAsync = null;
                ////add by roc
                //CrawlCompleted = null;
                //CrawlCompletedAsync = null;
            }
        }
Пример #5
0
 public void DoWork_CalledAfterAbortAll()
 {
     _unitUnderTest.AbortAll();
     _unitUnderTest.DoWork(() => System.Threading.Thread.Sleep(10));
 }