AsyncJobLauncherImpl implements AsyncJobLauncher,
                                  InitializingBean { @Override public void afterPropertiesSet() throws Exception { Assert.state(executorJobTerminateWaitIntervalTime > 0, LOGGER .getLogMessage(LogId.EAL025056, this.getClass().getSimpleName(), "executor.jobTerminateWaitInterval")); int maxPoolSize = threadPoolTaskExecutor.getMaxPoolSize(); LOGGER.debug(LogId.DAL025054, maxPoolSize, fair); taskPoolLimit = new Semaphore(maxPoolSize, fair); } AsyncJobLauncherImpl(ThreadPoolTaskExecutor threadPoolTaskExecutor,
            AsyncJobWorker asyncJobWorker); void setFair(boolean fair); @Override void executeJob(final String jobSequenceId); @Override void shutdown(); @Override void afterPropertiesSet();  }
@Test public void testAfterPropertiesSet02() throws Exception { doReturn(2).when(threadPoolTaskExecutor).getMaxPoolSize(); AsyncJobLauncherImpl asyncJobLauncher = new AsyncJobLauncherImpl( threadPoolTaskExecutor, asyncJobWorker); asyncJobLauncher.executorJobTerminateWaitIntervalTime = 1L; asyncJobLauncher.afterPropertiesSet(); assertEquals(2, asyncJobLauncher.taskPoolLimit.availablePermits()); assertTrue(asyncJobLauncher.taskPoolLimit.isFair()); }
@Test public void testAfterPropertiesSet04() throws Exception { AsyncJobLauncherImpl asyncJobLauncher = new AsyncJobLauncherImpl( threadPoolTaskExecutor, asyncJobWorker); asyncJobLauncher.executorJobTerminateWaitIntervalTime = -1; try { asyncJobLauncher.afterPropertiesSet(); fail(); } catch (IllegalStateException e) { assertEquals( "[EAL025056] [Assertion failed] - AsyncJobLauncherImpl requires to set executor.jobTerminateWaitInterval. please confirm the settings.", e.getMessage()); } }