add spring3 profile

This commit is contained in:
dsyer
2009-07-07 12:56:53 +00:00
parent abd28fe07a
commit b0d6e0e2b9
53 changed files with 142 additions and 2629 deletions

View File

@@ -289,7 +289,6 @@
<id>samples</id>
<modules>
<module>spring-batch-infrastructure-tests</module>
<module>spring-batch-core-tests</module>
<module>spring-batch-samples</module>
<module>archetypes</module>
</modules>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>spring-batch-core-tests</name>
<comment>This plugin is an archetype that creates a command line batch sample from Spring Batch. Once installed you can create the archetype project using&lt;br/&gt;&lt;pre&gt;$ mvn archetype:create -DgroupId=com.mycompany -DartifactId=batch \ -DarchetypeGroupId=org.springframework.batch \ -DarchetypeArtifactId=spring-batch-cli -DarchetypeVersion=1.0-m3-SNAPSHOT&lt;/pre&gt;&lt;br/&gt; Then you should be able to &quot;cd batch; mvn package exec:exec&quot;, and see the app run.
</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View File

@@ -1,12 +0,0 @@
#Wed Jul 16 12:19:00 CEST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

View File

@@ -1,3 +0,0 @@
#Wed Apr 15 09:55:29 BST 2009
eclipse.preferences.version=1
org.springframework.ide.eclipse.beans.core.ignoreMissingNamespaceHandler=false

View File

@@ -1,82 +0,0 @@
#Wed Apr 15 09:55:29 BST 2009
eclipse.preferences.version=1
org.springframework.ide.eclipse.core.builders.enable.aopreferencemodelbuilder=true
org.springframework.ide.eclipse.core.builders.enable.beanmetadatabuilder=false
org.springframework.ide.eclipse.core.builders.enable.osgibundleupdater=true
org.springframework.ide.eclipse.core.enable.project.preferences=false
org.springframework.ide.eclipse.core.validator.enable.com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.enable.com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.enable.com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.enable.com.springsource.sts.bestpractices.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.enable.com.springsource.sts.server.quickfix.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.core.springvalidator=false
org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.applicationSymbolicNameRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.applicationVersionRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.bundleActivationPolicyRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.bundleActivatorRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.bundleManifestVersionRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.bundleNameRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.bundleSymbolicNameRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.bundleVersionRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.exportPackageRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.importRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.parsingProblemsRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.platform.ide.manifest.core.requireBundleRule-com.springsource.platform.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.applicationSymbolicNameRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.applicationVersionRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleActivationPolicyRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleActivatorRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleManifestVersionRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleNameRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleSymbolicNameRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleVersionRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.exportPackageRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.importRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.parsingProblemsRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.requireBundleRule-com.springsource.server.ide.manifest.core.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.AvoidDriverManagerDataSource-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.ImportElementsAtTopRulee-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.ParentBeanSpecifiesAbstractClassRule-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.RefElementRule-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.TooManyBeansInFileRule-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.UnnecessaryValueElementRule-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.UseBeanInheritance-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.importPackageVersionRule-com.springsource.sts.bestpractices.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.legacyxmlusage.jndiobjectfactory-com.springsource.sts.bestpractices.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.importBundleVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.importLibraryVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.importPackageVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.requireBundleVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanAlias-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanClass-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanConstructorArgument-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinition-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinitionHolder-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanFactory-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanInitDestroyMethod-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanReference-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.methodOverride-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.parsingProblems-org.springframework.ide.eclipse.beans.core.beansvalidator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.requiredProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=false
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.core.springClasspath-org.springframework.ide.eclipse.core.springvalidator=false
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.action-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.actionstate-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attribute-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attributemapper-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.beanaction-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationaction-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationresult-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.exceptionhandler-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.import-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.inputattribute-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.mapping-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.outputattribute-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.set-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.state-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.subflowstate-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.transition-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.variable-org.springframework.ide.eclipse.webflow.core.validator=true
org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.webflowstate-org.springframework.ide.eclipse.webflow.core.validator=true

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beansProjectDescription>
<version>1</version>
<pluginVersion><![CDATA[2.2.4.RELEASE]]></pluginVersion>
<configSuffixes>
<configSuffix><![CDATA[xml]]></configSuffix>
</configSuffixes>
<enableImports><![CDATA[true]]></enableImports>
<configs>
</configs>
<configSets>
<configSet>
<name><![CDATA[test]]></name>
<allowBeanDefinitionOverriding>true</allowBeanDefinitionOverriding>
<incomplete>false</incomplete>
<configs>
</configs>
</configSet>
</configSets>
</beansProjectDescription>

View File

