ApplicationContextResolverImpl implements ApplicationContextResolver, InitializingBean,
                   DisposableBean { @Override public void afterPropertiesSet() { if (this.commonContextClassPath == null || this.commonContextClassPath.length == 0) { return; } this.parent = new ClassPathXmlApplicationContext(this.commonContextClassPath); }  @Override ApplicationContext resolveApplicationContext(); @Override ApplicationContext resolveApplicationContext(
            BatchJobData batchJobData); @Override void closeApplicationContext(ApplicationContext applicationContext); @Override void afterPropertiesSet(); void setCommonContextClassPath(String[] commonContextClassPath); @Override void destroy();  }
@Test public void testResolveApplicationContextBatchJobData05() throws Exception { BatchJobData batchJobData = new BatchJobData(); batchJobData.setJobAppCd("B000004"); target.classpath = "beansDef/"; target.parent = new ClassPathXmlApplicationContext(new String[]{ "beansDef/dataSourceForApplicationContextResolverImplTest.xml", "beansDef/commonContext.xml"}); final int maxThread = 80; final int trialCount = 3; final ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); executor.setCorePoolSize(maxThread); executor.setMaxPoolSize(maxThread); executor.setQueueCapacity(trialCount * maxThread); executor.afterPropertiesSet(); final BlockingQueue<Result> blockingQueue = new ArrayBlockingQueue<>(maxThread * trialCount); final ApplicationContextResolverParallelExecutionThread thread = new ApplicationContextResolverParallelExecutionThread(target, blockingQueue, batchJobData); try { for (int i = 0; i < trialCount; i++) { for (int j = 0; j < maxThread; j++) { executor.submit(thread); } for (int j = 0; j < maxThread; j++) { Result result = blockingQueue.take(); if (result.status != Status.SUCCESS) { result.throwable().printStackTrace(); fail(); } result.context().getBean("B000004BLogic", B000004BLogic.class); result.context().getBean(B000004Dao.class); } } } finally { executor.shutdown(); } }
@Test public void testAfterPropertiesSet01() throws Exception { ApplicationContextResolverImpl target = new ApplicationContextResolverImpl(); target.afterPropertiesSet(); assertNull(target.parent); }