From ca5bf6755694e6ef43f8e4ad8ee1b55d2abc3a4d Mon Sep 17 00:00:00 2001 From: nebhale Date: Fri, 22 Feb 2008 13:32:33 +0000 Subject: [PATCH] [BUILD-63] and complete. --- spring-batch-execution/.springBeans | 16 ++++++- spring-batch-execution/pom.xml | 5 +++ .../configuration/BatchNamespaceHandler.java | 28 +++++++++++-- .../configuration/spring-batch-1.0.xsd | 42 +++++++++++++++---- ...espaceHandlerTaskletStepMissingTasklet.xml | 5 +++ .../BatchNamespaceHandlerTaskletStepOk.xml | 8 +++- ...NamespaceHandlerTaskletStepRerunAlways.xml | 20 +++++++++ ...spaceHandlerTaskletStepRerunIncomplete.xml | 20 +++++++++ ...hNamespaceHandlerTaskletStepRerunNever.xml | 20 +++++++++ 9 files changed, 150 insertions(+), 14 deletions(-) create mode 100644 spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunAlways.xml create mode 100644 spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunIncomplete.xml create mode 100644 spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunNever.xml diff --git a/spring-batch-execution/.springBeans b/spring-batch-execution/.springBeans index e94082c10..b88b0c771 100644 --- a/spring-batch-execution/.springBeans +++ b/spring-batch-execution/.springBeans @@ -1,7 +1,7 @@ 1 - + @@ -16,7 +16,19 @@ src/test/resources/beanRefContext.xml src/test/resources/org/springframework/batch/execution/bootstrap/support/job.xml src/test/resources/org/springframework/batch/execution/bootstrap/support/test-environment.xml - src/test/java/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepOk.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryDb2.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryDerby.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryHsql.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryMissingDataSource.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryMySql.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryOk.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryOracle.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerJobRepositoryPostgres.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepMissingTasklet.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepOk.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunAlways.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunIncomplete.xml + src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunNever.xml diff --git a/spring-batch-execution/pom.xml b/spring-batch-execution/pom.xml index 1c5008562..fa0601f3c 100644 --- a/spring-batch-execution/pom.xml +++ b/spring-batch-execution/pom.xml @@ -73,6 +73,11 @@ org.springframework spring-beans + + org.springframework + spring-context + test + org.springframework spring-core diff --git a/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchNamespaceHandler.java b/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchNamespaceHandler.java index b4dd43208..b1df581c7 100644 --- a/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchNamespaceHandler.java +++ b/spring-batch-execution/src/main/java/org/springframework/batch/execution/configuration/BatchNamespaceHandler.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-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.execution.configuration; import org.springframework.beans.factory.xml.BeanDefinitionParser; @@ -6,19 +22,23 @@ import org.springframework.beans.factory.xml.NamespaceHandlerSupport; /** * NamespaceHandler for the batch-execution namespace. * - *

Provides a {@link BeanDefinitionParser} for the <batch:job> tag. A job - * tag can include nested chunked-step and tasklet-step tags. + *

+ * Provides a {@link BeanDefinitionParser} for the <batch:job> tag. A job tag can + * include nested chunked-step and tasklet-step tags. + * + *

+ * Provides a {@link BeanDefinitionParser} for the <batch:job-repository> tag. * * @author Ben Hale */ public class BatchNamespaceHandler extends NamespaceHandlerSupport { /** - * Register the {@link BeanDefinitionParser BeanDefinitionParser} for the - * 'job', tag. + * Register the {@link BeanDefinitionParser BeanDefinitionParser} for the 'job', tag. */ public void init() { registerBeanDefinitionParser("job", new JobBeanDefinitionParser()); + registerBeanDefinitionParser("job-repository", new JobRepositoryBeanDefinitionParser()); } } diff --git a/spring-batch-execution/src/main/resources/org/springframework/batch/execution/configuration/spring-batch-1.0.xsd b/spring-batch-execution/src/main/resources/org/springframework/batch/execution/configuration/spring-batch-1.0.xsd index 41a228a0a..47fa98c3e 100644 --- a/spring-batch-execution/src/main/resources/org/springframework/batch/execution/configuration/spring-batch-1.0.xsd +++ b/spring-batch-execution/src/main/resources/org/springframework/batch/execution/configuration/spring-batch-1.0.xsd @@ -4,6 +4,34 @@ targetNamespace="http://www.springframework.org/schema/batch" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -21,7 +49,7 @@ - + @@ -31,7 +59,7 @@ - + @@ -41,17 +69,17 @@ - + - + - @@ -71,12 +99,12 @@ - + - + diff --git a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepMissingTasklet.xml b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepMissingTasklet.xml index ad1b65994..ad416e6bc 100644 --- a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepMissingTasklet.xml +++ b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepMissingTasklet.xml @@ -5,8 +5,13 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd"> + + + + \ No newline at end of file diff --git a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepOk.xml b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepOk.xml index 25e1ac598..87d6d5fac 100644 --- a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepOk.xml +++ b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepOk.xml @@ -5,10 +5,16 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-1.0.xsd"> + + - + + + \ No newline at end of file diff --git a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunAlways.xml b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunAlways.xml new file mode 100644 index 000000000..867002cba --- /dev/null +++ b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunAlways.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunIncomplete.xml b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunIncomplete.xml new file mode 100644 index 000000000..c29e12a7b --- /dev/null +++ b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunIncomplete.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunNever.xml b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunNever.xml new file mode 100644 index 000000000..9c1945172 --- /dev/null +++ b/spring-batch-execution/src/test/resources/org/springframework/batch/execution/configuration/BatchNamespaceHandlerTaskletStepRerunNever.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + \ No newline at end of file