@@ -1,229 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<artifactId>spring-batch-core-tests</artifactId>
<packaging>jar</packaging>
<name>Tests for Spring Batch Core against Spring 3.0</name>
<parent>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-parent</artifactId>
<version>2.0.2.CI-SNAPSHOT</version>
</parent>
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<bundlor.enabled>false</bundlor.enabled>
<spring.framework.version>3.0.0.BUILD-SNAPSHOT</spring.framework.version>
</properties>
<profiles>
<profile>
<id>strict</id>
<properties>
<maven.test.failure.ignore>false</maven.test.failure.ignore>
</properties>
</profile>
<profile>
<id>tiger</id>
<activation>
<jdk>1.5</jdk>
</activation>
<dependencies>
<dependency>
<groupId>stax</groupId>
<artifactId>stax</artifactId>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
</dependencies>
</profile>
<profile>
<id>staging</id>
<distributionManagement>
<repository>
<id>staging</id>
<url>file:///${user.dir}/target/staging</url>
</repository>
<snapshotRepository>
<id>staging</id>
<url>file:///${user.dir}/target/staging</url>
</snapshotRepository>
</distributionManagement>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.framework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>${pom.version}</version>
<exclusions>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
</dependency>
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>org.springframework.build.aws</groupId>
<artifactId>org.springframework.build.aws.maven</artifactId>
<version>2.0.0.RELEASE</version>
</extension>
</extensions>
<pluginManagement>
<plugins>
<plugin>
<groupId>com.springsource.bundlor</groupId>
<artifactId>com.springsource.bundlor.maven</artifactId>
<version>1.0.0.M1B</version>
<configuration>
<outputFile>${project.basedir}/src/main/resources/META-INF/MANIFEST.MF</outputFile>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<inherited>false</inherited>
<configuration>
<descriptorRefs>
<descriptorRef>project</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>com.springsource.bundlor</groupId>
<artifactId>com.springsource.bundlor.maven</artifactId>
<executions>
<execution>
<id>bundlor-transform</id>
<phase>package</phase>
<goals>
<goal>transform</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/*Tests.java</include>
</includes>
<excludes>
<exclude>**/Abstract*.java</exclude>
</excludes>
<junitArtifactName>junit:junit</junitArtifactName>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<configuration>
<mainClass>org.springframework.batch.core.launch.support.CommandLineJobRunner</mainClass>
<arguments>
<argument>classpath:/launch-context.xml</argument>
<argument>job1</argument>
</arguments>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<downloadUrl>http://www.springframework.org/download</downloadUrl>
<site>
<id>staging</id>
<url>file:///${user.dir}/target/staging/org.springframework.batch.archetype/${pom.artifactId}</url>
</site>
<repository>
<id>spring-milestone</id>
<name>Spring Milestone Repository</name>
<url>file:///${user.dir}/target/staging/milestone</url>
</repository>
<snapshotRepository>
<id>spring-snapshot</id>
<name>Spring Snapshot Repository</name>
<url>file:///${user.dir}/target/staging/snapshot</url>
</snapshotRepository>
</distributionManagement>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</project>

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Spring Batch: ${project.name}">
<bannerLeft>
<name>Spring Batch: ${project.name}</name>
<href>index.html</href>
</bannerLeft>
<skin>
<groupId>org.springframework.maven.skins</groupId>
<artifactId>maven-spring-skin</artifactId>
<version>1.0.5</version>
</skin>
<body>
<links>
<item name="${project.name}" href="index.html"/>
</links>
<menu ref="reports"/>
</body>
</project>

View File

@@ -1,151 +0,0 @@
package org.springframework.batch.core.scope;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepContext;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class AsyncStepScopeIntegrationTests implements BeanFactoryAware {
private Log logger = LogFactory.getLog(getClass());
@Autowired
@Qualifier("simple")
private Collaborator simple;
private TaskExecutor taskExecutor = new SimpleAsyncTaskExecutor();
private ListableBeanFactory beanFactory;
private int beanCount;
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = (ListableBeanFactory) beanFactory;
}
@Before
public void countBeans() {
StepSynchronizationManager.release();
beanCount = beanFactory.getBeanDefinitionCount();
}
@After
public void cleanUp() {
StepSynchronizationManager.close();
// Check that all temporary bean definitions are cleaned up
assertEquals(beanCount, beanFactory.getBeanDefinitionCount());
}
@Test
public void testSimpleProperty() throws Exception {
StepExecution stepExecution = new StepExecution("step", new JobExecution(0L), 123L);
ExecutionContext executionContext = stepExecution.getExecutionContext();
executionContext.put("foo", "bar");
StepSynchronizationManager.register(stepExecution);
assertEquals("bar", simple.getName());
}
@Test
public void testGetMultipleInMultipleThreads() throws Exception {
List<FutureTask<String>> tasks = new ArrayList<FutureTask<String>>();
for (int i = 0; i < 12; i++) {
final String value = "foo" + i;
final Long id = 123L + i;
FutureTask<String> task = new FutureTask<String>(new Callable<String>() {
public String call() throws Exception {
StepExecution stepExecution = new StepExecution(value, new JobExecution(0L), id);
ExecutionContext executionContext = stepExecution.getExecutionContext();
executionContext.put("foo", value);
StepContext context = StepSynchronizationManager.register(stepExecution);
logger.debug("Registered: " + context.getStepExecutionContext());
try {
return simple.getName();
}
finally {
StepSynchronizationManager.close();
}
}
});
tasks.add(task);
taskExecutor.execute(task);
}
int i = 0;
for (FutureTask<String> task : tasks) {
assertEquals("foo" + i, task.get());
i++;
}
}
@Test
public void testGetSameInMultipleThreads() throws Exception {
List<FutureTask<String>> tasks = new ArrayList<FutureTask<String>>();
final StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 123L);
ExecutionContext executionContext = stepExecution.getExecutionContext();
executionContext.put("foo", "foo");
StepSynchronizationManager.register(stepExecution);
assertEquals("foo", simple.getName());
for (int i = 0; i < 12; i++) {
final String value = "foo" + i;
FutureTask<String> task = new FutureTask<String>(new Callable<String>() {
public String call() throws Exception {
ExecutionContext executionContext = stepExecution.getExecutionContext();
executionContext.put("foo", value);
StepContext context = StepSynchronizationManager.register(stepExecution);
logger.debug("Registered: " + context.getStepExecutionContext());
try {
return simple.getName();
}
finally {
StepSynchronizationManager.close();
}
}
});
tasks.add(task);
taskExecutor.execute(task);
}
int i = 0;
for (FutureTask<String> task : tasks) {
assertEquals("foo", task.get());
i++;
}
// Don't close the outer scope until all tasks are finished. This should
// always be the case if using an AbstractStep
StepSynchronizationManager.close();
}
}

View File

@@ -1,9 +0,0 @@
package org.springframework.batch.core.scope;
public interface Collaborator {
String getName();
Collaborator getParent();
}

View File

@@ -1,24 +0,0 @@
package org.springframework.batch.core.scope;
import javax.annotation.PostConstruct;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
public class JobStartupRunner {
private Step step;
public void setStep(Step step) {
this.step = step;
}
@PostConstruct
public void launch() throws Exception {
StepExecution stepExecution = new StepExecution("step", new JobExecution(1L), 0L);
step.execute(stepExecution);
// expect no errors
}
}

