diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/ClassPathXmlApplicationContextJobFactory.java b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextJobFactory.java similarity index 98% rename from spring-batch-samples/src/main/java/org/springframework/batch/sample/ClassPathXmlApplicationContextJobFactory.java rename to spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextJobFactory.java index 40d18748a..b61633602 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/ClassPathXmlApplicationContextJobFactory.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextJobFactory.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.springframework.batch.sample; +package org.springframework.batch.core.configuration.support; import java.util.List; diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextJobFactoryTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextJobFactoryTests.java new file mode 100644 index 000000000..240e36c06 --- /dev/null +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/configuration/support/ClassPathXmlApplicationContextJobFactoryTests.java @@ -0,0 +1,44 @@ +/* + * Copyright 2006-2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.batch.core.configuration.support; + +import org.springframework.util.ClassUtils; + +import junit.framework.TestCase; + +/** + * @author Dave Syer + * + */ +public class ClassPathXmlApplicationContextJobFactoryTests extends TestCase { + + private ClassPathXmlApplicationContextJobFactory factory = new ClassPathXmlApplicationContextJobFactory("test-job", ClassUtils.addResourcePathToPackagePath(getClass(), "test-context.xml"), null); + + /** + * Test method for {@link org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextJobFactory#createJob()}. + */ + public void testCreateJob() { + assertNotNull(factory.createJob()); + } + + /** + * Test method for {@link org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextJobFactory#getJobName()}. + */ + public void testGetJobName() { + assertEquals("test-job", factory.getJobName()); + } + +} diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/launch/TaskExecutorLauncher.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/launch/TaskExecutorLauncher.java index 5debb8525..40e2f2537 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/launch/TaskExecutorLauncher.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/launch/TaskExecutorLauncher.java @@ -20,8 +20,8 @@ import java.util.List; import org.springframework.batch.core.Job; import org.springframework.batch.core.configuration.JobRegistry; +import org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextJobFactory; import org.springframework.batch.core.repository.DuplicateJobException; -import org.springframework.batch.sample.ClassPathXmlApplicationContextJobFactory; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; diff --git a/spring-batch-samples/src/main/java/org/springframework/batch/sample/quartz/QuartzBatchLauncher.java b/spring-batch-samples/src/main/java/org/springframework/batch/sample/quartz/QuartzBatchLauncher.java index 28b9c0f4c..439f574b1 100644 --- a/spring-batch-samples/src/main/java/org/springframework/batch/sample/quartz/QuartzBatchLauncher.java +++ b/spring-batch-samples/src/main/java/org/springframework/batch/sample/quartz/QuartzBatchLauncher.java @@ -20,8 +20,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.batch.core.Job; import org.springframework.batch.core.configuration.JobRegistry; +import org.springframework.batch.core.configuration.support.ClassPathXmlApplicationContextJobFactory; import org.springframework.batch.core.repository.DuplicateJobException; -import org.springframework.batch.sample.ClassPathXmlApplicationContextJobFactory; import org.springframework.beans.factory.config.AutowireCapableBeanFactory; import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.xml.XmlBeanFactory; diff --git a/spring-batch-samples/src/site/resources/images/spring-batch-football-graph.jpg b/spring-batch-samples/src/site/resources/images/spring-batch-football-graph.jpg new file mode 100644 index 000000000..d8898c135 Binary files /dev/null and b/spring-batch-samples/src/site/resources/images/spring-batch-football-graph.jpg differ diff --git a/spring-batch-samples/src/test/java/org/springframework/batch/sample/dao/JdbcJobRepositoryTests.java b/spring-batch-samples/src/test/java/org/springframework/batch/sample/dao/JdbcJobRepositoryTests.java index a5ccfbf3f..0b9e26e61 100644 --- a/spring-batch-samples/src/test/java/org/springframework/batch/sample/dao/JdbcJobRepositoryTests.java +++ b/spring-batch-samples/src/test/java/org/springframework/batch/sample/dao/JdbcJobRepositoryTests.java @@ -195,7 +195,7 @@ public class JdbcJobRepositoryTests extends AbstractTransactionalDataSourceSprin cacheJobIds(execution); int count = 0; - while (list.size() == 0 && count++ < 10) { + while (list.size() == 0 && count++ < 100) { Thread.sleep(200); }