@Test public void testSetWorkRate() { executor.setWorkFactor(1.0); assertEquals(1.0, executor.getWorkFactor()); executor.setWorkFactor(0.5); assertEquals(0.5, executor.getWorkFactor()); executor.setWorkFactor(ThrottlingExecutor.MIN_WORK_FACTOR); assertEquals(ThrottlingExecutor.MIN_WORK_FACTOR, executor.getWorkFactor()); }
@Test public void testInitialState() { ThrottlingExecutor throttler = new ThrottlingExecutor(MAX_NANOS); assertEquals(0, throttler.getPendingNanos()); assertEquals(1.0, throttler.getWorkFactor()); }
@Test public void testInitialState() { ThrottlingExecutor throttler = new ThrottlingExecutor(MAX_NANOS); assertEquals(0, throttler.getPendingNanos()); assertEquals(1.0, throttler.getWorkFactor()); }