View File

@@ -1,85 +0,0 @@
/*
* 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.scope;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Dave Syer
*
*/
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class PlaceholderTests {
@Autowired
private TestBean bean;
@Test
public void testString() throws Exception {
assertEquals("foo", bean.getName());
}
@Test
public void testInteger() throws Exception {
assertEquals(100, bean.getValue());
}
@Test
public void testStrings() throws Exception {
assertEquals(3, bean.getValues().length);
}
public static class TestBean {
private int value;
private String[] values;
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String[] getValues() {
return values;
}
public void setValues(String[] values) {
this.values = values;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
}

View File

@@ -1,72 +0,0 @@
package org.springframework.batch.core.scope;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopeDestructionCallbackIntegrationTests {
@Autowired
@Qualifier("proxied")
private Step proxied;
@Autowired
@Qualifier("nested")
private Step nested;
@Autowired
@Qualifier("foo")
private Collaborator foo;
@Before
@After
public void resetMessage() throws Exception {
TestDisposableCollaborator.message = "none";
TestAdvice.names.clear();
}
@Test
public void testDisposableScopedProxy() throws Exception {
assertNotNull(proxied);
proxied.execute(new StepExecution("step", new JobExecution(0L), 1L));
assertEquals("destroyed", TestDisposableCollaborator.message);
}
@Test
public void testDisposableInnerScopedProxy() throws Exception {
assertNotNull(nested);
nested.execute(new StepExecution("step", new JobExecution(0L), 1L));
assertEquals("destroyed", TestDisposableCollaborator.message);
}
@Test
public void testProxiedScopedProxy() throws Exception {
assertNotNull(nested);
nested.execute(new StepExecution("step", new JobExecution(0L), 1L));
assertEquals(4, TestAdvice.names.size());
assertEquals("bar", TestAdvice.names.get(0));
assertEquals("destroyed", TestDisposableCollaborator.message);
}
@Test
public void testProxiedNormalBean() throws Exception {
assertNotNull(nested);
String name = foo.getName();
assertEquals(1, TestAdvice.names.size());
assertEquals(name, TestAdvice.names.get(0));
}
}

View File

@@ -1,116 +0,0 @@
package org.springframework.batch.core.scope;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopeIntegrationTests {
@Autowired
@Qualifier("vanilla")
private Step vanilla;
@Autowired
@Qualifier("proxied")
private Step proxied;
@Autowired
@Qualifier("nested")
private Step nested;
@Autowired
@Qualifier("enhanced")
private Step enhanced;
@Autowired
@Qualifier("double")
private Step doubleEnhanced;
@Before
@After
public void start() {
StepSynchronizationManager.close();
TestStep.reset();
}
@Test
public void testScopeCreation() throws Exception {
vanilla.execute(new StepExecution("foo", new JobExecution(11L), 12L));
assertNotNull(TestStep.getContext());
assertNull(StepSynchronizationManager.getContext());
}
@Test
public void testScopedProxy() throws Exception {
proxied.execute(new StepExecution("foo", new JobExecution(11L), 31L));
assertTrue(TestStep.getContext().attributeNames().length > 0);
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
assertNotNull(collaborator);
assertEquals("bar", collaborator);
assertTrue("Scoped proxy not created", ((String) TestStep.getContext().getAttribute("collaborator.class"))
.startsWith("class $Proxy"));
}
@Test
public void testNestedScopedProxy() throws Exception {
nested.execute(new StepExecution("foo", new JobExecution(11L), 31L));
assertTrue(TestStep.getContext().attributeNames().length > 0);
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
assertNotNull(collaborator);
assertEquals("foo", collaborator);
String parent = (String) TestStep.getContext().getAttribute("parent");
assertNotNull(parent);
assertEquals("bar", parent);
assertTrue("Scoped proxy not created", ((String) TestStep.getContext().getAttribute("parent.class"))
.startsWith("class $Proxy"));
}
@Test
public void testExecutionContext() throws Exception {
StepExecution stepExecution = new StepExecution("foo", new JobExecution(11L), 1L);
ExecutionContext executionContext = new ExecutionContext();
executionContext.put("name", "spam");
stepExecution.setExecutionContext(executionContext);
proxied.execute(stepExecution);
assertTrue(TestStep.getContext().attributeNames().length > 0);
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
assertNotNull(collaborator);
assertEquals("bar", collaborator);
}
@Test
public void testScopedProxyForReference() throws Exception {
enhanced.execute(new StepExecution("foo", new JobExecution(11L), 123L));
assertTrue(TestStep.getContext().attributeNames().length > 0);
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
assertNotNull(collaborator);
assertEquals("bar", collaborator);
}
@Test
public void testScopedProxyForSecondReference() throws Exception {
doubleEnhanced.execute(new StepExecution("foo", new JobExecution(11L), 321L));
assertTrue(TestStep.getContext().attributeNames().length > 0);
String collaborator = (String) TestStep.getContext().getAttribute("collaborator");
assertNotNull(collaborator);
assertEquals("bar", collaborator);
}
}

View File

@@ -1,106 +0,0 @@
package org.springframework.batch.core.scope;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopeNestedIntegrationTests implements BeanFactoryAware {
@Autowired
@Qualifier("step1")
private Step step1;
@Autowired
@Qualifier("step2")
private Step step2;
@Autowired
@Qualifier("step3")
private Step step3;
@Autowired
@Qualifier("parent")
private Collaborator parent;
private StepExecution stepExecution;
private ConfigurableListableBeanFactory beanFactory;
private List<String> names;
/**
* {@inheritDoc}
*/
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = (ConfigurableListableBeanFactory) beanFactory;
}
@Before
public void setUp() {
TestStep.reset();
stepExecution = new StepExecution("step", new JobExecution(11L), 12L);
names = Arrays.asList(beanFactory.getBeanDefinitionNames());
}
@Test
public void testNestedScopedProxy() throws Exception {
assertNotNull(step1);
assertEquals("foo", parent.getName());
assertTrue("Proxy was not created for explicitly scoped bean", names.contains("lazyBindingProxy.bar"));
assertFalse("Proxy was created for unscoped bean", names.contains("foo"));
stepExecution.getExecutionContext().putString("bar", "bar");
step1.execute(stepExecution);
assertNotNull(stepExecution.getExecutionContext().getString("foo"));
assertEquals("bar", TestStep.getContext().getAttribute("collaborator"));
assertEquals("foo", TestStep.getContext().getAttribute("parent"));
}
@Test
public void testNestedUnScoped() throws Exception {
assertNotNull(step2);
assertTrue("Proxy was not created for explicitly scoped bean", names.contains("lazyBindingProxy.spam"));
assertFalse("Proxy was created for unscoped bean", names.contains("bucket"));
stepExecution.getExecutionContext().putString("spam", "spam");
step2.execute(stepExecution);
assertNotNull(stepExecution.getExecutionContext().getString("foo"));
assertEquals("spam", TestStep.getContext().getAttribute("collaborator"));
assertEquals("bucket", TestStep.getContext().getAttribute("parent"));
}
@Test
public void testTwiceNestedScopedProxy() throws Exception {
assertNotNull(step3);
assertTrue("Proxy was not created for explicitly scoped bean", names.contains("lazyBindingProxy.maps"));
assertFalse("Proxy was created for implicitly scoped bean", names.contains("lazyBindingProxy.rab"));
assertEquals("foo", parent.getName());
stepExecution.getExecutionContext().putString("maps", "maps");
stepExecution.getExecutionContext().putString("rab", "rab");
step3.execute(stepExecution);
assertNotNull(stepExecution.getExecutionContext().getString("foo"));
assertEquals("maps", TestStep.getContext().getAttribute("collaborator"));
assertEquals("rab", TestStep.getContext().getAttribute("parent"));
}
}

View File

@@ -1,77 +0,0 @@
package org.springframework.batch.core.scope;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.batch.item.ItemStreamReader;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.util.StopWatch;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopePerformanceTests implements ApplicationContextAware {
private Log logger = LogFactory.getLog(getClass());
private ApplicationContext applicationContext;
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
this.applicationContext = applicationContext;
}
@Before
public void start() throws Exception {
int count = doTest("vanilla", "warmup");
logger.info("Item count: "+count);
StepSynchronizationManager.register(new StepExecution("step", new JobExecution(0L),1L));
}
@Before
@After
public void cleanup() {
StepSynchronizationManager.close();
}
@Test
public void testVanilla() throws Exception {
int count = doTest("vanilla", "vanilla");
logger.info("Item count: "+count);
}
@Test
public void testProxied() throws Exception {
int count = doTest("proxied", "proxied");
logger.info("Item count: "+count);
}
private int doTest(String name, String test) throws Exception {
@SuppressWarnings("unchecked")
ItemStreamReader<String> reader = (ItemStreamReader<String>) applicationContext.getBean(name);
reader.open(new ExecutionContext());
StopWatch stopWatch = new StopWatch(test);
stopWatch.start();
int count = 0;
while (reader.read() != null) {
// do nothing
count++;
}
stopWatch.stop();
reader.close();
logger.info(stopWatch.shortSummary());
return count;
}
}

