//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void shouldNotRescheduleAJobWhenStopped() public virtual void ShouldNotRescheduleAJobWhenStopped() { // given PruningScheduler scheduler = new PruningScheduler(_logPruner, _jobScheduler, 20L, NullLogProvider.Instance); assertNull(_jobScheduler.Job); scheduler.Start(); assertNotNull(_jobScheduler.Job); // when scheduler.Stop(); // then assertNull(_jobScheduler.Job); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test(timeout = 5000) public void shouldWaitOnStopUntilTheRunningCheckpointIsDone() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void ShouldWaitOnStopUntilTheRunningCheckpointIsDone() { // given //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.concurrent.atomic.AtomicReference<Throwable> ex = new java.util.concurrent.atomic.AtomicReference<>(); AtomicReference <Exception> ex = new AtomicReference <Exception>(); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final org.neo4j.test.DoubleLatch checkPointerLatch = new org.neo4j.test.DoubleLatch(1); DoubleLatch checkPointerLatch = new DoubleLatch(1); RaftLogPruner logPruner = new RaftLogPrunerAnonymousInnerClass(this, Clock.systemUTC(), checkPointerLatch); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final PruningScheduler scheduler = new PruningScheduler(logPruner, jobScheduler, 20L, org.neo4j.logging.NullLogProvider.getInstance()); PruningScheduler scheduler = new PruningScheduler(logPruner, _jobScheduler, 20L, NullLogProvider.Instance); // when scheduler.Start(); Thread runCheckPointer = new Thread(_jobScheduler.runJob); runCheckPointer.Start(); checkPointerLatch.WaitForAllToStart(); Thread stopper = new Thread(() => { try { scheduler.Stop(); } catch (Exception throwable) { ex.set(throwable); } }); stopper.Start(); checkPointerLatch.Finish(); runCheckPointer.Join(); stopper.Join(); assertNull(ex.get()); }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @Test public void stoppedJobCantBeInvoked() throws Throwable //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: public virtual void StoppedJobCantBeInvoked() { PruningScheduler scheduler = new PruningScheduler(_logPruner, _jobScheduler, 10L, NullLogProvider.Instance); scheduler.Start(); _jobScheduler.runJob(); // verify checkpoint was triggered verify(_logPruner).prune(); // simulate scheduled run that was triggered just before stop scheduler.Stop(); scheduler.Start(); _jobScheduler.runJob(); // logPruner should not be invoked now because job stopped verifyNoMoreInteractions(_logPruner); }