示例#1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void skipUpdatePullingSchedulingWithZeroInterval()
        public virtual void SkipUpdatePullingSchedulingWithZeroInterval()
        {
            JobScheduler          jobScheduler    = mock(typeof(JobScheduler));
            UpdatePullerScheduler pullerScheduler = new UpdatePullerScheduler(jobScheduler, NullLogProvider.Instance, _updatePuller, 0);

            // when start puller scheduler - nothing should be scheduled
            pullerScheduler.Init();

            verifyZeroInteractions(jobScheduler, _updatePuller);

            // should be able shutdown scheduler
            pullerScheduler.Shutdown();
        }
示例#2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void scheduleUpdatePulling() throws Throwable
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ScheduleUpdatePulling()
        {
            OnDemandJobScheduler  jobScheduler    = new OnDemandJobScheduler(false);
            UpdatePullerScheduler pullerScheduler = new UpdatePullerScheduler(jobScheduler, NullLogProvider.Instance, _updatePuller, 10);

            // schedule update pulling and run it
            pullerScheduler.Init();
            jobScheduler.RunJob();

            verify(_updatePuller).pullUpdates();
            assertNotNull("Job should be scheduled", jobScheduler.Job);

            // stop scheduler - job should be canceled
            pullerScheduler.Shutdown();

            assertNull("Job should be canceled", jobScheduler.Job);
        }