@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) {
                    // Exception occurred.
                    result.throwable().printStackTrace();
                    fail();
                }
                // resolve BLogic instance from ApplicationContext.
                result.context().getBean("B000004BLogic", B000004BLogic.class);
                // resolve DAO instance from ApplicationContext.
                result.context().getBean(B000004Dao.class);
            }
        }
    } finally {
        executor.shutdown();
    }
}