View File

@@ -1,104 +0,0 @@
package org.springframework.batch.core.scope;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopePlaceholderIntegrationTests implements BeanFactoryAware {
@Autowired
@Qualifier("simple")
private Collaborator simple;
@Autowired
@Qualifier("compound")
private Collaborator compound;
@Autowired
@Qualifier("value")
private Collaborator value;
@Autowired
@Qualifier("ref")
private Collaborator ref;
@Autowired
@Qualifier("bar")
private Collaborator bar;
private StepExecution stepExecution;
private ListableBeanFactory beanFactory;
private int beanCount;
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = (ListableBeanFactory) beanFactory;
}
@Before
public void start() {
StepSynchronizationManager.close();
stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);
ExecutionContext executionContext = new ExecutionContext();
executionContext.put("foo", "bar");
executionContext.put("parent", bar);
stepExecution.setExecutionContext(executionContext);
StepSynchronizationManager.register(stepExecution);
beanCount = beanFactory.getBeanDefinitionCount();
}
@After
public void cleanUp() {
StepSynchronizationManager.close();
// Check that all temporary bean definitions are cleaned up
assertEquals(beanCount, beanFactory.getBeanDefinitionCount());
}
@Test
public void testSimpleProperty() throws Exception {
assertEquals("bar", simple.getName());
// Once the step context is set up it should be baked into the proxies
// so changing it now should have no effect
stepExecution.getExecutionContext().put("foo", "wrong!");
assertEquals("bar", simple.getName());
}
@Test
public void testCompoundProperty() throws Exception {
assertEquals("bar-bar", compound.getName());
}
@Test
public void testParentByRef() throws Exception {
assertEquals("bar", ref.getParent().getName());
}
@Test
public void testParentByValue() throws Exception {
assertEquals("bar", value.getParent().getName());
}
}

View File

@@ -1,72 +0,0 @@
package org.springframework.batch.core.scope;
import static org.junit.Assert.assertEquals;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
import org.springframework.batch.item.ExecutionContext;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopeProxyTargetClassIntegrationTests implements BeanFactoryAware {
@Autowired
@Qualifier("simple")
private TestCollaborator simple;
private StepExecution stepExecution;
private ListableBeanFactory beanFactory;
private int beanCount;
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
this.beanFactory = (ListableBeanFactory) beanFactory;
}
@Before
public void start() {
StepSynchronizationManager.close();
stepExecution = new StepExecution("foo", new JobExecution(11L), 123L);
ExecutionContext executionContext = new ExecutionContext();
executionContext.put("foo", "bar");
stepExecution.setExecutionContext(executionContext);
StepSynchronizationManager.register(stepExecution);
beanCount = beanFactory.getBeanDefinitionCount();
}
@After
public void cleanUp() {
StepSynchronizationManager.close();
// Check that all temporary bean definitions are cleaned up
assertEquals(beanCount, beanFactory.getBeanDefinitionCount());
}
@Test
public void testSimpleProperty() throws Exception {
assertEquals("bar", simple.getName());
// Once the step context is set up it should be baked into the proxies
// so changing it now should have no effect
stepExecution.getExecutionContext().put("foo", "wrong!");
assertEquals("bar", simple.getName());
}
}

