Exemplo n.º 1
0
		public override void SetUp()
		{
			base.SetUp();

			var definitions = TestSupport.SetupDefinitions(typeof(PersistableItem), typeof(PersistableItem2), typeof(PersistablePart));

			accessor = new LuceneAccesor(new ThreadContext(), new DatabaseSection());
			indexer = new ContentIndexer(new LuceneIndexer(accessor), new TextExtractor(new IndexableDefinitionExtractor(definitions)));
			searcher = new LuceneContentSearcher(accessor, persister);
			worker = new AsyncWorker();
			asyncIndexer = new AsyncIndexer(indexer, persister, worker, Rhino.Mocks.MockRepository.GenerateStub<IErrorNotifier>(), new DatabaseSection());
			tracker = new ContentChangeTracker(asyncIndexer, persister, new N2.Plugin.ConnectionMonitor(), new DatabaseSection());

			accessor.LockTimeout = 1L;
			indexer.Clear();
			root = CreateOneItem<PersistableItem>(1, "The Root Page", null);
		}
		public void Tracker_IsNotMonitoring_OnMachineWithOtherName()
		{
			var monitor = new N2.Plugin.ConnectionMonitor();
			monitor.SetConnected(N2.Edit.Installation.SystemStatusLevel.UpAndRunning);
			tracker = new ContentChangeTracker(asyncIndexer, persister, monitor, new DatabaseSection { Search = new SearchElement { IndexOnMachineNamed = "SomeOtherMachine" } });
			tracker.IsMonitoring.ShouldBe(false);
		}