public void DoWork_CalledAfterAbortAll() { Assert.Throws <InvalidOperationException>(() => { _unitUnderTest.AbortAll(); _unitUnderTest.DoWork(() => System.Threading.Thread.Sleep(10)); }); }
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; } }
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; } }
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; } }
public void DoWork_CalledAfterAbortAll() { _unitUnderTest.AbortAll(); _unitUnderTest.DoWork(() => System.Threading.Thread.Sleep(10)); }