View File

@@ -1,17 +0,0 @@
package org.springframework.batch.core.scope;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class StepScopeStartupIntegrationTests {
@Test
public void testScopedProxyDuringStartup() throws Exception {
}
}

View File

@@ -1,192 +0,0 @@
/*
* 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.scope;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.batch.core.JobExecution;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepContext;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.context.support.StaticApplicationContext;
/**
* @author Dave Syer
*
*/
public class StepScopeTests {
private StepScope scope = new StepScope();
private StepExecution stepExecution = new StepExecution("foo", new JobExecution(0L), 123L);
private StepContext context;
@Before
public void setUp() throws Exception {
context = StepSynchronizationManager.register(stepExecution);
}
@After
public void tearDown() throws Exception {
StepSynchronizationManager.close();
}
@Test
public void testGetWithNoContext() throws Exception {
final String foo = "bar";
StepSynchronizationManager.close();
try {
scope.get("foo", new ObjectFactory<String>() {
public String getObject() throws BeansException {
return foo;
}
});
fail("Expected IllegalStateException");
}
catch (IllegalStateException e) {
// expected
}
}
@Test
public void testGetWithNothingAlreadyThere() {
final String foo = "bar";
Object value = scope.get("foo", new ObjectFactory<String>() {
public String getObject() throws BeansException {
return foo;
}
});
assertEquals(foo, value);
assertTrue(context.hasAttribute("foo"));
}
@Test
public void testGetWithSomethingAlreadyThere() {
context.setAttribute("foo", "bar");
Object value = scope.get("foo", new ObjectFactory<Object>() {
public Object getObject() throws BeansException {
return null;
}
});
assertEquals("bar", value);
assertTrue(context.hasAttribute("foo"));
}
@Test
public void testGetWithSomethingAlreadyInParentContext() {
context.setAttribute("foo", "bar");
StepContext context = StepSynchronizationManager.register(new StepExecution("bar", new JobExecution(0L)));
Object value = scope.get("foo", new ObjectFactory<String>() {
public String getObject() throws BeansException {
return "spam";
}
});
assertEquals("spam", value);
assertTrue(context.hasAttribute("foo"));
StepSynchronizationManager.close();
assertEquals("bar", scope.get("foo", null));
}
@Test
public void testParentContextWithSameStepExecution() {
context.setAttribute("foo", "bar");
StepContext other = StepSynchronizationManager.register(stepExecution);
assertSame(other, context);
}
@Test
public void testGetConversationId() {
String id = scope.getConversationId();
assertNotNull(id);
}
@Test
public void testRegisterDestructionCallback() {
final List<String> list = new ArrayList<String>();
context.setAttribute("foo", "bar");
scope.registerDestructionCallback("foo", new Runnable() {
public void run() {
list.add("foo");
}
});
assertEquals(0, list.size());
// When the context is closed, provided the attribute exists the
// callback is called...
context.close();
assertEquals(1, list.size());
}
@Test
public void testRegisterAnotherDestructionCallback() {
final List<String> list = new ArrayList<String>();
context.setAttribute("foo", "bar");
scope.registerDestructionCallback("foo", new Runnable() {
public void run() {
list.add("foo");
}
});
scope.registerDestructionCallback("foo", new Runnable() {
public void run() {
list.add("bar");
}
});
assertEquals(0, list.size());
// When the context is closed, provided the attribute exists the
// callback is called...
context.close();
assertEquals(2, list.size());
}
@Test
public void testRemove() {
context.setAttribute("foo", "bar");
scope.remove("foo");
assertFalse(context.hasAttribute("foo"));
}
@Test
public void testOrder() throws Exception {
assertEquals(Integer.MAX_VALUE, scope.getOrder());
scope.setOrder(11);
assertEquals(11, scope.getOrder());
}
@Test
public void testName() throws Exception {
scope.setName("foo");
StaticApplicationContext beanFactory = new StaticApplicationContext();
scope.postProcessBeanFactory(beanFactory.getDefaultListableBeanFactory());
String[] scopes = beanFactory.getDefaultListableBeanFactory().getRegisteredScopeNames();
assertEquals(1, scopes.length);
assertEquals("foo", scopes[0]);
}
}

View File

@@ -1,20 +0,0 @@
package org.springframework.batch.core.scope;
import java.util.ArrayList;
import java.util.List;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
@Aspect
public class TestAdvice {
public static final List<String> names = new ArrayList<String>();
@AfterReturning(pointcut="execution(String org.springframework.batch.core.scope.Collaborator+.getName(..))", returning="name")
public void registerCollaborator(String name) {
names.add(name);
}
}

View File

