@Ignore("Disabled because task is still executed when concurrency is switched off") @Test public void cannotExecuteWhenConcurrencyIsSwitchedOff() throws Exception { SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor(); executor.setConcurrencyLimit(ConcurrencyThrottleSupport.NO_CONCURRENCY); assertFalse(executor.isThrottleActive()); exception.expect(IllegalStateException.class); executor.execute(new NoOpRunnable()); }
public void testCannotExecuteWhenConcurrencyIsSwitchedOff() throws Exception { SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor(); executor.setConcurrencyLimit(ConcurrencyThrottleSupport.NO_CONCURRENCY); assertFalse(executor.isThrottleActive()); try { executor.execute(new NoOpRunnable()); } catch (IllegalStateException expected) { } }