//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldOnlyScheduleOnePersistentDownloaderTaskAtTheTime() throws InterruptedException //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldOnlyScheduleOnePersistentDownloaderTaskAtTheTime() { AtomicInteger schedules = new AtomicInteger(); CountingJobScheduler countingJobScheduler = new CountingJobScheduler(schedules, _centralJobScheduler); Semaphore blockDownloader = new Semaphore(0); CoreStateDownloader coreStateDownloader = new BlockingCoreStateDownloader(blockDownloader); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.causalclustering.core.state.CommandApplicationProcess applicationProcess = mock(org.neo4j.causalclustering.core.state.CommandApplicationProcess.class); CommandApplicationProcess applicationProcess = mock(typeof(CommandApplicationProcess)); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.logging.Log log = mock(org.neo4j.logging.Log.class); Log log = mock(typeof(Log)); CoreStateDownloaderService coreStateDownloaderService = new CoreStateDownloaderService(countingJobScheduler, coreStateDownloader, applicationProcess, LogProvider(log), new NoTimeout(), () => _dbHealth, new Monitors()); coreStateDownloaderService.ScheduleDownload(_catchupAddressProvider); Thread.Sleep(50); coreStateDownloaderService.ScheduleDownload(_catchupAddressProvider); coreStateDownloaderService.ScheduleDownload(_catchupAddressProvider); coreStateDownloaderService.ScheduleDownload(_catchupAddressProvider); assertEquals(1, schedules.get()); blockDownloader.release(); }
private void InitializeInstanceFields() { _jobScheduler = new CountingJobScheduler(_scheduledJobs, createInitialisedScheduler()); _updatePuller = new SlaveUpdatePuller(_requestContextFactory, _master, _lastUpdateTime, _logProvider, _instanceId, _databaseAvailabilityGuard, _invalidEpochHandler, _jobScheduler, _monitor); }