@@ -1,28 +0,0 @@
package org.springframework.batch.core.scope;
import java.io.Serializable;
public class TestCollaborator implements Collaborator, Serializable {
private String name;
private Collaborator parent;
public Collaborator getParent() {
return parent;
}
public void setParent(Collaborator parent) {
this.parent = parent;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

View File

@@ -1,14 +0,0 @@
package org.springframework.batch.core.scope;
import org.springframework.beans.factory.DisposableBean;
public class TestDisposableCollaborator extends TestCollaborator implements DisposableBean {
public static volatile String message = "none";
public void destroy() throws Exception {
message = "destroyed";
}
}

View File

@@ -1,57 +0,0 @@
package org.springframework.batch.core.scope;
import org.springframework.batch.core.JobInterruptedException;
import org.springframework.batch.core.Step;
import org.springframework.batch.core.StepExecution;
import org.springframework.batch.core.scope.context.StepContext;
import org.springframework.batch.core.scope.context.StepSynchronizationManager;
public class TestStep implements Step {
private static StepContext context;
private Collaborator collaborator;
public void setCollaborator(Collaborator collaborator) {
this.collaborator = collaborator;
}
public static StepContext getContext() {
return context;
}
public static void reset() {
context = null;
}
public void execute(StepExecution stepExecution) throws JobInterruptedException {
context = StepSynchronizationManager.getContext();
setContextFromCollaborator();
stepExecution.getExecutionContext().put("foo", "changed but it shouldn't affect the collaborator");
setContextFromCollaborator();
}
private void setContextFromCollaborator() {
if (context != null) {
context.setAttribute("collaborator", collaborator.getName());
context.setAttribute("collaborator.class", collaborator.getClass().toString());
if (collaborator.getParent()!=null) {
context.setAttribute("parent", collaborator.getParent().getName());
context.setAttribute("parent.class", collaborator.getParent().getClass().toString());
}
}
}
public String getName() {
return "foo";
}
public int getStartLimit() {
return Integer.MAX_VALUE;
}
public boolean isAllowStartIfComplete() {
return false;
}
}

View File

@@ -1,13 +0,0 @@
log4j.rootCategory=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - <%m>%n
log4j.category.org.apache.activemq=ERROR
log4j.category.org.springframework.batch=DEBUG
log4j.category.org.springframework.transaction=INFO
log4j.category.org.hibernate.SQL=DEBUG
# for debugging datasource initialization
# log4j.category.test.jdbc=DEBUG

View File

@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="simple" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext[foo]}" />
</bean>
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="bean" class="org.springframework.batch.core.scope.PlaceholderTests$TestBean">
<property name="name" value="#{properties['name']}" />
<property name="value" value="#{properties['value']}" />
<property name="values" value="#{properties['values']}" />
</bean>
<util:properties id="properties">
<prop key="name">foo</prop>
<prop key="value">100</prop>
<prop key="values">a,b,c</prop>
</util:properties>
</beans>

View File

@@ -1,49 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<bean id="proxied" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean
class="org.springframework.batch.core.scope.TestDisposableCollaborator"
scope="step">
<property name="name" value="bar" />
</bean>
</property>
</bean>
<bean id="nested" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean class="org.springframework.batch.core.scope.TestCollaborator"
scope="step">
<property name="name" value="bar" />
<property name="parent">
<bean
class="org.springframework.batch.core.scope.TestDisposableCollaborator">
<property name="name" value="foo" />
</bean>
</property>
</bean>
</property>
</bean>
<bean id="foo"
class="org.springframework.batch.core.scope.TestDisposableCollaborator">
<property name="name" value="foo" />
</bean>
<aop:aspectj-autoproxy />
<bean class="org.springframework.batch.core.scope.TestAdvice" />
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="vanilla" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean class="org.springframework.batch.core.scope.TestCollaborator">
<property name="name" value="bar" />
</bean>
</property>
</bean>
<bean id="proxied" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="bar" />
</bean>
</property>
</bean>
<bean id="nested" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean class="org.springframework.batch.core.scope.TestCollaborator">
<property name="name" value="foo" />
<property name="parent">
<bean class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="bar" />
</bean>
</property>
</bean>
</property>
</bean>
<bean id="enhanced" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator" ref="collaborator" />
</bean>
<bean id="double" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator" ref="collaborator" />
</bean>
<bean id="collaborator" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="bar" />
</bean>
<aop:aspectj-autoproxy />
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,55 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean id="step1" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean id="bar" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext['bar']}" />
<property name="parent" ref="parent" />
</bean>
</property>
</bean>
<bean id="parent" class="org.springframework.batch.core.scope.TestDisposableCollaborator">
<property name="name" value="foo" />
</bean>
<bean id="step2" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator" ref="spam" />
</bean>
<bean id="spam" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext['spam']}" />
<property name="parent">
<bean id="bucket" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="singleton">
<property name="name" value="#{properties['parent.name']}" />
</bean>
</property>
</bean>
<bean id="step3" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator" ref="maps" />
</bean>
<bean id="maps" class="org.springframework.batch.core.scope.TestDisposableCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext['maps']}" />
<property name="parent">
<bean id="rab" class="org.springframework.batch.core.scope.TestDisposableCollaborator">
<property name="name" value="#{stepExecutionContext['rab']}" />
</bean>
</property>
</bean>
<util:properties id="properties">
<prop key="parent.name">bucket</prop>
</util:properties>
<aop:aspectj-autoproxy />
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="vanilla" class="org.springframework.batch.item.file.FlatFileItemReader">
<property name="lineMapper">
<bean
class="org.springframework.batch.item.file.mapping.PassThroughLineMapper" />
</property>
<property name="resource" value="classpath:/org/springframework/batch/core/scope/StepScopePerformanceTests-input.txt"></property>
</bean>
<bean id="proxied" class="org.springframework.batch.item.file.FlatFileItemReader" scope="step">
<property name="lineMapper">
<bean
class="org.springframework.batch.item.file.mapping.PassThroughLineMapper" />
</property>
<property name="resource" value="classpath:/org/springframework/batch/core/scope/StepScopePerformanceTests-input.txt"></property>
</bean>
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,660 +0,0 @@
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spamfoo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam
foo bar spam

View File

