diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java index a6c9593e9..3ec2aab18 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/repository/support/MapJobRepositoryFactoryBean.java @@ -8,12 +8,16 @@ import org.springframework.batch.core.repository.dao.MapJobExecutionDao; import org.springframework.batch.core.repository.dao.MapJobInstanceDao; import org.springframework.batch.core.repository.dao.MapStepExecutionDao; import org.springframework.batch.core.repository.dao.StepExecutionDao; +import org.springframework.batch.support.transaction.ResourcelessTransactionManager; import org.springframework.beans.factory.FactoryBean; /** * A {@link FactoryBean} that automates the creation of a * {@link SimpleJobRepository} using non-persistent in-memory DAO - * implementations. + * implementations. This repository is only really intended for use in testing + * and rapid prototyping. In such settings you might find that + * {@link ResourcelessTransactionManager} is useful (as long as your business + * logic does not use a relational database). * * @author Robert Kasanicky */ diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleStepFactoryBean.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleStepFactoryBean.java index 5cc34576d..fa0df5091 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleStepFactoryBean.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/item/SimpleStepFactoryBean.java @@ -106,12 +106,12 @@ public class SimpleStepFactoryBean implements FactoryBean, BeanNameAware { private int throttleLimit = TaskExecutorRepeatTemplate.DEFAULT_THROTTLE_LIMIT; /** - * + * Default constructor for {@link SimpleStepFactoryBean}. */ public SimpleStepFactoryBean() { super(); } - + /** * Set the bean name property, which will become the name of the * {@link Step} when it is created. @@ -268,11 +268,12 @@ public class SimpleStepFactoryBean implements FactoryBean, BeanNameAware { /** * Create a {@link Step} from the configuration provided. * - * @see org.springframework.beans.factory.FactoryBean#getObject() + * @see FactoryBean#getObject() */ public final Object getObject() throws Exception { TaskletStep step = new TaskletStep(getName()); applyConfiguration(step); + step.afterPropertiesSet(); return step; } @@ -480,7 +481,7 @@ public class SimpleStepFactoryBean implements FactoryBean, BeanNameAware { ChunkOrientedTasklet tasklet = new ChunkOrientedTasklet(chunkProvider, chunkProcessor); step.setTasklet(tasklet); - + } /** diff --git a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java index d57c3939c..03acf995a 100644 --- a/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java +++ b/spring-batch-core/src/test/java/org/springframework/batch/core/step/item/SimpleStepFactoryBeanTests.java @@ -81,6 +81,11 @@ public class SimpleStepFactoryBeanTests { MapStepExecutionDao.clear(); } + @Test(expected=IllegalArgumentException.class) + public void testMandatoryProperties() throws Exception { + new SimpleStepFactoryBean().getObject(); + } + @Test public void testSimpleJob() throws Exception {