@@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="simple" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext[foo]}" />
</bean>
<bean id="compound" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext[foo]}-bar" />
</bean>
<bean id="value" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="foo" />
<property name="parent" value="#{stepExecutionContext[parent]}" />
</bean>
<bean id="ref" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="foo" />
<property name="parent" ref="#{stepExecutionContext[foo]}" />
</bean>
<bean id="bar" class="org.springframework.batch.core.scope.TestCollaborator">
<property name="name" value="bar" />
</bean>
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="simple" class="org.springframework.batch.core.scope.TestCollaborator" scope="step">
<property name="name" value="#{stepExecutionContext[foo]}" />
</bean>
<bean class="org.springframework.batch.core.scope.StepScope">
<property name="proxyTargetClass" value="true"/>
</bean>
</beans>

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<context:annotation-config />
<bean class="org.springframework.batch.core.scope.JobStartupRunner">
<property name="step" ref="proxied" />
</bean>
<bean id="proxied" class="org.springframework.batch.core.scope.TestStep">
<property name="collaborator">
<bean class="org.springframework.batch.core.scope.TestCollaborator"
scope="step">
<property name="name" value="bar" />
</bean>
</property>
</bean>
<aop:aspectj-autoproxy />
<bean class="org.springframework.batch.core.scope.context.StepScopeManager" />
<bean class="org.springframework.batch.core.scope.StepScope" />
</beans>

View File

@@ -1,5 +1,5 @@
#Sat Jun 20 14:28:54 BST 2009
activeProfiles=
#Tue Jul 07 12:34:28 BST 2009
activeProfiles=spring3
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false

View File

@@ -111,6 +111,12 @@ public class StepScope implements Scope, BeanFactoryPostProcessor, Ordered {
public void setProxyTargetClass(boolean proxyTargetClass) {
this.proxyTargetClass = proxyTargetClass;
}
// Implement missing method from Spring 3.0 SPI.
public Object resolveContextualObject(String key) {
StepContext context = getContext();
return context.getAttribute(key);
}
/**
* @see Scope#get(String, ObjectFactory)

View File

@@ -30,21 +30,21 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
*/
public class AutoRegisteringStepScopeTests {
@SuppressWarnings("unchecked")
@Test
public void testJobElement() throws Exception {
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(StepScope.class);
@SuppressWarnings("unchecked")
Map<String, StepScope> beans = ctx.getBeansOfType(StepScope.class);
assertTrue("StepScope not defined properly", beans.size() == 1);
}
@SuppressWarnings("unchecked")
@Test
public void testStepElement() throws Exception {
ConfigurableApplicationContext ctx =
new ClassPathXmlApplicationContext("org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(StepScope.class);
@SuppressWarnings("unchecked")
Map<String, StepScope> beans = ctx.getBeansOfType(StepScope.class);
assertTrue("StepScope not defined properly", beans.size() == 1);
}

View File

@@ -174,7 +174,7 @@ public class ChunkElementParserTests {
@SuppressWarnings("unchecked")
private Set<Class<?>> getExceptionClasses(String stepName, String type, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);
@@ -190,7 +190,7 @@ public class ChunkElementParserTests {
@SuppressWarnings("unchecked")
private Collection<ItemStream> getStreams(String stepName, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);
@@ -201,7 +201,7 @@ public class ChunkElementParserTests {
@SuppressWarnings("unchecked")
private Collection<RetryListener> getRetryListeners(String stepName, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);

View File

@@ -89,7 +89,7 @@ public class StepListenerParserTests {
@SuppressWarnings("unchecked")
private List<?> getListeners(String stepName, ApplicationContext ctx) throws Exception {
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue(beans.containsKey(stepName));
Object step = ctx.getBean(stepName);
assertTrue(step instanceof TaskletStep);

View File

@@ -61,25 +61,26 @@ public class StepParserTests {
"org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml");
}
@SuppressWarnings("unchecked")
@Test
public void testTaskletStepAttributes() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(StepParserStepFactoryBean.class);
@SuppressWarnings("unchecked")
Map<String, StepParserStepFactoryBean> beans = ctx.getBeansOfType(StepParserStepFactoryBean.class);
String factoryName = (String) beans.keySet().toArray()[0];
@SuppressWarnings("unchecked")
StepParserStepFactoryBean<Object, Object> factory = (StepParserStepFactoryBean<Object, Object>) beans
.get(factoryName);
TaskletStep bean = (TaskletStep) factory.getObject();
assertEquals("wrong start-limit:", 25, bean.getStartLimit());
}
@SuppressWarnings("unchecked")
@Test
public void testStepParserBeanName() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserBeanNameTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
@SuppressWarnings("unchecked")
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue("'s1' bean not found", beans.containsKey("s1"));
Step s1 = (Step) ctx.getBean("s1");
assertEquals("wrong name", "s1", s1.getName());
@@ -91,12 +92,12 @@ public class StepParserTests {
"org/springframework/batch/core/configuration/xml/StepParserCommitIntervalCompletionPolicyTests-context.xml");
}
@SuppressWarnings("unchecked")
@Test
public void testStepParserCommitInterval() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
@SuppressWarnings("unchecked")
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue("'s1' bean not found", beans.containsKey("s1"));
Step s1 = (Step) ctx.getBean("s1");
CompletionPolicy completionPolicy = getCompletionPolicy(s1);
@@ -104,12 +105,12 @@ public class StepParserTests {
assertEquals(25, ReflectionTestUtils.getField(completionPolicy, "chunkSize"));
}
@SuppressWarnings("unchecked")
@Test
public void testStepParserCompletionPolicy() throws Exception {
ConfigurableApplicationContext ctx = new ClassPathXmlApplicationContext(
"org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml");
Map<String, Object> beans = ctx.getBeansOfType(Step.class);
@SuppressWarnings("unchecked")
Map<String, Step> beans = ctx.getBeansOfType(Step.class);
assertTrue("'s1' bean not found", beans.containsKey("s1"));
Step s1 = (Step) ctx.getBean("s1");
CompletionPolicy completionPolicy = getCompletionPolicy(s1);

View File

@@ -23,19 +23,25 @@
</bean>
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyy/MM/dd" />
<property name="propertyEditorRegistrars">
<bean
class="org.springframework.batch.support.DefaultPropertyEditorRegistrar">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean
class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyy/MM/dd" />
</bean>
</constructor-arg>
<constructor-arg value="false" />
</bean>
</constructor-arg>
<constructor-arg value="false"/>
</bean>
</entry>
</map>
</entry>
</map>
</property>
</bean>
</property>
</bean>

View File

@@ -160,19 +160,25 @@
</bean>
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyy/MM/dd" />
<property name="propertyEditorRegistrars">
<bean
class="org.springframework.batch.support.DefaultPropertyEditorRegistrar">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean
class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyy/MM/dd" />
</bean>
</constructor-arg>
<constructor-arg value="false" />
</bean>
</constructor-arg>
<constructor-arg value="false" />
</bean>
</entry>
</map>
</entry>
</map>
</property>
</bean>
</property>
</bean>

View File

@@ -1,5 +1,5 @@
#Sat Jun 20 14:28:53 BST 2009
activeProfiles=
#Tue Jul 07 11:35:38 BST 2009
activeProfiles=spring3
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@@ -1,4 +1,4 @@
#Sun Jun 21 09:14:45 BST 2009
#Tue Jul 07 11:37:24 BST 2009
activeProfiles=
eclipse.preferences.version=1
fullBuildGoals=process-test-resources

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-parent</artifactId>
@@ -11,6 +12,7 @@
<properties>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<spring.framework.version>2.5.6</spring.framework.version>
<junit.version>4.4</junit.version>
<bundlor.version>1.0.0.M2</bundlor.version>
</properties>
<profiles>
@@ -27,6 +29,25 @@
<maven.javadoc.skip>true</maven.javadoc.skip>
</properties>
</profile>
<profile>
<id>spring3</id>
<properties>
<spring.framework.version>3.0.0.BUILD-SNAPSHOT</spring.framework.version>
<junit.version>4.6</junit.version>
</properties>
<repositories>
<repository>
<id>spring-snapshots</id>
<url>http://s3.amazonaws.com/maven.springframework.org/snapshot</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
<profile>
<id>staging</id>
<distributionManagement>
@@ -213,7 +234,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.4</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -428,6 +449,12 @@
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.framework.version}</version>
<exclusions>
<exclusion>
<groupId>quartz</groupId>
<artifactId>quartz</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>

View File

@@ -1,5 +1,5 @@
#Sat Jun 20 14:28:54 BST 2009
activeProfiles=
#Tue Jul 07 12:57:17 BST 2009
activeProfiles=spring3
eclipse.preferences.version=1
fullBuildGoals=process-test-resources
includeModules=false

View File

@@ -93,9 +93,9 @@
</exclusions>
</dependency>
<dependency>
<groupId>opensymphony</groupId>
<artifactId>quartz-all</artifactId>
<version>1.6.0</version>
<groupId>org.opensymphony.quartz</groupId>
<artifactId>quartz</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>

View File

@@ -6,7 +6,7 @@
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd">
<job id="tradeJob" xmlns="http://www.springframework.org/schema/batch">
<job id="groovyJob" xmlns="http://www.springframework.org/schema/batch">
<step id="unzip-step" next="zip-step">
<tasklet ref="unzip" />
</step>

View File

@@ -10,19 +10,7 @@
<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="int[]">
<bean class="org.springframework.batch.support.IntArrayPropertyEditor" />
</entry>
<entry key="java.util.Date">
<bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyyMMdd" />
</bean>
</constructor-arg>
<constructor-arg value="false" />
</bean>
</entry>
<entry key="int[]" value="org.springframework.batch.support.IntArrayPropertyEditor" />
</map>
</property>
</bean>

View File

@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:p="http://www.springframework.org/schema/p" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
@@ -15,52 +13,66 @@
<constructor-arg ref="dataSource" />
</bean>
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<bean id="jobLauncher"
class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository" />
</bean>
<bean id="jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
<property name="databaseType" value="hsql" />
</bean>
<bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob" abstract="true">
<bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob"
abstract="true">
<property name="jobRepository" ref="jobRepository" />
<property name="restartable" value="true" />
</bean>
<bean id="taskletStep" class="org.springframework.batch.core.step.tasklet.TaskletStep" abstract="true">
<bean id="taskletStep" class="org.springframework.batch.core.step.tasklet.TaskletStep"
abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="jobRepository" ref="jobRepository" />
<property name="allowStartIfComplete" value="true" />
</bean>
<bean id="itemOrientedStep" class="org.springframework.batch.core.step.item.FaultTolerantStepFactoryBean" abstract="true">
<bean id="itemOrientedStep"
class="org.springframework.batch.core.step.item.FaultTolerantStepFactoryBean"
abstract="true">
<property name="transactionManager" ref="transactionManager" />
<property name="jobRepository" ref="jobRepository" />
</bean>
<bean id="customEditorConfigurer" class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<bean id="customEditorConfigurer"
class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="int[]">
<bean class="org.springframework.batch.support.IntArrayPropertyEditor" />
</entry>
<entry key="org.springframework.batch.item.file.transform.Range[]">
<bean class="org.springframework.batch.item.file.transform.RangeArrayPropertyEditor" />
</entry>
<entry key="java.util.Date">
<bean class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyyMMdd" />
</bean>
</constructor-arg>
<constructor-arg value="false" />
</bean>
</entry>
<entry key="int[]" value="org.springframework.batch.support.IntArrayPropertyEditor" />
<entry key="org.springframework.batch.item.file.transform.Range[]"
value="org.springframework.batch.item.file.transform.RangeArrayPropertyEditor" />
</map>
</property>
<property name="propertyEditorRegistrars">
<bean
class="org.springframework.batch.support.DefaultPropertyEditorRegistrar">
<property name="customEditors">
<map>
<entry key="java.util.Date">
<bean
class="org.springframework.beans.propertyeditors.CustomDateEditor">
<constructor-arg>
<bean class="java.text.SimpleDateFormat">
<constructor-arg value="yyyyMMdd" />
</bean>
</constructor-arg>
<constructor-arg value="false" />
</bean>
</entry>
</map>
</property>
</bean>
</property>
</bean>
</beans>