diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000000..e96ed9af78
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,27 @@
+---
+name: Bug report
+about: Create a bug report to help us improve the project
+title: ''
+labels: 'type: bug, status: waiting-for-triage'
+assignees: ''
+
+---
+
+Please do a quick search on Github issues first, there might be already a duplicate issue for the one you are about to create.
+If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
+
+**Bug description**
+A clear and concise description of what the bug is about.
+
+**Environment**
+Please provide as many details as possible: Spring Batch version, Java version, which database you use if any, etc
+
+**Steps to reproduce**
+Steps to reproduce the issue.
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Minimal Complete Reproducible example**
+Please provide a failing test or a [minimal complete verifiable example](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md) that reproduces the issue.
+Bug reports that are reproducible will take priority in resolution over reports that are not reproducible.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000000..804bb17fb4
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: false
+contact_links:
+ - name: Questions and Community Support
+ url: https://stackoverflow.com/questions/tagged/spring-batch
+ about: Please ask and answer questions on StackOverflow with the spring-batch tag
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000000..0f32f34d21
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,27 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: 'status: waiting-for-triage, type: feature'
+assignees: ''
+
+---
+
+Please do a quick search on Github issues first, the feature you are about to request might have already been requested.
+
+**Expected Behavior**
+
+
+
+**Current Behavior**
+
+
+
+**Context**
+
+
diff --git a/.github/ISSUE_TEMPLATE/miscellaneous.md b/.github/ISSUE_TEMPLATE/miscellaneous.md
new file mode 100644
index 0000000000..f523d84375
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/miscellaneous.md
@@ -0,0 +1,17 @@
+---
+name: Miscellaneous
+about: Suggest an improvement for this project
+title: ''
+labels: 'status: waiting-for-triage'
+assignees: ''
+
+---
+
+For anything other than bug reports and feature requests (performance, refactoring, etc),
+just go ahead and file the issue. Please provide as many details as possible.
+
+If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions)
+or ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch).
+
+Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests.
+We would like to keep the issue tracker **exclusively** for bug reports and feature requests.
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000000..30f58a8110
--- /dev/null
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,12 @@
+Thank you for taking time to contribute this pull request!
+You might have already read the [contributor guide][1], but as a reminder, please make sure to:
+
+* Rebase your changes on the latest `main` branch and squash your commits
+* Add/Update unit tests as needed
+* Run a build and make sure all tests pass prior to submission
+* Sign-off commits according to the [Developer Certificate of Origin](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring)
+
+For more details, please check the [contributor guide][1].
+Thank you upfront!
+
+[1]: https://github.com/spring-projects/spring-batch/blob/main/CONTRIBUTING.md
\ No newline at end of file
diff --git a/.github/dco.yml b/.github/dco.yml
new file mode 100644
index 0000000000..0c4b142e9a
--- /dev/null
+++ b/.github/dco.yml
@@ -0,0 +1,2 @@
+require:
+ members: false
diff --git a/.github/release-files-spec.json b/.github/release-files-spec.json
new file mode 100644
index 0000000000..1d071702fc
--- /dev/null
+++ b/.github/release-files-spec.json
@@ -0,0 +1,18 @@
+{
+ "files": [
+ {
+ "aql": {
+ "items.find": {
+ "$and": [
+ {
+ "@build.name": "${buildname}",
+ "@build.number": "${buildnumber}",
+ "path": { "$match": "org/springframework/batch/spring-batch-*" }
+ }
+ ]
+ }
+ },
+ "target": "nexus/"
+ }
+ ]
+}
diff --git a/.github/workflows/artifactory-staging.yml b/.github/workflows/artifactory-staging.yml
new file mode 100644
index 0000000000..b62b2e6848
--- /dev/null
+++ b/.github/workflows/artifactory-staging.yml
@@ -0,0 +1,44 @@
+name: Artifactory Staging
+
+on:
+ workflow_dispatch:
+ inputs:
+ releaseVersion:
+ description: "Release version"
+ required: true
+
+jobs:
+ build:
+ name: Stage release to Artifactory
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v4.2.2
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4.7.1
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Update release version
+ run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.releaseVersion }}
+
+ - name: Enforce release rules
+ run: mvn org.apache.maven.plugins:maven-enforcer-plugin:enforce -Drules=requireReleaseDeps
+
+ - name: Build with Maven
+ run: mvn -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode -Dmaven.test.skip=true deploy
+
+ - name: Deploy to Artifactory
+ uses: spring-io/artifactory-deploy-action@v0.0.2
+ with:
+ uri: 'https://repo.spring.io'
+ username: ${{ secrets.ARTIFACTORY_USERNAME }}
+ password: ${{ secrets.ARTIFACTORY_PASSWORD }}
+ build-name: 'spring-batch-${{ github.event.inputs.releaseVersion }}'
+ repository: 'libs-staging-local'
+ folder: 'deployment-repository'
+ signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
+ signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml
new file mode 100644
index 0000000000..ab5e0aeed2
--- /dev/null
+++ b/.github/workflows/continuous-integration.yml
@@ -0,0 +1,67 @@
+name: CI/CD build
+
+on: [push, pull_request, workflow_dispatch]
+
+jobs:
+ build:
+ name: Build main branch
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v4.2.2
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4.7.1
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Build with Maven
+ run: mvn -DaltDeploymentRepository=local::file:deployment-repository --no-transfer-progress --batch-mode --update-snapshots deploy
+
+ - name: Deploy to Artifactory
+ if: ${{ github.repository == 'spring-projects/spring-batch' && github.ref_name == 'main' }}
+ uses: spring-io/artifactory-deploy-action@v0.0.2
+ with:
+ uri: 'https://repo.spring.io'
+ username: ${{ secrets.ARTIFACTORY_USERNAME }}
+ password: ${{ secrets.ARTIFACTORY_PASSWORD }}
+ build-name: 'spring-batch-main'
+ repository: 'libs-snapshot-local'
+ folder: 'deployment-repository'
+ signing-key: ${{ secrets.GPG_PRIVATE_KEY }}
+ signing-passphrase: ${{ secrets.GPG_PASSPHRASE }}
+
+ - name: Generate Java docs
+ run: mvn javadoc:aggregate
+
+ - name: Generate Assembly
+ working-directory: spring-batch-docs
+ run: mvn assembly:single
+
+ - name: Capture project version
+ run: echo PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version --quiet -DforceStdout) >> $GITHUB_ENV
+
+ - name: Setup SSH key
+ if: ${{ github.repository == 'spring-projects/spring-batch' && github.ref_name == 'main' }}
+ env:
+ DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
+ DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
+ run: |
+ mkdir "$HOME/.ssh"
+ echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key"
+ chmod 600 "$HOME/.ssh/key"
+ echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
+
+ - name: Deploy Java docs
+ if: ${{ github.repository == 'spring-projects/spring-batch' && github.ref_name == 'main' }}
+ env:
+ DOCS_HOST: ${{ secrets.DOCS_HOST }}
+ DOCS_PATH: ${{ secrets.DOCS_PATH }}
+ DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
+ working-directory: spring-batch-docs/target
+ run: |
+ unzip spring-batch-$PROJECT_VERSION-javadocs.zip
+ ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $PROJECT_VERSION"
+ scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$PROJECT_VERSION
diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml
new file mode 100644
index 0000000000..4af2314b75
--- /dev/null
+++ b/.github/workflows/deploy-docs.yml
@@ -0,0 +1,30 @@
+name: Deploy Docs
+on:
+ push:
+ branches-ignore: [ gh-pages ]
+ tags: '**'
+ repository_dispatch:
+ types: request-build-reference # legacy
+ workflow_dispatch:
+permissions:
+ actions: write
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ if: github.repository_owner == 'spring-projects'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ ref: docs-build
+ fetch-depth: 1
+ - name: Dispatch (partial build)
+ if: github.ref_type == 'branch'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }}
+ - name: Dispatch (full build)
+ if: github.ref_type == 'tag'
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD)
diff --git a/.github/workflows/documentation-upload.yml b/.github/workflows/documentation-upload.yml
new file mode 100644
index 0000000000..bf3f725cd7
--- /dev/null
+++ b/.github/workflows/documentation-upload.yml
@@ -0,0 +1,63 @@
+name: Documentation Upload
+
+on:
+ workflow_dispatch:
+ inputs:
+ releaseVersion:
+ description: "Release version"
+ required: true
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+
+ - name: Capture release version
+ run: echo RELEASE_VERSION=${{ github.event.inputs.releaseVersion }} >> $GITHUB_ENV
+
+ - name: Checkout source code
+ uses: actions/checkout@v3
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ cache: 'maven'
+
+ - name: Update release version
+ run: mvn versions:set -DgenerateBackupPoms=false -DnewVersion=$RELEASE_VERSION
+
+ - name: Generate Java docs
+ run: mvn javadoc:aggregate
+
+ - name: Generate Assembly
+ working-directory: spring-batch-docs
+ run: mvn assembly:single
+
+ - name: Setup SSH key
+ env:
+ DOCS_SSH_KEY: ${{ secrets.DOCS_SSH_KEY }}
+ DOCS_SSH_HOST_KEY: ${{ secrets.DOCS_SSH_HOST_KEY }}
+ run: |
+ mkdir "$HOME/.ssh"
+ echo "$DOCS_SSH_KEY" > "$HOME/.ssh/key"
+ chmod 600 "$HOME/.ssh/key"
+ echo "$DOCS_SSH_HOST_KEY" > "$HOME/.ssh/known_hosts"
+
+ - name: Deploy Java docs and xsd schemas
+ env:
+ DOCS_HOST: ${{ secrets.DOCS_HOST }}
+ DOCS_PATH: ${{ secrets.DOCS_PATH }}
+ DOCS_USERNAME: ${{ secrets.DOCS_USERNAME }}
+ BATCH_SCHEMA_PATH: ${{ secrets.BATCH_SCHEMA_PATH }}
+ INTEGRATION_SCHEMA_PATH: ${{ secrets.INTEGRATION_SCHEMA_PATH }}
+ working-directory: spring-batch-docs/target
+ run: |
+ unzip spring-batch-$RELEASE_VERSION-javadocs.zip
+ ssh -i $HOME/.ssh/key $DOCS_USERNAME@$DOCS_HOST "cd $DOCS_PATH && mkdir -p $RELEASE_VERSION"
+ scp -i $HOME/.ssh/key -r api $DOCS_USERNAME@$DOCS_HOST:$DOCS_PATH/$RELEASE_VERSION
+
+ unzip spring-batch-$RELEASE_VERSION-schemas.zip
+ scp -i $HOME/.ssh/key batch/*.xsd $DOCS_USERNAME@$DOCS_HOST:$BATCH_SCHEMA_PATH
+ scp -i $HOME/.ssh/key batch-integration/*.xsd $DOCS_USERNAME@$DOCS_HOST:$INTEGRATION_SCHEMA_PATH
diff --git a/.github/workflows/extension-build.yml b/.github/workflows/extension-build.yml
new file mode 100644
index 0000000000..6b6b033894
--- /dev/null
+++ b/.github/workflows/extension-build.yml
@@ -0,0 +1,36 @@
+name: Spring Batch Extension Build
+
+on:
+ workflow_dispatch:
+ inputs:
+ extension:
+ description: "Extension name"
+ required: true
+ type: choice
+ options:
+ - spring-batch-bigquery
+ - spring-batch-excel
+ - spring-batch-elasticsearch
+ - spring-batch-geode
+ - spring-batch-neo4j
+
+jobs:
+ build:
+ name: Build an extension
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ repository: 'spring-projects/spring-batch-extensions'
+ ref: 'main'
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+
+ - name: Build extension with Maven
+ run: mvn -B package --file pom.xml
+ working-directory: ${{ github.event.inputs.extension }}
diff --git a/.github/workflows/maven-central-release.yml b/.github/workflows/maven-central-release.yml
new file mode 100644
index 0000000000..45608509c9
--- /dev/null
+++ b/.github/workflows/maven-central-release.yml
@@ -0,0 +1,32 @@
+name: Maven Central Release
+
+on:
+ workflow_dispatch:
+ inputs:
+ buildName:
+ description: "Artifactory build name"
+ required: true
+ buildNumber:
+ description: "Artifactory build number"
+ required: true
+
+jobs:
+
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source code
+ uses: actions/checkout@v4.2.2
+ - name: Set Up JFrog CLI
+ uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
+ env:
+ JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
+ - name: Download Release Artifacts
+ shell: bash
+ run: jf rt download --spec .github/release-files-spec.json --spec-vars 'buildname=${{ github.event.inputs.buildName }};buildnumber=${{ github.event.inputs.buildNumber }}'
+ - name: Sync to Maven Central
+ uses: spring-io/central-publish-action@0cdd90d12e6876341e82860d951e1bcddc1e51b6 # v0.2.0
+ with:
+ token-name: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
+ token: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
+ timeout: 60m
diff --git a/.github/workflows/release-notes-generation.yml b/.github/workflows/release-notes-generation.yml
new file mode 100644
index 0000000000..fa601a05fa
--- /dev/null
+++ b/.github/workflows/release-notes-generation.yml
@@ -0,0 +1,54 @@
+name: Generate Release notes
+
+on:
+ workflow_dispatch:
+ inputs:
+ milestoneNumber:
+ description: "Milestone title"
+ required: true
+ generatorVersion:
+ description: "Changelog Generator version"
+ required: true
+
+jobs:
+ build:
+ name: Generate release notes
+ runs-on: ubuntu-latest
+ steps:
+ - name: Capture milestone number and generator version
+ run: |
+ echo MILESTONE_NUMBER=${{ github.event.inputs.milestoneNumber }} >> $GITHUB_ENV
+ echo GENERATOR_VERSION=${{ github.event.inputs.generatorVersion }} >> $GITHUB_ENV
+
+ - name: Download changelog generator
+ run: wget https://github.com/spring-io/github-changelog-generator/releases/download/v$GENERATOR_VERSION/github-changelog-generator.jar
+
+ - name: Set up JDK 17
+ uses: actions/setup-java@v3
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+
+ - name: Prepare configuration file
+ run: |
+ cat << EOF > application.yml
+ changelog:
+ repository: spring-projects/spring-batch
+ sections:
+ - title: ":star: New features"
+ labels: [ "type: feature" ]
+ - title: ":rocket: Enhancements"
+ labels: [ "type: enhancement" ]
+ - title: ":lady_beetle: Bug fixes"
+ labels: [ "type: bug" ]
+ - title: ":notebook_with_decorative_cover: Documentation"
+ labels: [ "in: documentation" ]
+ - title: ":hammer: Tasks"
+ labels: [ "type: task" ]
+ EOF
+
+ - name: Generate release notes
+ run: java -jar github-changelog-generator.jar $MILESTONE_NUMBER release-notes.md
+
+ - name: Print release notes
+ run: cat release-notes.md
diff --git a/.gitignore b/.gitignore
index 01fc33298a..4563de84f8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,10 +10,10 @@ spring-build
derby-home
derbydb
derby.log
-derbydb
com.springsource.sts.config.flow.prefs
s3.properties
-.idea
+.idea/*
+!/.idea/icon.svg
*.iml
*.ipr
*.iws
@@ -22,6 +22,12 @@ s3.properties
.springBeans
build
.gradle
-pom.xml
out
+/.gradletasknamecache
+**/*.flattened-pom.xml
+
+node
+node_modules
+package-lock.json
+package.json
diff --git a/.idea/icon.svg b/.idea/icon.svg
new file mode 100644
index 0000000000..3ad7681541
--- /dev/null
+++ b/.idea/icon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/.mvn/jvm.config b/.mvn/jvm.config
new file mode 100644
index 0000000000..32599cefea
--- /dev/null
+++ b/.mvn/jvm.config
@@ -0,0 +1,10 @@
+--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
+--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
+--add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
new file mode 100644
index 0000000000..bf82ff01c6
Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000000..dc3affce3d
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# https://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.
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 6bf47b00a8..0000000000
--- a/.travis.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-language: java
-
-install: mvn -U install --quiet -DskipTests=true -P bootstrap
-script: mvn clean test -P bootstrap
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 0ba472d7fa..c6ad7d3a70 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,38 +1,44 @@
Contributor Guidelines
======================
-Have something you'd like to contribute to **Spring Batch**? We welcome pull requests, but ask that you carefully read this document first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring team when evaluating your submission.
+Have something you'd like to contribute to Spring Batch? We welcome pull requests, but ask that you carefully read this document
+first to understand how best to submit them; what kind of changes are likely to be accepted; and what to expect from the Spring Batch
+team when evaluating your submission.
Please refer back to this document as a checklist before issuing any pull request; this will save time for everyone!
-## Understand the basics
+## Code of Conduct
-Not sure what a *pull request* is, or how to submit one? Take a look at GitHub's excellent [help documentation][] first.
+Please see our [code of conduct](https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md).
-## Search JIRA first; create an issue if necessary
+## Reporting Security Vulnerabilities
-Is there already an issue that addresses your concern? Do a bit of searching in our [JIRA issue tracker][] to see if you can find something similar. If not, please create a new issue before submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc.
+Please see our [Security policy](https://github.com/spring-projects/spring-batch/security/policy).
-## Sign the contributor license agreement
+## Reporting issues
-Very important, before we can accept any *Spring Batch contributions*, we will need you to sign the contributor license agreement (CLA). Signing the CLA does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. In order to read and sign the CLA, please go to:
+Before opening an issue, please do a quick search in [Github issues][] to see if you can find something similar.
+If not, please read the [Issue Reporting](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md) section for more details
+about how to report issues.
-* [https://support.springsource.com/spring_committer_signup](https://support.springsource.com/spring_committer_signup)
+## Contributing through Pull Requests on GitHub
-For **Project**, please select **Spring Batch**. The **Project Lead** is **Michael Minella**.
+Not sure what a *pull request* is, or how to submit one? Take a look at the excellent [GitHub help documentation][] first.
+Please create a new issue *before* submitting a pull request unless the change is truly trivial, e.g. typo fixes, removing compiler warnings, etc.
-Once you've completed the web form, simply add the following in a comment on your pull request:
+### Sign-off commits according to the Developer Certificate of Origin
- I have signed and agree to the terms of the SpringSource Individual
- Contributor License Agreement.
+All commits must include a Signed-off-by trailer at the end of each commit message to indicate that the contributor agrees to the [Developer Certificate of Origin](https://developercertificate.org).
-## Fork the Repository
+For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: Simplifying Contributions to Spring](https://spring.io/blog/2025/01/06/hello-dco-goodbye-cla-simplifying-contributions-to-spring).
+
+### Fork the Repository
1. Go to [https://github.com/spring-projects/spring-batch](https://github.com/spring-projects/spring-batch)
2. Hit the "fork" button and choose your own github account as the target
-3. For more details see [http://help.github.com/fork-a-repo/](http://help.github.com/fork-a-repo/)
+3. For more details see [https://docs.github.com/en/get-started/quickstart/fork-a-repo](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
-## Setup your Local Development Environment
+### Setup your Local Development Environment
1. `git clone git@github.com:/spring-batch.git`
2. `cd spring-batch`
@@ -40,44 +46,44 @@ Once you've completed the web form, simply add the following in a comment on you
_you should see only 'origin' - which is the fork you created for your own github account_
4. `git remote add upstream git@github.com:spring-projects/spring-batch.git`
5. `git remote show`
-_you should now see 'upstream' in addition to 'origin' where 'upstream' is the *spring-projects*repository from which releases are built_
+_you should now see 'upstream' in addition to 'origin' where 'upstream' is the *spring-projects* repository from which releases are built_
6. `git fetch --all`
7. `git branch -a`
-_you should see branches on origin as well as upstream, including 'master'_
+_you should see branches on origin as well as upstream, including 'main'_
-## A Day in the Life of a Contributor
+### A Day in the Life of a Contributor
-* _Always_ work on topic branches (Typically use the Jira ticket ID as the branch name).
- - For example, to create and switch to a new branch for issue BATCH-123: `git checkout -b BATCH-123`
+* _Always_ work on topic branches (Typically use the Github issue ID as the branch name).
+ - For example, to create and switch to a new branch for issue GH-123: `git checkout -b GH-123`
* You might be working on several different topic branches at any given time, but when at a stopping point for one of those branches, commit (a local operation).
-* Please follow the "Commit Guidelines" described in this chapter of Pro Git: [http://progit.org/book/ch5-2.html](http://progit.org/book/ch5-2.html)
-* Then to begin working on another issue (say BATCH-101): `git checkout BATCH-101`. The _-b_ flag is not needed if that branch already exists in your local repository.
-* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin BATCH-123`
+* Please follow the "Commit Guidelines" described in this chapter of Pro Git: [https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project](https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines)
+* Then to begin working on another issue (say GH-101): `git checkout GH-101`. The _-b_ flag is not needed if that branch already exists in your local repository.
+* When ready to resolve an issue or to collaborate with others, you can push your branch to origin (your fork), e.g.: `git push origin GH-123`
* If you want to collaborate with another contributor, have them fork your repository (add it as a remote) and `git fetch ` to grab your branch. Alternatively, they can use `git fetch --all` to sync their local state with all of their remotes.
* If you grant that collaborator push access to your repository, they can even apply their changes to your branch.
-* When ready for your contribution to be reviewed for potential inclusion in the master branch of the canonical *spring-batch* repository (what you know as 'upstream'), issue a pull request to the *spring-projects* repository (for more detail, see [http://help.github.com/send-pull-requests/](http://help.github.com/send-pull-requests/)).
-* The project lead may merge your changes into the upstream master branch as-is, he may keep the pull request open yet add a comment about something that should be modified, or he might reject the pull request by closing it.
-* A prerequisite for any pull request is that it will be cleanly merge-able with the upstream master's current state. **This is the responsibility of any contributor.** If your pull request cannot be applied cleanly, the project lead will most likely add a comment requesting that you make it merge-able. For a full explanation, see the Pro Git section on rebasing: [http://progit.org/book/ch3-6.html](http://progit.org/book/ch3-6.html). As stated there: "> Often, you’ll do this to make sure your commits apply cleanly on a remote branch — perhaps in a project to which you’re trying to contribute but that you don’t maintain."
+* When ready for your contribution to be reviewed for potential inclusion in the main branch of the canonical *spring-batch* repository (what you know as 'upstream'), issue a pull request to the *spring-projects* repository (for more detail, see [GitHub help documentation][]).
+* The project lead may merge your changes into the upstream main branch as-is, he may keep the pull request open yet add a comment about something that should be modified, or he might reject the pull request by closing it.
+* A prerequisite for any pull request is that it will be cleanly merge-able with the upstream main's current state. **This is the responsibility of any contributor.** If your pull request cannot be applied cleanly, the project lead will most likely add a comment requesting that you make it merge-able. For a full explanation, see the Pro Git section on rebasing: [https://git-scm.com/book/en/v2/Git-Branching-Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing). As stated there: "> Often, you’ll do this to make sure your commits apply cleanly on a remote branch — perhaps in a project to which you’re trying to contribute but that you don’t maintain."
## Keeping your Local Code in Sync
-* As mentioned above, you should always work on topic branches (since 'master' is a moving target). However, you do want to always keep your own 'origin' master branch in synch with the 'upstream' master.
+* As mentioned above, you should always work on topic branches (since 'main' is a moving target). However, you do want to always keep your own 'origin' main branch in synch with the 'upstream' main.
* Within your local working directory, you can sync up all remotes' branches with: `git fetch --all`
-* While on your own local master branch: `git pull upstream master` (which is the equivalent of fetching upstream/master and merging that into the branch you are in currently)
-* Now that you're in synch, switch to the topic branch where you plan to work, e.g.: `git checkout -b BATCH-123`
+* While on your own local main branch: `git pull upstream main` (which is the equivalent of fetching upstream/main and merging that into the branch you are in currently)
+* Now that you're in sync, switch to the topic branch where you plan to work, e.g.: `git checkout -b GH-123`
* When you get to a stopping point: `git commit`
-* If changes have occurred on the upstream/master while you were working you can synch again:
- - Switch back to master: `git checkout master`
- - Then: `git pull upstream master`
- - Switch back to the topic branch: `git checkout BATCH-123` (no -b needed since the branch already exists)
- - Rebase the topic branch to minimize the distance between it and your recently synched master branch: `git rebase master`
-(Again, for more detail see the Pro Git section on rebasing: [http://progit.org/book/ch3-6.html](http://progit.org/book/ch3-6.html))
-* **Note** You cannot rebase if you have already pushed your branch to your remote because you'd be rewriting history (see **'The Perils of Rebasing'** in the article). If you rebase by mistake, you can undo it as discussed [in this stackoverflow discussion](http://stackoverflow.com/questions/134882/undoing-a-git-rebase). Once you have published your branch, you need to merge in the master rather than rebasing.
+* If changes have occurred on the upstream/main while you were working you can synch again:
+ - Switch back to main: `git checkout main`
+ - Then: `git pull upstream main`
+ - Switch back to the topic branch: `git checkout GH-123` (no -b needed since the branch already exists)
+ - Rebase the topic branch to minimize the distance between it and your recently synched main branch: `git rebase main`
+(Again, for more detail see the Pro Git section on rebasing: [https://git-scm.com/book/en/v2/Git-Branching-Rebasing](https://git-scm.com/book/en/v2/Git-Branching-Rebasing))
+* **Note** You cannot rebase if you have already pushed your branch to your remote because you'd be rewriting history (see **'The Perils of Rebasing'** in the article). If you rebase by mistake, you can undo it as discussed [in this stackoverflow discussion](https://stackoverflow.com/questions/134882/undoing-a-git-rebase). Once you have published your branch, you need to merge in the main rather than rebasing.
* Now, if you issue a pull request, it is much more likely to be merged without conflicts. Most likely, any pull request that would produce conflicts will be deferred until the issuer of that pull request makes these adjustments.
-* Assuming your pull request is merged into the 'upstream' master, you will actually end up pulling that change into your own master eventually, and at that time, you may decide to delete the topic branch from your local repository and your fork (origin) if you pushed it there.
- - to delete the local branch: `git branch -d BATCH-123`
- - to delete the branch from your origin: `git push origin :BATCH-123`
+* Assuming your pull request is merged into the 'upstream' main, you will actually end up pulling that change into your own main eventually, and at that time, you may decide to delete the topic branch from your local repository and your fork (origin) if you pushed it there.
+ - to delete the local branch: `git branch -d GH-123`
+ - to delete the branch from your origin: `git push origin :GH-123`
-## Maintain a linear commit history
+### Maintain a linear commit history
When issuing pull requests, please ensure that your commit history is linear. From the command line you can check this using:
@@ -94,31 +100,20 @@ git config --global alias.logg 'log --graph --pretty=oneline'
This command, will provide the following output, which in this case shows a nice linear history:
````
-* e1f6de38e04a5227fea2d4df193a5b50beaf2d00 BATCH-2002: Initial support for complex conditional replacements
+* e1f6de38e04a5227fea2d4df193a5b50beaf2d00 GH-2002: Initial support for complex conditional replacements
* 65d2df652abaae2ca309d96e3026c2d67312655f Add ability to set a custom TaskExecutor impl, remove unused namespaces from JSR bootst
* 85807568575c24d8878ad605a344f2bc35bb2b13 Update to allow restart parameters to override previous parameters in JsrJobOperator an
-* a21df75ce9dfc92e9768353b827da4248aefe425 BATCH-2049: Support multiple fragmentRootElementNames in StaxEventItemReader
+* a21df75ce9dfc92e9768353b827da4248aefe425 GH-2049: Support multiple fragmentRootElementNames in StaxEventItemReader
* 7f1130c9a265a3ce18a46cbbc122e6573167a036 Fix TCK test JobOperatorTests.testJobOperatorRestartJobAlreadyAbandoned
* c4231c4cc861bbcc43437c80a03ddd9b7b2897a3 Fixed no executions returned check and added a unit test
````
-If you see intersecting lines, that usually means that you forgot to rebase you branch. As mentioned earlier, **please rebase against master** before issuing a pull request.
-
-## Mind the whitespace
+If you see intersecting lines, that usually means that you forgot to rebase you branch. As mentioned earlier, **please rebase against main** before issuing a pull request.
-Please carefully follow the whitespace and formatting conventions already present in the framework.
+### Code style
-1. Tabs, not spaces
-2. Unix (LF), not DOS (CRLF) line endings
-3. Eliminate all trailing whitespace
-4. Wrap Javadoc at 90 characters
-5. Aim to wrap code at 90 characters, but favor readability over wrapping
-6. Preserve existing formatting; i.e. do not reformat code for its own sake
-7. Search the codebase using `git grep` and other tools to discover common
- naming conventions, etc.
-8. Latin-1 (ISO-8859-1) encoding for Java sources; use `native2ascii` to convert
- if necessary
+Please carefully follow the same [code style as Spring Framework](https://github.com/spring-projects/spring-framework/wiki/Code-Style).
-## Add Apache license header to all new classes
+### Add Apache license header to all new classes
```java
/*
@@ -128,7 +123,7 @@ Please carefully follow the whitespace and formatting conventions already presen
* 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
+ * https://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,
@@ -140,7 +135,7 @@ Please carefully follow the whitespace and formatting conventions already presen
package ...;
```
-## Update license header to modified files as necessary
+### Update license header to modified files as necessary
Always check the date range in the Apache license header. For example, if you've modified a file in 2013 whose header still reads
@@ -154,7 +149,7 @@ then be sure to update it to 2013 appropriately
* Copyright 2002-2013 the original author or authors.
```
-## Use @since tags
+### Use @since tags
Use @since tags for newly-added public API types and methods e.g.
@@ -168,15 +163,15 @@ Use @since tags for newly-added public API types and methods e.g.
*/
```
-## Submit JUnit test cases for all behavior changes
+### Submit JUnit test cases for all behavior changes
-Search the codebase to find related unit tests and add additional @Test methods within. It is also acceptable to submit test cases on a per JIRA issue basis.
+Search the codebase to find related unit tests and add additional @Test methods within. It is also acceptable to submit test cases on a per Github issue basis.
-## Squash commits
+### Squash commits
-Use `git rebase --interactive`, `git add --patch` and other tools to "squash" multiple commits into atomic changes. In addition to the man pages for git, there are many resources online to help you understand how these tools work. Here is one: http://book.git-scm.com/4_interactive_rebasing.html.
+Use `git rebase --interactive`, `git add --patch` and other tools to "squash" multiple commits into atomic changes. In addition to the man pages for git, there are many resources online to help you understand how these tools work. Here is one: https://book.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#_squashing .
-## Use your real name in git commits
+### Use your real name in git commits
Please configure git to use your real first and last name for any commits you intend to submit as pull requests. For example, this is not acceptable:
@@ -199,14 +194,14 @@ or locally for the *spring-batch repository only by omitting the '--global' flag
git config user.name "First Last"
git config user.email user@mail.com
-## Run all tests prior to submission
+### Run all tests prior to submission
See the [checking out and building][] section of the README for instructions. Make sure that all tests pass prior to submitting your pull request.
-## Mention your pull request on the associated JIRA issue
+### Mention your pull request on the associated Github issue
-Add a comment to the associated JIRA issue(s) linking to your new pull request.
+Add a comment to the associated Github issue(s) linking to your new pull request.
-[help documentation]: http://help.github.com/send-pull-requests
-[JIRA issue tracker]: https://jira.spring.io/browse/BATCH
+[GitHub help documentation]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-requests
+[Github issues]: https://github.com/spring-projects/spring-batch/issues
[checking out and building]: https://github.com/spring-projects/spring-batch#building-from-source
diff --git a/ISSUE_REPORTING.md b/ISSUE_REPORTING.md
new file mode 100644
index 0000000000..2e7b4e3c26
--- /dev/null
+++ b/ISSUE_REPORTING.md
@@ -0,0 +1,113 @@
+# Issue Reporting Guidelines
+
+Thank you very much for taking the time to report a bug to us, we greatly appreciate it! This document is designed to allow Spring Batch users and team members to contribute self-contained projects containing [minimal complete verifiable examples](https://en.wikipedia.org/wiki/Minimal_reproducible_example) for issues logged against the [issue tracker](https://github.com/spring-projects/spring-batch/issues) on GitHub.
+
+Our goal is to have a streamlined process for evaluating issues so that bugs get fixed more quickly!
+
+# How do I report a bug?
+
+## 1. Download the template of a minimal complete verifiable example
+
+We provide a template of a minimal complete verifiable example that you can download here: [spring-batch-mcve.zip](https://raw.githubusercontent.com/wiki/spring-projects/spring-batch/mcve/spring-batch-mcve.zip).
+This example uses an in-memory H2 database and provides a starting point that you need to edit, zip and attach to your issue on GitHub. You need to use Java 17+ and Maven 3+.
+
+Please run the following commands to make sure you have the sample working as expected:
+
+```shell
+$>unzip spring-batch-mcve.zip && cd spring-batch-mcve
+$>mvn package exec:java -Dexec.mainClass=org.springframework.batch.MyBatchJobConfiguration
+```
+
+You should see something like the following output:
+
+```
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchRegistrar - Finished Spring Batch infrastructure beans configuration in 5 ms.
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory - Starting embedded database: url='jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false', username='sa'
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.repository.support.JobRepositoryFactoryBean - No database type set, using meta data indicating: H2
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchObservabilityBeanPostProcessor - No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.configuration.annotation.BatchObservabilityBeanPostProcessor - No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - No TaskExecutor has been set, defaulting to synchronous executor.
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=job]] launched with the following parameters: [{}]
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.job.SimpleStepHandler - Executing step: [step]
+hello world
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.step.AbstractStep - Step: [step] executed in 11ms
+[org.springframework.batch.MyBatchJobConfiguration.main()] INFO org.springframework.batch.core.launch.support.SimpleJobLauncher - Job: [SimpleJob: [name=job]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 34ms
+COMPLETED
+```
+
+## 2. Edit the example as needed
+
+Once you have the minimal complete verifiable example running as expected, you can import it as a Maven project in your favourite IDE. Please make sure to:
+
+* Update the sample as needed to reproduce your issue. We have placed a few TODOs where we expect you to modify the code.
+* Add any dependency that is required to reproduce your issue in the `pom.xml` file.
+* Keep only the code that is required to reproduce your issue. This is very important! Please reduce as much noise as possible to let us focus on the code related to the issue.
+
+## 3. Package the example and attach it to your issue
+
+Once you manage to reproduce the issue, please clean up the `target` directory *before* creating the zip archive to upload. Here are the commands you can run to create the archive:
+
+```shell
+$>mvn clean
+$>zip -r spring-batch-mcve.zip spring-batch-mcve
+```
+
+:exclamation: Important note: The `mvn clean` command is very important here. Please **DO NOT** include the `target` directory with all dependencies in the archive! We appreciate your collaboration on this.
+
+Heads-up: If you think you can reproduce the issue with a JUnit test, that is awesome! The minimal example that we provide has a JUnit test that you can edit as needed to reproduce the issue.
+
+# What if I use another database than H2?
+
+If your issue is related to a specific database, please start with the same example as in the previous section and add a Docker-based test using the [Testcontainers](https://www.testcontainers.org) library and the JDBC driver of your database.
+
+For example, if you use PostgreSQL, you might add the following dependencies to the `pom.xml` file:
+
+```xml
+
+
+ org.postgresql
+ postgresql
+ 42.6.0
+
+
+
+
+ org.testcontainers
+ postgresql
+ 1.17.6
+ test
+
+```
+
+Also, remember to remove the H2 dependency as well, to keep the example as minimal as possible even in terms of dependencies.
+
+You can find several examples of Docker-based tests in the [test suite of Spring Batch](https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository), and a specific example for PostgreSQL [here](https://github.com/spring-projects/spring-batch/blob/main/spring-batch-core/src/test/java/org/springframework/batch/core/test/repository/PostgreSQLJobRepositoryIntegrationTests.java).
+
+# What if I use Spring Boot?
+
+If you use Spring Boot, the best way to create a minimal example is to generate a project on [https://start.spring.io](https://start.spring.io).
+
+Here is a quick link to generate a Maven-based Spring Boot application with Spring Batch and H2: [Sample project](https://start.spring.io/#!type=maven-project&language=java&platformVersion=3.0.4&packaging=jar&jvmVersion=17&groupId=com.example&artifactId=demo&name=demo&description=Demo%20project%20for%20Spring%20Boot&packageName=com.example.demo&dependencies=batch,h2).
+
+You can also generate a project on the command line, for example with `cURL`:
+
+```shell
+$>curl https://start.spring.io/starter.tgz -d dependencies=batch,h2 -d type=maven-project -d baseDir=spring-batch-mcve | tar -xzvf -
+```
+
+Once you have downloaded the project, please follow the same steps as in the previous section (edit the sample, zip it without the dependencies, etc).
+
+# Final thoughts
+
+More importantly, put yourself in the shoes of the project maintainer who is in charge of analysing and trying to reproduce your issue. Before uploading your minimal example, ask yourself: "How fast the Spring Batch team can understand and reproduce my issue?"
+
+Once we download your zip archive from the corresponding issue on GitHub, we expect to be two commands away from seeing a stack trace or the described abnormal behaviour:
+
+```shell
+$>unzip spring-batch-mcve.zip && cd spring-batch-mcve
+$>mvn package exec:java -Dexec.mainClass=org.springframework.batch.MyBatchJobConfiguration
+```
+
+Finally, please remember that those instructions are guidelines and not hard requirements. Be pragmatic! For example, if you already have a GitHub repository with the minimal example, there is no need to zip it and attach it to the issue, you would just need to add a link to it in your issue. If you think the issue is really obvious and does not require a minimal example, there is no need to create such an example, just go ahead and create the issue on GitHub by following the [Issue Template](https://github.com/spring-projects/spring-batch/blob/main/.github/ISSUE_TEMPLATE/bug_report.md).
+
+We appreciate your collaboration and we would like to thank you upfront for your time and effort!
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000000..62589edd12
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ https://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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
+
+ https://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.
diff --git a/README.md b/README.md
index e2f2455294..c1e523b841 100644
--- a/README.md
+++ b/README.md
@@ -1,48 +1,228 @@
-# Spring Batch [](https://build.spring.io/browse/BATCH-TRUNK)
+# Latest news
+
+* October 9, 2025: [Spring Batch 6.0.0 M4 is out!](https://spring.io/blog/2025/10/09/spring-batch-6-0-0-m4-released)
+* September 17, 2025: [Spring Batch 6.0.0 M3 and 5.2.3 available now](https://spring.io/blog/2025/09/17/spring-batch-6-0-0-m3-5-2-3-released)
+* August 20, 2025: [Spring Batch 6.0.0 M2 available now](https://spring.io/blog/2025/08/20/spring-batch-6)
+* July 23, 2025: [Spring Batch 6.0.0 M1 is out!](https://spring.io/blog/2025/07/23/spring-batch-6)
+
+
+
+# Spring Batch [](https://github.com/spring-projects/spring-batch/actions/workflows/continuous-integration.yml)
+
+Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. Spring Batch builds upon the productivity, POJO-based development approach, and general ease of use capabilities people have come to know from the [Spring Framework](https://github.com/spring-projects/spring-framework), while making it easy for developers to access and leverage more advanced enterprise services when necessary.
+
+# Getting Started
+
+## Two minutes tutorial
+
+This quick tutorial shows you how to setup a minimal project to run a simple batch job with Spring Batch.
+
+In your favorite IDE, create a new Maven-based Java 17+ project and add the following dependencies:
+
+```xml
+
+
+ org.springframework.batch
+ spring-batch-core
+ ${LATEST_VERSION}
+
+
+ org.hsqldb
+ hsqldb
+ ${LATEST_VERSION}
+ runtime
+
+
+```
+
+Then, create a configuration class to define the datasource and transaction manager that will be used by the job repository:
+
+```java
+import javax.sql.DataSource;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.jdbc.support.JdbcTransactionManager;
+import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
+
+@Configuration
+public class DataSourceConfiguration {
+
+ @Bean
+ public DataSource dataSource() {
+ return new EmbeddedDatabaseBuilder()
+ .addScript("/org/springframework/batch/core/schema-hsqldb.sql")
+ .build();
+ }
+
+ @Bean
+ public JdbcTransactionManager transactionManager(DataSource dataSource) {
+ return new JdbcTransactionManager(dataSource);
+ }
+
+}
+```
+
+In this tutorial, an embedded [HSQLDB](http://www.hsqldb.org) database is created and initialized with Spring Batch's meta-data tables.
+
+Finally, create a class to define the batch job:
+
+```java
+import org.springframework.batch.core.Job;
+import org.springframework.batch.core.JobParameters;
+import org.springframework.batch.core.Step;
+import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
+import org.springframework.batch.core.job.builder.JobBuilder;
+import org.springframework.batch.core.launch.JobLauncher;
+import org.springframework.batch.core.repository.JobRepository;
+import org.springframework.batch.core.step.builder.StepBuilder;
+import org.springframework.batch.repeat.RepeatStatus;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.AnnotationConfigApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Import;
+import org.springframework.jdbc.support.JdbcTransactionManager;
+
+@Configuration
+@EnableBatchProcessing
+@Import(DataSourceConfiguration.class)
+public class HelloWorldJobConfiguration {
+
+ @Bean
+ public Step step(JobRepository jobRepository, JdbcTransactionManager transactionManager) {
+ return new StepBuilder("step", jobRepository).tasklet((contribution, chunkContext) -> {
+ System.out.println("Hello world!");
+ return RepeatStatus.FINISHED;
+ }, transactionManager).build();
+ }
+
+ @Bean
+ public Job job(JobRepository jobRepository, Step step) {
+ return new JobBuilder("job", jobRepository).start(step).build();
+ }
+
+ public static void main(String[] args) throws Exception {
+ ApplicationContext context = new AnnotationConfigApplicationContext(HelloWorldJobConfiguration.class);
+ JobLauncher jobLauncher = context.getBean(JobLauncher.class);
+ Job job = context.getBean(Job.class);
+ jobLauncher.run(job, new JobParameters());
+ }
+
+}
+```
+
+The job in this tutorial is composed of a single step that prints "Hello world!" to the standard output.
+
+You can now run the `main` method of the `HelloWorldJobConfiguration` class to launch the job. The output should be similar to the following:
+
+```
+INFO: Finished Spring Batch infrastructure beans configuration in 8 ms.
+INFO: Starting embedded database: url='jdbc:hsqldb:mem:testdb', username='sa'
+INFO: No database type set, using meta data indicating: HSQL
+INFO: No Micrometer observation registry found, defaulting to ObservationRegistry.NOOP
+INFO: No TaskExecutor has been set, defaulting to synchronous executor.
+INFO: Job: [SimpleJob: [name=job]] launched with the following parameters: [{}]
+INFO: Executing step: [step]
+Hello world!
+INFO: Step: [step] executed in 10ms
+INFO: Job: [SimpleJob: [name=job]] completed with the following parameters: [{}] and the following status: [COMPLETED] in 25ms
+```
+
+## Getting Started Guide
+
+This guide is a more realistic tutorial that shows a typical ETL batch job that reads data from a flat file, transforms it and writes it to a relational database.
+It is a Spring Batch project based on Spring Boot. You find the Getting Started Guide here: [Creating a Batch Service](https://spring.io/guides/gs/batch-processing/).
+
+## Samples
+
+You can find several samples to try out here: [Spring Batch Samples](https://github.com/spring-projects/spring-batch/tree/main/spring-batch-samples).
-Spring Batch is a lightweight, comprehensive batch framework designed to enable the development of robust batch applications vital for the daily operations of enterprise systems. Spring Batch builds upon the productivity, POJO-based development approach, and general ease of use capabilities people have come to know from the [Spring Framework](https://github.com/SpringSource/spring-framework), while making it easy for developers to access and leverage more advanced enterprise services when necessary.
+# Getting Help
+
+If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions)
+or ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch).
+
+Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests.
+We would like to keep the issue tracker **exclusively** for bug reports and feature requests.
+
+# Reporting issues
+
+Spring Batch uses [GitHub Issues](https://github.com/spring-projects/spring-batch/issues) to record bugs and feature requests. If you want to raise an issue, please follow the recommendations below:
-If you are looking for a runtime container for your Batch applications, or need a management console to view current and historic executions, take a look at [Spring Batch Admin](http://docs.spring.io/spring-batch-admin). It is a set of services (Java, JSON, JMX) and an optional web UI that you can use to manage and monitor a Batch system.
+* Before you open an issue, please search the issue tracker to see if someone has already reported the problem. If the issue doesn't already exist, create a new issue.
+* Please provide as much information as possible in the issue report by following the [Issue Reporting Template](https://github.com/spring-projects/spring-batch/blob/main/.github/ISSUE_TEMPLATE/bug_report.md).
+* If you need to paste code or include a stack trace, please use Markdown escapes (```) before and after your text.
+
+For non trivial bugs, please create a test case or a project that replicates the problem and attach it to the issue, as detailed in the [Issue Reporting Guidelines](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md).
+
+# Reporting Security Vulnerabilities
+
+Please see our [Security policy](https://github.com/spring-projects/spring-batch/security/policy).
# Building from Source
+## Using the Command Line
+
Clone the git repository using the URL on the Github home page:
- $ git clone git://github.com/SpringSource/spring-batch.git
+ $ git clone git@github.com:spring-projects/spring-batch.git
$ cd spring-batch
-## Command Line
-Gradle is the build tool used for Spring Batch. You can perform a full build of Spring Batch via the command:
+Maven is the build tool used for Spring Batch. You can build the project with the following command:
- $ ./gradlew build
+ $ ./mvnw package
-## Spring Tool Suite (STS)
-In STS (or any Eclipse distro or other IDE with Maven support), import the module directories as existing projects. They should compile and the tests should run with no additional steps.
+If you want to perform a full build with all integration tests, then run:
-# Getting Started Using Spring Boot
-This is the quickest way to get started with a new Spring Batch project. You find the Getting Started Guide for Spring
-Batch on Spring.io: [Creating a Batch Service](http://spring.io/guides/gs/batch-processing/)
+ $ ./mvnw verify
-# Getting Started Using Spring Tool Suite (STS)
+Please note that some integration tests are based on Docker, so please make sure to have Docker up and running before running a full build.
-It requires an internet connection for download, and access to a Maven repository (remote or local).
+To generate the reference documentation, run the following commands:
-* Download STS version 3.4.* (or better) from the [Spring website](http://spring.io/tools/sts/). STS is a free Eclipse bundle with many features useful for Spring developers.
-* Go to `File->New->Spring Template Project` from the menu bar (in the Spring perspective).
-* The wizard has a drop down with a list of template projects. One of them is a "Simple Spring Batch Project". Select it and follow the wizard.
-* A project is created with all dependencies and a simple input/output job configuration. It can be run using a unit test, or on the command line (see instructions in the pom.xml).
+```
+$ cd spring-batch-docs
+$ ../mvnw antora:antora
+```
-# Getting Help
+The reference documentation can be found in `spring-batch-docs/target/anotra/site`.
+
+## Using Docker
+
+If you want to build the project in a Docker container, you can proceed as follows:
+
+```
+$> docker run -it --mount type=bind,source="$(pwd)",target=/spring-batch maven:3-openjdk-17 bash
+#> cd spring-batch
+#> ./mvnw package
+```
-Read the main project [website](http://projects.spring.io/spring-batch/) and the [User Guide](http://docs.spring.io/spring-batch/trunk/reference/). Look at the source code and the Javadocs. For more detailed questions, use the [forum](http://forum.spring.io/forum/spring-projects/batch). If you are new to Spring as well as to Spring Batch, look for information about [Spring projects](http://spring.io/projects).
+This will mount the source code that you cloned previously on the host inside the container.
+If you want to work on a copy of the source code inside the container (no side effects on the host),
+you can proceed as follows:
+
+```
+$> docker run -it maven:3-openjdk-17 bash
+#> git clone https://github.com/spring-projects/spring-batch.git
+#> cd spring-batch
+#> ./mvnw package
+```
# Contributing to Spring Batch
-Here are some ways for you to get involved in the community:
+We welcome contributions in any kind! Here are some ways for you to contribute to the project:
+
+* Get involved with the Spring Batch community on [Twitter](https://twitter.com/springbatch), [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions) and [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch) by responding to questions and joining the debate.
+* Create [issues](https://github.com/spring-projects/spring-batch/issues) for bugs and new features or comment and vote on the ones that you are interested in.
+* Help us reproduce issues marked with [status: need-help-to-reproduce](https://github.com/spring-projects/spring-batch/labels/status%3A%20need-help-to-reproduce) by following the [Issue Reporting Guidelines](https://github.com/spring-projects/spring-batch/blob/main/ISSUE_REPORTING.md).
+* Github is for social coding: if you want to write code, we encourage contributions through pull requests. If you want to contribute code this way, please familiarize yourself with the process outlined here: [Contributor Guidelines](https://github.com/spring-projects/spring-batch/blob/main/CONTRIBUTING.md).
+* Watch for Spring Batch related articles on [spring.io](https://spring.io).
+
+# Code of Conduct
+
+Please see our [code of conduct](https://github.com/spring-projects/.github/blob/main/CODE_OF_CONDUCT.md).
-* Get involved with the Spring community on the Spring Community Forums. Please help out on the [forum](http://forum.spring.io/forum/spring-projects/batch) by responding to questions and joining the debate.
-* Create [JIRA](https://jira.spring.io/browse/BATCH) tickets for bugs and new features and comment and vote on the ones that you are interested in.
-* Github is for social coding: if you want to write code, we encourage contributions through pull requests from [forks of this repository](http://help.github.com/forking/). If you want to contribute code this way, please familiarize yourself with the process oulined for contributing to Spring projects here: [Contributor Guidelines](https://github.com/SpringSource/spring-integration/wiki/Contributor-Guidelines).
-* Watch for upcoming articles on Spring by [subscribing](feed://assets.spring.io/drupal/node/feed.xml) to spring.io
+# License
-Before we accept a non-trivial patch or pull request we will need you to sign the [contributor's agreement](https://support.springsource.com/spring_committer_signup). Signing the contributor's agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.
+Spring Batch is Open Source software released under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.html).
diff --git a/SUPPORT.md b/SUPPORT.md
new file mode 100644
index 0000000000..fe4c3bbcd0
--- /dev/null
+++ b/SUPPORT.md
@@ -0,0 +1,5 @@
+If you have a question or a support request, please open a new discussion on [GitHub Discussions](https://github.com/spring-projects/spring-batch/discussions)
+or ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/spring-batch).
+
+Please do **not** create issues on the [Issue Tracker](https://github.com/spring-projects/spring-batch/issues) for questions or support requests.
+We would like to keep the issue tracker **exclusively** for bug reports and feature requests.
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
deleted file mode 100644
index ccc3683172..0000000000
--- a/build.gradle
+++ /dev/null
@@ -1,818 +0,0 @@
-description = 'Spring Batch'
-
-apply plugin: 'base'
-apply plugin: 'idea'
-
-buildscript {
- repositories {
- maven { url 'https://repo.spring.io/plugins-release' }
- }
- dependencies {
- classpath 'org.springframework.build.gradle:docbook-reference-plugin:0.2.8'
- classpath 'org.springframework.build.gradle:propdeps-plugin:0.0.5'
- classpath 'io.spring.gradle:spring-io-plugin:0.0.4.RELEASE'
- }
-}
-
-ext {
- linkHomepage = 'http://projects.spring.io/spring-batch/'
- linkCi = 'https://build.spring.io/browse/BATCH'
- linkIssue = 'https://jira.spring.io/browse/BATCH'
- linkScmUrl = 'https://github.com/spring-projects/spring-batch'
- linkScmConnection = 'git://github.com/spring-projects/spring-batch.git'
- linkScmDevConnection = 'git@github.com:spring-projects/spring-batch.git'
-
- mainProjects = subprojects.findAll { !it.name.endsWith('tests') && !it.name.endsWith('samples') }
-}
-
-allprojects {
- group = 'org.springframework.batch'
-
- repositories {
- maven { url 'https://repo.spring.io/libs-milestone' }
- maven { url 'https://repo.spring.io/plugins-release' }
- maven { url "https://repo.spring.io/libs-snapshot" }
-
- maven { url 'https://m2.neo4j.org/content/repositories/releases'}
- mavenCentral()
- }
-
- ext {
-
- environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql'
-
- springVersionDefault = '4.0.5.RELEASE'
- springVersion = project.hasProperty('springVersion') ? getProperty('springVersion') : springVersionDefault
- springRetryVersion = '1.1.0.RELEASE'
- springAmqpVersion = '1.3.3.RELEASE'
- springDataCommonsVersion = '1.8.0.RELEASE'
- springDataGemfireVersion = '1.4.0.RELEASE'
- springDataJpaVersion = '1.6.0.RELEASE'
- springDataMongodbVersion = '1.5.0.RELEASE'
- springDataNeo4jVersion = '3.1.0.RELEASE'
- springIntegrationVersion = '4.0.1.RELEASE'
- springLdapVersion = '2.0.2.RELEASE'
-
- activemqVersion = '5.9.1'
- aspectjVersion = '1.8.0'
- castorVersion = '1.3.2'
- commonsCollectionsVersion = '3.2.1'
- commonsDdbcpVersion = '1.4'
- commonsIoVersion = '2.4'
- commonsLangVersion = '2.6'
- derbyVersion = '10.10.1.1'
- groovyVersion = '2.3.0'
- hamcrestVersion = '1.3'
- h2databaseVersion = '1.3.175'
- hibernateVersion = '4.2.12.Final'
- hibernateValidatorVersion = '4.3.1.Final'
- hsqldbVersion = '2.3.2'
- ibatisVersion = '2.3.4.726'
- jacksonVersion = '1.9.13'
- javaMailVersion = '1.4.7'
- javaxBatchApiVersion = '1.0'
- javaxInjectVersion = '1'
- jbatchTckSpi = '1.0'
- jettisonVersion = '1.2'
- jtdsVersion = '1.2.4'
- junitVersion = '4.11'
- log4jVersion = '1.2.17'
- mysqlVersion = '5.1.29'
- mockitoVersion = '1.9.5'
- postgresqlVersion = '9.0-801.jdbc4'
- quartzVersion = '2.2.1'
- servletApiVersion = '3.0.1'
- slf4jVersion = '1.7.7'
- sqlfireclientVersion = '1.0.3'
- sqliteVersion = '3.7.2'
- woodstoxVersion = '4.2.0'
- xercesVersion = '2.8.1'
- xmlunitVersion = '1.5'
- xstreamVersion = '1.4.7'
- jrubyVersion = '1.7.22'
- beanshellVersion = '2.0b5'
- }
-}
-
-subprojects { subproject ->
-
- apply plugin: 'java'
- apply from: "${rootProject.projectDir}/publish-maven.gradle"
- apply plugin: 'jacoco'
- apply plugin: 'propdeps-idea'
- apply plugin: 'propdeps-eclipse'
-
- jacoco {
- toolVersion = "0.7.0.201403182114"
- }
-
- compileJava {
- sourceCompatibility=1.6
- targetCompatibility=1.6
- options.encoding='UTF-8'
- }
-
- compileTestJava {
- sourceCompatibility=1.7
- targetCompatibility=1.7
- options.encoding='UTF-8'
- }
-
- eclipse {
- project {
- natures += 'org.springframework.ide.eclipse.core.springnature'
- }
- }
-
- sourceSets {
- test {
- resources {
- srcDirs = ['src/test/resources', 'src/test/java']
- }
- }
- }
-
- // enable all compiler warnings; individual projects may customize further
- ext.xLintArg = '-Xlint:all'
- [compileJava, compileTestJava]*.options*.compilerArgs = [xLintArg]
-
- tasks.withType(Test).all {
- // suppress all console output during testing unless running `gradle -i`
- logging.captureStandardOutput(LogLevel.INFO)
- systemProperty "ENVIRONMENT", environmentProperty
-
- jacoco {
- append = false
- destinationFile = file("$buildDir/jacoco.exec")
- }
-
- include '**/*Tests.class'
- exclude '**/Abstract*.class'
- }
-
- test {
- jacoco {
- append = false
- destinationFile = file("$buildDir/jacoco.exec")
- }
-
-// testLogging {
-// showStandardStreams = true
-// }
- }
-
- task sourcesJar(type: Jar) {
- classifier = 'sources'
- from sourceSets.main.allJava
- }
-
- task javadocJar(type: Jar) {
- classifier = 'javadoc'
- from javadoc
- }
-
- task checkTestConfigs << {
- def configFiles = []
- sourceSets.test.java.srcDirs.each {
- fileTree(it).include('**/*.xml').exclude('**/log4j.xml').each { configFile ->
- def configXml = new XmlParser(false, false).parse(configFile)
-
- if (configXml.@'xsi:schemaLocation' ==~ /.*spring-[a-z-]*\d\.\d\.xsd.*/) {
- configFiles << configFile
- }
- }
- }
- if (configFiles) {
- throw new InvalidUserDataException('Hardcoded XSD version in the config files:\n' +
- configFiles.collect {relativePath(it)}.join('\n') +
- '\nPlease, use versionless schemaLocations for Spring XSDs to avoid issues with builds on different versions of dependencies.')
- }
- }
-
- jar {
- manifest.attributes["Created-By"] =
- "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
- manifest.attributes["Implementation-Title"] = subproject.name
- manifest.attributes["Implementation-Version"] = subproject.version
-
- from("${rootProject.projectDir}/src/dist") {
- include "license.txt"
- include "notice.txt"
- into "META-INF"
- expand(copyright: new Date().format("yyyy"), version: project.version)
- }
- }
-
- test.dependsOn checkTestConfigs
-
- artifacts {
- archives sourcesJar
- archives javadocJar
- }
-}
-
-configure(mainProjects) {
- if (project.hasProperty('platformVersion')) {
- apply plugin: 'spring-io'
-
- repositories {
- maven { url "https://repo.spring.io/libs-snapshot" }
- }
-
- dependencyManagement {
- springIoTestRuntime {
- imports {
- mavenBom "io.spring.platform:platform-bom:${platformVersion}"
- }
- }
- }
- }
-}
-
-project('spring-batch-core') {
- description = 'Spring Batch Core'
-
- dependencies {
- compile project(":spring-batch-infrastructure")
-
- compile "com.ibm.jbatch:com.ibm.jbatch-tck-spi:$jbatchTckSpi"
- compile "com.thoughtworks.xstream:xstream:$xstreamVersion"
- compile ("org.codehaus.jettison:jettison:$jettisonVersion") {
- exclude group: 'stax', module: 'stax-api'
- }
- compile "org.springframework:spring-aop:$springVersion"
- compile "org.springframework:spring-beans:$springVersion"
- compile "org.springframework:spring-context:$springVersion"
- compile "org.springframework:spring-core:$springVersion"
- compile "org.springframework:spring-tx:$springVersion"
-
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile("org.mockito:mockito-core:$mockitoVersion") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile "javax.inject:javax.inject:$javaxInjectVersion"
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "com.h2database:h2:$h2databaseVersion"
- testCompile "commons-io:commons-io:$commonsIoVersion"
- testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- testCompile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- optional "org.aspectj:aspectjrt:$aspectjVersion"
- optional "org.aspectj:aspectjweaver:$aspectjVersion"
- optional "org.springframework:spring-jdbc:$springVersion"
- optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
- optional "log4j:log4j:$log4jVersion"
-
- provided "javax.batch:javax.batch-api:$javaxBatchApiVersion"
- }
-}
-
-project('spring-batch-infrastructure') {
- description = 'Spring Batch Infrastructure'
- test {
- // permsize settings not passed down from GRADLE_OPTS nor JAVA_OPTS
- // when running certain tests causing permgen OOM when using JDK7
- // compilation is not performed with JDK6 and permgen is removed
- // starting with JDK8..
- if (JavaVersion.current().isJava7Compatible()) {
- jvmArgs '-XX:MaxPermSize=256m'
- }
- }
-
- dependencies {
-
- compile "org.springframework:spring-core:$springVersion"
- compile "org.springframework.retry:spring-retry:$springRetryVersion"
-
- testCompile "log4j:log4j:$log4jVersion"
- testCompile "commons-io:commons-io:$commonsIoVersion"
- testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "com.h2database:h2:$h2databaseVersion"
- testCompile "org.apache.derby:derby:$derbyVersion"
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- testCompile "org.aspectj:aspectjrt:$aspectjVersion"
- testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
- testCompile("org.mockito:mockito-core:$mockitoVersion") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile "org.xerial:sqlite-jdbc:$sqliteVersion"
-
- testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
- testRuntime "org.codehaus.groovy:groovy-jsr223:$groovyVersion"
- testRuntime "org.jruby:jruby:$jrubyVersion"
-
- testRuntime "org.beanshell:bsh:$beanshellVersion"
-
- optional "javax.jms:jms-api:1.1-rev-1"
- optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
- optional "org.codehaus.jackson:jackson-mapper-asl:$jacksonVersion"
- compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- optional "org.hibernate:hibernate-validator:$hibernateValidatorVersion"
- optional "javax.transaction:javax.transaction-api:1.2"
- optional "org.apache.ibatis:ibatis-sqlmap:$ibatisVersion"
- optional "javax.mail:javax.mail-api:$javaMailVersion"
- optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
- compile("org.springframework:spring-oxm:$springVersion") { dep ->
- optional dep
- exclude group: 'commons-lang', module: 'commons-lang'
- }
- optional "org.springframework:spring-aop:$springVersion"
- optional "org.springframework:spring-context:$springVersion"
- compile("org.springframework:spring-context-support:$springVersion") { dep ->
- optional dep
- }
- optional "org.springframework:spring-jdbc:$springVersion"
- optional "org.springframework:spring-jms:$springVersion"
- optional "org.springframework:spring-orm:$springVersion"
- optional "org.springframework:spring-tx:$springVersion"
- optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
- optional "org.springframework.data:spring-data-mongodb:$springDataMongodbVersion"
- optional "org.springframework.data:spring-data-neo4j:$springDataNeo4jVersion"
- optional "org.springframework.data:spring-data-gemfire:$springDataGemfireVersion"
- compile("org.codehaus.woodstox:woodstox-core-asl:$woodstoxVersion") { dep ->
- optional dep
- exclude group: 'stax', module: 'stax-api'
- }
- optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
- optional "org.springframework.amqp:spring-rabbit:$springAmqpVersion"
- optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
- optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
- optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
- }
-}
-
-project('spring-batch-core-tests') {
- description = 'Spring Batch Core Tests'
- project.tasks.findByPath("artifactoryPublish")?.enabled = false
- dependencies {
- compile project(":spring-batch-core")
- compile project(":spring-batch-infrastructure")
- compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- compile "org.springframework:spring-jdbc:$springVersion"
- compile "org.springframework.retry:spring-retry:$springRetryVersion"
- compile "org.springframework:spring-tx:$springVersion"
- compile "org.springframework:spring-aop:$springVersion"
-
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "commons-io:commons-io:$commonsIoVersion"
- testCompile "org.apache.derby:derby:$derbyVersion"
- testCompile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- testCompile "log4j:log4j:$log4jVersion"
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile "org.springframework:spring-jdbc:$springVersion"
-
- runtime "mysql:mysql-connector-java:$mysqlVersion"
- runtime "postgresql:postgresql:$postgresqlVersion"
-
- optional "org.aspectj:aspectjrt:$aspectjVersion"
- optional "org.aspectj:aspectjweaver:$aspectjVersion"
- optional "org.springframework.ldap:spring-ldap-core:$springLdapVersion"
- optional "org.springframework.ldap:spring-ldap-core-tiger:$springLdapVersion"
- optional "org.springframework.ldap:spring-ldap-ldif-core:$springLdapVersion"
- }
- test {
- enabled = project.hasProperty('alltests') ? true : false
- }
-}
-
-project('spring-batch-infrastructure-tests') {
- description = 'Spring Batch Infrastructure Tests'
- project.tasks.findByPath("artifactoryPublish")?.enabled = false
- dependencies {
- compile project(":spring-batch-infrastructure")
- compile "javax.jms:jms-api:1.1-rev-1"
- compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- compile "org.springframework:spring-tx:$springVersion"
- compile "org.springframework:spring-aop:$springVersion"
-
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "commons-io:commons-io:$commonsIoVersion"
- testCompile "org.apache.derby:derby:$derbyVersion"
- testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
- testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
- testCompile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- testCompile "org.apache.geronimo.specs:geronimo-j2ee-management_1.1_spec:1.0.1"
- testCompile "xmlunit:xmlunit:$xmlunitVersion"
- testCompile ("org.codehaus.castor:castor-xml:$castorVersion") {
- exclude group: 'stax', module: 'stax'
- exclude group: 'commons-lang', module: 'commons-lang'
- }
- testCompile "log4j:log4j:$log4jVersion"
- testCompile "xerces:xercesImpl:$xercesVersion"
- testCompile "com.thoughtworks.xstream:xstream:$xstreamVersion"
- testCompile("org.codehaus.woodstox:woodstox-core-asl:$woodstoxVersion") {
- exclude group: 'stax', module: 'stax-api'
- }
- testCompile "commons-lang:commons-lang:$commonsLangVersion"
- testCompile("org.springframework:spring-oxm:$springVersion") {
- exclude group: 'commons-lang', module: 'commons-lang'
- }
- testCompile "org.springframework:spring-jdbc:$springVersion"
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile("org.mockito:mockito-core:$mockitoVersion") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
-
- optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
- optional "org.apache.ibatis:ibatis-sqlmap:$ibatisVersion"
- compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- optional "javax.transaction:javax.transaction-api:1.2"
- optional "org.springframework:spring-orm:$springVersion"
- optional "org.springframework:spring-jms:$springVersion"
-
- runtime "mysql:mysql-connector-java:$mysqlVersion"
- runtime "postgresql:postgresql:$postgresqlVersion"
- }
- test {
- enabled = project.hasProperty('alltests') ? true : false
- }
-}
-
-//Domain for batch job testing
-project('spring-batch-test') {
- description = 'Spring Batch Test'
-
- dependencies {
- compile project(":spring-batch-core")
-
- compile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- compile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- compile "org.springframework:spring-test:$springVersion"
- compile "org.springframework:spring-jdbc:$springVersion"
- compile "commons-io:commons-io:$commonsIoVersion"
- compile "commons-collections:commons-collections:$commonsCollectionsVersion"
-
- testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
-
- optional "org.aspectj:aspectjrt:$aspectjVersion"
- optional "javax.batch:javax.batch-api:$javaxBatchApiVersion"
- }
-}
-
-project('spring-batch-integration') {
- description = 'Batch Integration'
-
- dependencies {
- compile project(":spring-batch-core")
-
- compile "org.springframework.retry:spring-retry:$springRetryVersion"
- compile "org.springframework:spring-context:$springVersion"
- compile "org.springframework:spring-messaging:$springVersion"
- compile "org.springframework:spring-aop:$springVersion"
- compile "org.springframework.integration:spring-integration-core:$springIntegrationVersion"
- compile "org.springframework:spring-tx:$springVersion"
-
- testCompile project(":spring-batch-test")
-
- testCompile "org.apache.activemq:activemq-broker:$activemqVersion"
- testCompile "org.apache.activemq:activemq-kahadb-store:$activemqVersion"
- testCompile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- testCompile "org.aspectj:aspectjrt:$aspectjVersion"
- testCompile "org.aspectj:aspectjweaver:$aspectjVersion"
- testCompile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- testCompile "com.h2database:h2:$h2databaseVersion"
- testCompile "mysql:mysql-connector-java:$mysqlVersion"
- testCompile "org.apache.derby:derby:$derbyVersion"
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile("org.mockito:mockito-core:$mockitoVersion") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.springframework.integration:spring-integration-test:$springIntegrationVersion") {
- exclude group: 'junit', module: 'junit-dep'
- }
- testCompile "org.springframework.integration:spring-integration-jdbc:$springIntegrationVersion"
-
- optional "javax.jms:jms-api:1.1-rev-1"
- optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
- optional "log4j:log4j:1.2.14"
- optional "org.springframework.integration:spring-integration-jms:$springIntegrationVersion"
- optional "org.springframework:spring-jms:$springVersion"
- }
-}
-
-project('spring-batch-samples') {
- description = 'Batch Batch Samples'
- project.tasks.findByPath("artifactoryPublish")?.enabled = false
-
- dependencies {
-
- compile project(":spring-batch-core")
- compile "org.aspectj:aspectjrt:$aspectjVersion"
- compile "org.aspectj:aspectjweaver:$aspectjVersion"
- compile "org.quartz-scheduler:quartz:$quartzVersion"
- compile "commons-io:commons-io:$commonsIoVersion"
- compile "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- compile "com.thoughtworks.xstream:xstream:$xstreamVersion"
- compile("org.codehaus.woodstox:woodstox-core-asl:$woodstoxVersion") {
- exclude group: 'stax', module: 'stax-api'
- }
- compile("org.hibernate:hibernate-core:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- compile("org.hibernate:hibernate-entitymanager:$hibernateVersion") { dep ->
- optional dep
- exclude group: 'org.jboss.spec.javax.transaction', module: 'jboss-transaction-api_1.1_spec'
- }
- compile "javax.transaction:javax.transaction-api:1.2"
- compile "org.apache.ibatis:ibatis-sqlmap:$ibatisVersion"
- compile "org.springframework:spring-aop:$springVersion"
- compile("org.springframework:spring-oxm:$springVersion") {
- exclude group: 'commons-lang', module: 'commons-lang'
- }
- compile "org.springframework:spring-core:$springVersion"
- compile "org.springframework:spring-context-support:$springVersion"
- compile "org.springframework:spring-jdbc:$springVersion"
- compile "org.springframework:spring-orm:$springVersion"
- compile "org.springframework:spring-tx:$springVersion"
- compile "org.springframework.data:spring-data-jpa:$springDataJpaVersion"
- compile "javax.mail:javax.mail-api:$javaMailVersion"
-
- testCompile "xmlunit:xmlunit:$xmlunitVersion"
- testCompile project(":spring-batch-test")
- testCompile("junit:junit:${junitVersion}") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
- testCompile("org.hamcrest:hamcrest-all:$hamcrestVersion")
- testCompile "org.hsqldb:hsqldb:$hsqldbVersion"
- testCompile "log4j:log4j:$log4jVersion"
- testCompile "org.codehaus.groovy:groovy:$groovyVersion"
- testCompile "org.codehaus.groovy:groovy-ant:$groovyVersion"
- testCompile "org.springframework:spring-test:$springVersion"
- testCompile("org.mockito:mockito-core:$mockitoVersion") {
- exclude group:'org.hamcrest', module:'hamcrest-core'
- }
-
- testRuntime "com.sun.mail:javax.mail:$javaMailVersion"
-
- provided "mysql:mysql-connector-java:$mysqlVersion"
- provided "net.sourceforge.jtds:jtds:$jtdsVersion"
- provided "com.h2database:h2:$h2databaseVersion"
- provided "javax.servlet:javax.servlet-api:$servletApiVersion"
-
- optional "com.vmware.sqlfire:sqlfireclient:$sqlfireclientVersion"
- optional "org.slf4j:slf4j-log4j12:$slf4jVersion"
- optional "org.apache.derby:derby:$derbyVersion"
- optional "postgresql:postgresql:$postgresqlVersion"
- optional "org.springframework:spring-web:$springVersion"
- optional "org.springframework.data:spring-data-commons:$springDataCommonsVersion"
- optional "org.springframework.amqp:spring-amqp:$springAmqpVersion"
- optional "org.springframework.amqp:spring-rabbit:$springAmqpVersion"
- optional "javax.inject:javax.inject:1"
-
- }
-}
-
-apply plugin: 'docbook-reference'
-
-reference {
- //sourceDir = file('src/reference/docbook')
- sourceDir = file('src/site/docbook/reference')
-}
-
-apply plugin: 'sonar-runner'
-
-sonarRunner {
- sonarProperties {
- property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
- property "sonar.links.homepage", linkHomepage
- property "sonar.links.ci", linkCi
- property "sonar.links.issue", linkIssue
- property "sonar.links.scm", linkScmUrl
- property "sonar.links.scm_dev", linkScmDevConnection
- property "sonar.java.coveragePlugin", "jacoco"
- }
-}
-
-task api(type: Javadoc) {
- group = 'Documentation'
- description = 'Generates aggregated Javadoc API documentation.'
- title = "${rootProject.description} ${version} API"
- options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
- options.author = true
- options.header = rootProject.description
- options.overview = 'src/api/overview.html'
- if (JavaVersion.current().isJava8Compatible()) {
- options.addStringOption('Xdoclint:none', '-quiet')
- }
-
- source subprojects.collect { project ->
- project.sourceSets.main.allJava
- }
- destinationDir = new File(buildDir, "api")
- classpath = files(subprojects.collect { project ->
- project.sourceSets.main.compileClasspath
- })
-}
-
-task schemaZip(type: Zip) {
- group = 'Distribution'
- classifier = 'schema'
- description = "Builds -${classifier} archive containing all " +
- "XSDs for deployment at static.springframework.org/schema."
-
- subprojects.each { subproject ->
- def Properties schemas = new Properties();
- def shortName = subproject.name.replaceFirst("${rootProject.name}-", '')
- if (subproject.name.endsWith("-core")) {
- shortName = ''
- }
-
- subproject.sourceSets.main.resources.find {
- it.path.endsWith('META-INF/spring.schemas')
- }?.withInputStream { schemas.load(it) }
-
- for (def key : schemas.keySet()) {
- File xsdFile = subproject.sourceSets.main.resources.find {
- it.path.endsWith(schemas.get(key))
- }
- assert xsdFile != null
- into ("batch/${shortName}") {
- from xsdFile.path
- }
- }
- }
-}
-
-task docsZip(type: Zip) {
- group = 'Distribution'
- classifier = 'docs'
- description = "Builds -${classifier} archive containing api and reference " +
- "for deployment at static.springframework.org/spring-batch/reference."
-
- from('src/dist') {
- include 'changelog.txt'
- }
-
- from (api) {
- into 'api'
- }
-
- from (reference) {
- into 'reference'
- }
-}
-
-task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
- group = 'Distribution'
- classifier = 'dist'
- description = "Builds -${classifier} archive, containing all jars and docs, " +
- "suitable for community download page."
-
- ext.baseDir = "${project.name}-${project.version}";
-
- from('src/dist') {
- include 'readme.txt'
- include 'license.txt'
- include 'notice.txt'
- into "${baseDir}"
- expand(copyright: new Date().format("yyyy"), version: project.version)
- }
-
- from(zipTree(docsZip.archivePath)) {
- into "${baseDir}/docs"
- }
-
- from(zipTree(schemaZip.archivePath)) {
- into "${baseDir}/schema"
- }
-
- [project(':spring-batch-core'), project(':spring-batch-infrastructure'), project(':spring-batch-test'), project(':spring-batch-integration')].each { subproject ->
- into ("${baseDir}/libs") {
- from subproject.jar
- from subproject.sourcesJar
- from subproject.javadocJar
- }
- }
-}
-
-// Create an optional "with dependencies" distribution.
-// Not published by default; only for use when building from source.
-task depsZip(type: Zip, dependsOn: distZip) { zipTask ->
- group = 'Distribution'
- classifier = 'dist-with-deps'
- description = "Builds -${classifier} archive, containing everything " +
- "in the -${distZip.classifier} archive plus all dependencies."
-
- from zipTree(distZip.archivePath)
-
- gradle.taskGraph.whenReady { taskGraph ->
- if (taskGraph.hasTask(":${zipTask.name}")) {
- def projectNames = rootProject.subprojects*.name
- def artifacts = new HashSet()
- subprojects.each { subproject ->
- subproject.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each { artifact ->
- def dependency = artifact.moduleVersion.id
- if (!projectNames.contains(dependency.name)) {
- artifacts << artifact.file
- }
- }
- }
-
- zipTask.from(artifacts) {
- into "${distZip.baseDir}/deps"
- }
- }
- }
-}
-
-artifacts {
- archives distZip
- archives docsZip
- archives schemaZip
-}
-
-task dist(dependsOn: assemble) {
- group = 'Distribution'
- description = 'Builds -dist, -docs and -schema distribution archives.'
-}
-
-task runTck(dependsOn: subprojects.compileJava) {
-
- configurations {
- tck {
- transitive = true
- }
- antcp {
- transitive = true
- exclude module: 'ant'
- }
- }
-
- dependencies {
- tck project(":spring-batch-core")
-
- tck 'commons-pool:commons-pool:1.5.4'
- tck "javax.batch:javax.batch-api:$javaxBatchApiVersion"
- tck "org.springframework:spring-core:$springVersion"
- tck "org.springframework:spring-context:$springVersion"
- tck "org.springframework:spring-beans:$springVersion"
- tck 'commons-logging:commons-logging-api:1.1'
- tck "org.springframework:spring-aop:$springVersion"
- tck "org.springframework:spring-tx:$springVersion"
- tck "org.springframework.retry:spring-retry:$springRetryVersion"
- tck "org.hsqldb:hsqldb:$hsqldbVersion"
- tck "org.springframework:spring-jdbc:$springVersion"
- tck "com.thoughtworks.xstream:xstream:$xstreamVersion"
- tck "org.codehaus.jettison:jettison:$jettisonVersion"
- tck "commons-dbcp:commons-dbcp:$commonsDdbcpVersion"
- tck "org.apache.derby:derby:$derbyVersion"
-
- antcp "ant-contrib:ant-contrib:1.0b3"
- }
-
- doLast {
- logger.info('tck dependencies: ' + configurations.tck.asPath)
- def tckHome = project.hasProperty('TCK_HOME') ? getProperty('TCK_HOME') : System.getenv("JSR_352_TCK_HOME")
-
- assert tckHome : '''\
-tckHome is not set. Please set either the environment variable 'JSR_352_TCK_HOME'
-or specify the Gradle property `TCK_HOME`, e.g: ./gradlew runTck -PTCK_HOME=/path/to/tck'''
-
- println "Using the JSR 352 TCK at: '$tckHome'"
-
- ant.taskdef resource: "net/sf/antcontrib/antcontrib.properties",
- classpath: configurations.antcp.asPath
- ant.properties['batch.impl.classes'] = configurations.tck.asPath
- ant.ant antfile: "$tckHome/build.xml", target: "run", dir: "$tckHome"
- }
-}
-
-task wrapper(type: Wrapper) {
- description = 'Generates gradlew[.bat] scripts'
- gradleVersion = '1.11'
-}
diff --git a/build.properties b/build.properties
deleted file mode 100644
index 76fddd2749..0000000000
--- a/build.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-version=2.2.0
-integration.repo.dir=${basedir}/../integration-repo
-ivy.cache.dir=${basedir}/../ivy-cache
-
-# For when releasing
-#release.type=release
-#build.stamp=RELEASE
-
-# For when releasing milestones
-#release.type=milestone
-#build.stamp=M1
-
-# For development in trunk (the default)
-#release.type=integration
-
diff --git a/gradle.properties b/gradle.properties
deleted file mode 100644
index bfc39af96c..0000000000
--- a/gradle.properties
+++ /dev/null
@@ -1 +0,0 @@
-version=3.1.0.BUILD-SNAPSHOT
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 5838598129..0000000000
Binary files a/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index f5ee6ed8d4..0000000000
--- a/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Thu May 08 10:59:52 CDT 2014
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.11-all.zip
diff --git a/gradlew b/gradlew
deleted file mode 100755
index 91a7e269e1..0000000000
--- a/gradlew
+++ /dev/null
@@ -1,164 +0,0 @@
-#!/usr/bin/env bash
-
-##############################################################################
-##
-## Gradle start up script for UN*X
-##
-##############################################################################
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS=""
-
-APP_NAME="Gradle"
-APP_BASE_NAME=`basename "$0"`
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD="maximum"
-
-warn ( ) {
- echo "$*"
-}
-
-die ( ) {
- echo
- echo "$*"
- echo
- exit 1
-}
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-case "`uname`" in
- CYGWIN* )
- cygwin=true
- ;;
- Darwin* )
- darwin=true
- ;;
- MINGW* )
- msys=true
- ;;
-esac
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched.
-if $cygwin ; then
- [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-fi
-
-# Attempt to set APP_HOME
-# Resolve links: $0 may be a link
-PRG="$0"
-# Need this for relative symlinks.
-while [ -h "$PRG" ] ; do
- ls=`ls -ld "$PRG"`
- link=`expr "$ls" : '.*-> \(.*\)$'`
- if expr "$link" : '/.*' > /dev/null; then
- PRG="$link"
- else
- PRG=`dirname "$PRG"`"/$link"
- fi
-done
-SAVED="`pwd`"
-cd "`dirname \"$PRG\"`/" >&-
-APP_HOME="`pwd -P`"
-cd "$SAVED" >&-
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD="java"
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
- MAX_FD_LIMIT=`ulimit -H -n`
- if [ $? -eq 0 ] ; then
- if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
- MAX_FD="$MAX_FD_LIMIT"
- fi
- ulimit -n $MAX_FD
- if [ $? -ne 0 ] ; then
- warn "Could not set maximum file descriptor limit: $MAX_FD"
- fi
- else
- warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
- fi
-fi
-
-# For Darwin, add options to specify how the application appears in the dock
-if $darwin; then
- GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
-fi
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
- APP_HOME=`cygpath --path --mixed "$APP_HOME"`
- CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
-
- # We build the pattern for arguments to be converted via cygpath
- ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
- SEP=""
- for dir in $ROOTDIRSRAW ; do
- ROOTDIRS="$ROOTDIRS$SEP$dir"
- SEP="|"
- done
- OURCYGPATTERN="(^($ROOTDIRS))"
- # Add a user-defined pattern to the cygpath arguments
- if [ "$GRADLE_CYGPATTERN" != "" ] ; then
- OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
- fi
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- i=0
- for arg in "$@" ; do
- CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
- CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
-
- if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
- eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
- else
- eval `echo args$i`="\"$arg\""
- fi
- i=$((i+1))
- done
- case $i in
- (0) set -- ;;
- (1) set -- "$args0" ;;
- (2) set -- "$args0" "$args1" ;;
- (3) set -- "$args0" "$args1" "$args2" ;;
- (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
- (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
- (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
- (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
- (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
- (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
- esac
-fi
-
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/gradlew.bat b/gradlew.bat
deleted file mode 100755
index aec99730b4..0000000000
--- a/gradlew.bat
+++ /dev/null
@@ -1,90 +0,0 @@
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS=
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto init
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto init
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:init
-@rem Get command-line arguments, handling Windowz variants
-
-if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%@eval[2+2]" == "4" goto 4NT_args
-
-:win9xME_args
-@rem Slurp the command line arguments.
-set CMD_LINE_ARGS=
-set _SKIP=2
-
-:win9xME_args_slurp
-if "x%~1" == "x" goto execute
-
-set CMD_LINE_ARGS=%*
-goto execute
-
-:4NT_args
-@rem Get arguments from the 4NT Shell from JP Software
-set CMD_LINE_ARGS=%$
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/mvnw b/mvnw
new file mode 100755
index 0000000000..a16b5431b4
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you 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
+#
+# https://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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
new file mode 100644
index 0000000000..c8d43372c9
--- /dev/null
+++ b/mvnw.cmd
@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM https://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000000..535d2ff038
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,411 @@
+
+
+ 4.0.0
+ org.springframework.batch
+ spring-batch
+ Spring Batch
+ Spring Batch is a lightweight, comprehensive batch framework
+ designed to enable the development of robust batch applications vital
+ for the daily operations of enterprise systems. Spring Batch is part of
+ the Spring Portfolio.
+ 6.0.0-SNAPSHOT
+ pom
+ https://projects.spring.io/spring-batch
+
+
+ spring-batch-infrastructure
+ spring-batch-core
+ spring-batch-test
+ spring-batch-integration
+ spring-batch-samples
+ spring-batch-docs
+ spring-batch-bom
+
+
+
+ Spring
+ https://spring.io
+
+
+ https://github.com/spring-projects/spring-batch
+ git://github.com/spring-projects/spring-batch.git
+ git@github.com:spring-projects/spring-batch.git
+
+
+ Github Issues
+ https://github.com/spring-projects/spring-batch/issues
+
+
+ Github Actions
+ https://github.com/spring-projects/spring-batch/actions
+
+
+
+ Apache 2.0
+ https://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+
+ UTF-8
+ 17
+
+
+ 7.0.0-M9
+ 2.0.12
+ 7.0.0-M3
+ 1.16.0-M3
+
+
+ 4.0.0-M6
+ 4.0.0-M6
+ 4.0.0-M6
+ 5.0.0-M6
+ 4.0.0-M5
+ 4.0.0-M5
+ 4.0.0-M3
+
+ 2.19.2
+ 1.12.0
+ 2.13.1
+ 7.1.0.Final
+ 3.0.0
+ 2.1.3
+ 3.1.0
+ 3.1.1
+ 3.2.0
+ 5.5.1
+ 6.0.0-RC3
+ 6.0.0-RC3
+
+
+ 3.0.2
+
+
+ 1.6.0-M3
+
+ 1.4.21
+ 4.13.2
+ ${junit-jupiter.version}
+ 3.0
+ 3.27.4
+ 5.19.0
+ 2.10.3
+ 2.20.0
+ 2.13.0
+ 2.0.17
+ 2.7.4
+ 2.3.232
+ 3.50.3.0
+ 10.16.1.1
+ 2.25.12
+ 2.42.0
+ 4.0.5
+ 2.25.1
+ 9.0.1.Final
+ 6.0.1
+ 4.0.2
+ 2.0.1
+ 4.0.2
+ 2.0.4
+ 7.1.1
+ 1.9.24
+ 9.4.0
+ 3.5.5
+ 42.7.7
+ 12.1.2.0
+ 19.28.0.0
+ 11.2.3.jre17
+ 1.3.1
+ 1.21.3
+ 2.2.4
+ 1.5.3
+ 4.0.28
+ 15.6
+ 2.0b6
+ 9.4.13.0
+ 6.8.0.RELEASE
+ 6.1.0
+
+
+ ${spring-amqp.version}
+ 2.5.0
+ 1.4.1
+ 3.0.22
+
+
+ 0.0.4
+
+
+ 3.14.0
+ 3.5.3
+ 3.5.3
+ 3.11.3
+ 3.3.1
+ 1.7.2
+ 3.1.4
+ 3.7.1
+ 3.4.2
+ 0.0.47
+ 2.42.0
+ 0.12.10
+
+
+
+
+
+ io.spring.javaformat
+ spring-javaformat-maven-plugin
+ ${spring-javaformat-maven-plugin.version}
+
+
+ validate
+ true
+
+ validate
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven-compiler-plugin.version}
+
+ ${java.version}
+
+ -parameters
+
+ -XDcompilePolicy=simple
+ --should-stop=ifError=FLOW
+
+ -Xplugin:ErrorProne
+
+ -Xep:NullAway:ERROR
+ -XepOpt:NullAway:OnlyNullMarked
+
+ -XepOpt:NullAway:CustomContractAnnotations=org.springframework.lang.Contract
+ -XepOpt:NullAway:SuppressionNameAliases=DataFlowIssue
+
+ -XepExcludedPaths:.*/src/test/java/.*
+
+
+
+
+ com.google.errorprone
+ error_prone_core
+ ${error-prone.version}
+
+
+ com.uber.nullaway
+ nullaway
+ ${nullaway.version}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${maven-surefire-plugin.version}
+
+ ${surefireArgLine}
+
+ **/*IntegrationTests.java
+ **/*FunctionalTests.java
+
+
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+ ${maven-failsafe-plugin.version}
+
+
+ **/*IntegrationTests.java
+ **/*FunctionalTests.java
+
+
+
+
+
+ integration-test
+ verify
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+ ${maven-jar-plugin.version}
+
+
+
+ ${project.artifactId}
+ ${project.version}
+ ${module.name}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ ${maven-javadoc-plugin.version}
+
+
+ org.springframework.batch.samples.*
+
+ ${project.basedir}/spring-batch-docs/src/main/javadoc/overview.html
+ false
+ all,-missing
+ true
+
+
+
+ generate-javadocs
+ package
+
+ jar
+
+
+ src/main/java
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-source-plugin
+ ${maven-source-plugin.version}
+
+
+ generate-sources
+ package
+
+ jar
+
+
+
+
+
+ org.codehaus.mojo
+ flatten-maven-plugin
+ ${flatten-maven-plugin.version}
+
+
+ flatten
+ process-resources
+
+ flatten
+
+
+ true
+ ossrh
+
+ remove
+ resolve
+ remove
+ keep
+ keep
+ resolve
+
+
+
+
+ clean
+ clean
+
+ clean
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-deploy-plugin
+ ${maven-deploy-plugin.version}
+
+
+
+
+
+
+ maven-central
+ https://repo.maven.apache.org/maven2/
+
+ false
+
+
+ true
+
+
+
+ spring-snapshots
+ Spring Snapshots
+ https://repo.spring.io/snapshot
+
+ true
+
+
+ false
+
+
+
+
+
+
+ dsyer
+ Dave Syer
+ dsyer@vmware.com
+
+
+ nebhale
+ Ben Hale
+ bhale@vmware.com
+
+
+ lward
+ Lucas Ward
+
+
+ robokaso
+ Robert Kasanicky
+ robokaso@gmail.com
+
+
+ trisberg
+ Thomas Risberg
+ trisberg@vmware.com
+
+
+ dhgarrette
+ Dan Garrette
+ dhgarrette@gmail.com
+
+
+ mminella
+ Michael Minella
+ mminella@vmware.com
+
+ Project Lead
+
+
+
+ chrisjs
+ Chris Schaefer
+ cschaefer@vmware.com
+
+
+ fmbenhassine
+ Mahmoud Ben Hassine
+ mbenhassine@vmware.com
+
+ Project Lead
+
+
+
+
+
diff --git a/publish-maven.gradle b/publish-maven.gradle
deleted file mode 100644
index fdc22cf447..0000000000
--- a/publish-maven.gradle
+++ /dev/null
@@ -1,90 +0,0 @@
-apply plugin: "propdeps-maven"
-
-install {
- repositories.mavenInstaller {
- customizePom(pom, project)
- }
-}
-
-def customizePom(pom, gradleProject) {
- pom.whenConfigured { generatedPom ->
-
- // eliminate test-scoped dependencies (no need in maven central poms)
- generatedPom.dependencies.removeAll { dep ->
- dep.scope == 'test'
- }
-
- // sort to make pom dependencies order consistent to ease comparison of older poms
- generatedPom.dependencies = generatedPom.dependencies.sort { dep ->
- "$dep.scope:$dep.groupId:$dep.artifactId"
- }
-
- // add all items necessary for maven central publication
- generatedPom.project {
- name = gradleProject.description
- description = gradleProject.description
- url = linkHomepage
- organization {
- name = 'Spring'
- url = 'http://spring.io'
- }
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- distribution 'repo'
- }
- }
-
- scm {
- url = linkScmUrl
- connection = 'scm:git:' + linkScmConnection
- developerConnection = 'scm:git:' + linkScmDevConnection
- }
-
- developers {
- developer {
- id = 'dsyer'
- name = 'Dave Syer'
- email = 'dsyer@gopivotal.com'
- }
- developer {
- id = 'nebhale'
- name = 'Ben Hale'
- email = 'bhale@gopivotal.com'
- }
- developer {
- id = 'lward'
- name = 'Lucas Ward'
- email = 'lucas.l.ward@accenture.com'
- }
- developer {
- id = 'robokaso'
- name = 'Robert Kasanicky'
- email = 'robokaso@gmail.com'
- }
- developer {
- id = 'trisberg'
- name = 'Thomas Risberg'
- email = 'trisberg@gopivotal.com'
- }
- developer {
- id = 'dhgarrette'
- name = 'Dan Garrette'
- email = 'dhgarrette@gmail.com'
- }
- developer {
- id = 'mminella'
- name = 'Michael Minella'
- email = 'mminella@gopivotal.com'
- roles = ["project lead"]
- }
- developer {
- id = 'chrisjs'
- name = 'Chris Schaefer'
- email = 'cschaefer@gopivotal.com'
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
deleted file mode 100644
index 114e2ac7fe..0000000000
--- a/settings.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-rootProject.name = 'spring-batch'
-
-include 'spring-batch-core'
-include 'spring-batch-core-tests'
-include 'spring-batch-infrastructure'
-include 'spring-batch-infrastructure-tests'
-include 'spring-batch-test'
-include 'spring-batch-integration'
-include 'spring-batch-samples'
diff --git a/spring-batch-bom/pom.xml b/spring-batch-bom/pom.xml
new file mode 100644
index 0000000000..a833c69e25
--- /dev/null
+++ b/spring-batch-bom/pom.xml
@@ -0,0 +1,69 @@
+
+
+ 4.0.0
+
+ org.springframework.batch
+ spring-batch
+ 6.0.0-SNAPSHOT
+
+ spring-batch-bom
+ pom
+ Spring Batch BOM
+ Bill of materials for Spring Batch modules
+ https://projects.spring.io/spring-batch
+
+
+ Spring
+ https://spring.io
+
+
+
+ https://github.com/spring-projects/spring-batch
+ git://github.com/spring-projects/spring-batch.git
+ git@github.com:spring-projects/spring-batch.git
+
+
+
+ Github Issues
+ https://github.com/spring-projects/spring-batch/issues
+
+
+
+ Github Actions
+ https://github.com/spring-projects/spring-batch/actions
+
+
+
+
+ Apache 2.0
+ https://www.apache.org/licenses/LICENSE-2.0.txt
+ repo
+
+
+
+
+
+
+ org.springframework.batch
+ spring-batch-core
+ ${project.parent.version}
+
+
+ org.springframework.batch
+ spring-batch-infrastructure
+ ${project.parent.version}
+
+
+ org.springframework.batch
+ spring-batch-integration
+ ${project.parent.version}
+
+
+ org.springframework.batch
+ spring-batch-test
+ ${project.parent.version}
+
+
+
+
+
diff --git a/spring-batch-core-tests/.springBeans b/spring-batch-core-tests/.springBeans
deleted file mode 100644
index 5dbfbb4bee..0000000000
--- a/spring-batch-core-tests/.springBeans
+++ /dev/null
@@ -1,308 +0,0 @@
-
-
- 1
-
-
-
-
-
-
- src/test/resources/data-source-context.xml
- src/test/resources/simple-job-launcher-context.xml
- src/test/resources/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests-context.xml
- src/main/resources/META-INF/batch/footballJob.xml
- src/main/resources/META-INF/batch/footballSkipJob.xml
- src/main/resources/META-INF/batch/parallelJob.xml
- src/main/resources/META-INF/batch/timeoutJob.xml
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
- true
- false
-
-
-
-
-
-
-
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/Game.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/Game.java
deleted file mode 100644
index 77b6b6d16e..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/Game.java
+++ /dev/null
@@ -1,296 +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.test.football;
-
-import java.io.Serializable;
-
-@SuppressWarnings("serial")
-public class Game implements Serializable {
-
- private String id;
-
- private int year;
-
- private String team;
-
- private int week;
-
- private String opponent;
-
- private int completes;
-
- private int attempts;
-
- private int passingYards;
-
- private int passingTd;
-
- private int interceptions;
-
- private int rushes;
-
- private int rushYards;
-
- private int receptions;
-
- private int receptionYards;
-
- private int totalTd;
-
- /**
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- /**
- * @return the year
- */
- public int getYear() {
- return year;
- }
-
- /**
- * @return the team
- */
- public String getTeam() {
- return team;
- }
-
- /**
- * @return the week
- */
- public int getWeek() {
- return week;
- }
-
- /**
- * @return the opponent
- */
- public String getOpponent() {
- return opponent;
- }
-
- /**
- * @return the completes
- */
- public int getCompletes() {
- return completes;
- }
-
- /**
- * @return the attempts
- */
- public int getAttempts() {
- return attempts;
- }
-
- /**
- * @return the passingYards
- */
- public int getPassingYards() {
- return passingYards;
- }
-
- /**
- * @return the passingTd
- */
- public int getPassingTd() {
- return passingTd;
- }
-
- /**
- * @return the interceptions
- */
- public int getInterceptions() {
- return interceptions;
- }
-
- /**
- * @return the rushes
- */
- public int getRushes() {
- return rushes;
- }
-
- /**
- * @return the rushYards
- */
- public int getRushYards() {
- return rushYards;
- }
-
- /**
- * @return the receptions
- */
- public int getReceptions() {
- return receptions;
- }
-
- /**
- * @return the receptionYards
- */
- public int getReceptionYards() {
- return receptionYards;
- }
-
- /**
- * @return the totalTd
- */
- public int getTotalTd() {
- return totalTd;
- }
-
- /**
- * @param id the id to set
- */
- public void setId(String id) {
- this.id = id;
- }
-
- /**
- * @param year the year to set
- */
- public void setYear(int year) {
- this.year = year;
- }
-
- /**
- * @param team the team to set
- */
- public void setTeam(String team) {
- this.team = team;
- }
-
- /**
- * @param week the week to set
- */
- public void setWeek(int week) {
- this.week = week;
- }
-
- /**
- * @param opponent the opponent to set
- */
- public void setOpponent(String opponent) {
- this.opponent = opponent;
- }
-
- /**
- * @param completes the completes to set
- */
- public void setCompletes(int completes) {
- this.completes = completes;
- }
-
- /**
- * @param attempts the attempts to set
- */
- public void setAttempts(int attempts) {
- this.attempts = attempts;
- }
-
- /**
- * @param passingYards the passingYards to set
- */
- public void setPassingYards(int passingYards) {
- this.passingYards = passingYards;
- }
-
- /**
- * @param passingTd the passingTd to set
- */
- public void setPassingTd(int passingTd) {
- this.passingTd = passingTd;
- }
-
- /**
- * @param interceptions the interceptions to set
- */
- public void setInterceptions(int interceptions) {
- this.interceptions = interceptions;
- }
-
- /**
- * @param rushes the rushes to set
- */
- public void setRushes(int rushes) {
- this.rushes = rushes;
- }
-
- /**
- * @param rushYards the rushYards to set
- */
- public void setRushYards(int rushYards) {
- this.rushYards = rushYards;
- }
-
- /**
- * @param receptions the receptions to set
- */
- public void setReceptions(int receptions) {
- this.receptions = receptions;
- }
-
- /**
- * @param receptionYards the receptionYards to set
- */
- public void setReceptionYards(int receptionYards) {
- this.receptionYards = receptionYards;
- }
-
- /**
- * @param totalTd the totalTd to set
- */
- public void setTotalTd(int totalTd) {
- this.totalTd = totalTd;
- }
-
- @Override
- public String toString() {
-
- return "Game: ID=" + id + " " + team + " vs. " + opponent + " - " + year;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- Game other = (Game) obj;
- if (id == null) {
- if (other.id != null)
- return false;
- }
- else if (!id.equals(other.id))
- return false;
- return true;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/Player.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/Player.java
deleted file mode 100644
index c220b2fa07..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/Player.java
+++ /dev/null
@@ -1,82 +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.test.football;
-
-import java.io.Serializable;
-
-@SuppressWarnings("serial")
-public class Player implements Serializable {
-
- private String id;
- private String lastName;
- private String firstName;
- private String position;
- private int birthYear;
- private int debutYear;
-
- @Override
- public String toString() {
-
- return "PLAYER:id=" + id + ",Last Name=" + lastName +
- ",First Name=" + firstName + ",Position=" + position +
- ",Birth Year=" + birthYear + ",DebutYear=" +
- debutYear;
- }
-
- public String getId() {
- return id;
- }
- public String getLastName() {
- return lastName;
- }
- public String getFirstName() {
- return firstName;
- }
- public String getPosition() {
- return position;
- }
- public int getBirthYear() {
- return birthYear;
- }
- public int getDebutYear() {
- return debutYear;
- }
- public void setId(String id) {
- this.id = id;
- }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
- public void setPosition(String position) {
- this.position = position;
- }
- public void setBirthYear(int birthYear) {
- this.birthYear = birthYear;
- }
- public void setDebutYear(int debutYear) {
- this.debutYear = debutYear;
- }
-
-
-
-
-
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/PlayerDao.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/PlayerDao.java
deleted file mode 100644
index 5fedace708..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/PlayerDao.java
+++ /dev/null
@@ -1,26 +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.test.football;
-
-
-/**
- * Interface for writing {@link Player} objects to arbitrary output.
- */
-public interface PlayerDao {
-
- void savePlayer(Player player);
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/PlayerSummary.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/PlayerSummary.java
deleted file mode 100644
index fcc7445b59..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/football/PlayerSummary.java
+++ /dev/null
@@ -1,147 +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.test.football;
-
-
-/**
- * Domain object representing the summary of a given Player's
- * year.
- *
- * @author Lucas Ward
- *
- */
-public class PlayerSummary {
-
- private String id;
- private int year;
- private int completes;
- private int attempts;
- private int passingYards;
- private int passingTd;
- private int interceptions;
- private int rushes;
- private int rushYards;
- private int receptions;
- private int receptionYards;
- private int totalTd;
-
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public int getYear() {
- return year;
- }
- public void setYear(int year) {
- this.year = year;
- }
- public int getCompletes() {
- return completes;
- }
- public void setCompletes(int completes) {
- this.completes = completes;
- }
- public int getAttempts() {
- return attempts;
- }
- public void setAttempts(int attempts) {
- this.attempts = attempts;
- }
- public int getPassingYards() {
- return passingYards;
- }
- public void setPassingYards(int passingYards) {
- this.passingYards = passingYards;
- }
- public int getPassingTd() {
- return passingTd;
- }
- public void setPassingTd(int passingTd) {
- this.passingTd = passingTd;
- }
- public int getInterceptions() {
- return interceptions;
- }
- public void setInterceptions(int interceptions) {
- this.interceptions = interceptions;
- }
- public int getRushes() {
- return rushes;
- }
- public void setRushes(int rushes) {
- this.rushes = rushes;
- }
- public int getRushYards() {
- return rushYards;
- }
- public void setRushYards(int rushYards) {
- this.rushYards = rushYards;
- }
- public int getReceptions() {
- return receptions;
- }
- public void setReceptions(int receptions) {
- this.receptions = receptions;
- }
- public int getReceptionYards() {
- return receptionYards;
- }
- public void setReceptionYards(int receptionYards) {
- this.receptionYards = receptionYards;
- }
- public int getTotalTd() {
- return totalTd;
- }
- public void setTotalTd(int totalTd) {
- this.totalTd = totalTd;
- }
-
-
- @Override
- public String toString() {
- return "Player Summary: ID=" + id + " Year=" + year + "[" + completes + ";" + attempts + ";" + passingYards +
- ";" + passingTd + ";" + interceptions + ";" + rushes + ";" + rushYards + ";" + receptions +
- ";" + receptionYards + ";" + totalTd;
- }
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- PlayerSummary other = (PlayerSummary) obj;
- if (id == null) {
- if (other.id != null)
- return false;
- }
- else if (!id.equals(other.id))
- return false;
- return true;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/timeout/LoggingItemWriter.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/timeout/LoggingItemWriter.java
deleted file mode 100644
index 9c59d0a0de..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/timeout/LoggingItemWriter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright 2014 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.test.timeout;
-
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.item.ItemWriter;
-
-public class LoggingItemWriter implements ItemWriter {
-
- protected Log logger = LogFactory.getLog(LoggingItemWriter.class);
-
- @Override
- public void write(List extends T> items) throws Exception {
- logger.info(items);
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/timeout/SleepingTasklet.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/timeout/SleepingTasklet.java
deleted file mode 100644
index 58267ad8f1..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/core/test/timeout/SleepingTasklet.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2014 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.test.timeout;
-
-import org.springframework.batch.core.StepContribution;
-import org.springframework.batch.core.scope.context.ChunkContext;
-import org.springframework.batch.core.step.tasklet.Tasklet;
-import org.springframework.batch.repeat.RepeatStatus;
-
-public class SleepingTasklet implements Tasklet {
-
- private long millisToSleep;
-
- @Override
- public RepeatStatus execute(StepContribution contribution,
- ChunkContext chunkContext) throws Exception {
- Thread.sleep(millisToSleep);
- return RepeatStatus.FINISHED;
- }
-
- public void setMillisToSleep(long millisToSleep) {
- this.millisToSleep = millisToSleep;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/FootballExceptionHandler.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/FootballExceptionHandler.java
deleted file mode 100644
index 9a8131c777..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/FootballExceptionHandler.java
+++ /dev/null
@@ -1,41 +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.sample.domain.football.internal;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.batch.repeat.RepeatContext;
-import org.springframework.batch.repeat.exception.ExceptionHandler;
-
-public class FootballExceptionHandler implements ExceptionHandler {
-
- private static final Log logger = LogFactory
- .getLog(FootballExceptionHandler.class);
-
- @Override
- public void handleException(RepeatContext context, Throwable throwable)
- throws Throwable {
-
- if (!(throwable instanceof NumberFormatException)) {
- throw throwable;
- } else {
- logger.error("Number Format Exception!", throwable);
- }
-
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/GameFieldSetMapper.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/GameFieldSetMapper.java
deleted file mode 100644
index de7143f94f..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/GameFieldSetMapper.java
+++ /dev/null
@@ -1,52 +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.sample.domain.football.internal;
-
-import org.springframework.batch.core.test.football.Game;
-import org.springframework.batch.item.file.mapping.FieldSetMapper;
-import org.springframework.batch.item.file.transform.FieldSet;
-
-public class GameFieldSetMapper implements FieldSetMapper {
-
- @Override
- public Game mapFieldSet(FieldSet fs) {
-
- if(fs == null){
- return null;
- }
-
- Game game = new Game();
- game.setId(fs.readString("id"));
- game.setYear(fs.readInt("year"));
- game.setTeam(fs.readString("team"));
- game.setWeek(fs.readInt("week"));
- game.setOpponent(fs.readString("opponent"));
- game.setCompletes(fs.readInt("completes"));
- game.setAttempts(fs.readInt("attempts"));
- game.setPassingYards(fs.readInt("passingYards"));
- game.setPassingTd(fs.readInt("passingTd"));
- game.setInterceptions(fs.readInt("interceptions"));
- game.setRushes(fs.readInt("rushes"));
- game.setRushYards(fs.readInt("rushYards"));
- game.setReceptions(fs.readInt("receptions", 0));
- game.setReceptionYards(fs.readInt("receptionYards"));
- game.setTotalTd(fs.readInt("totalTd"));
-
- return game;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcGameDao.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcGameDao.java
deleted file mode 100644
index 7d6589cec1..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcGameDao.java
+++ /dev/null
@@ -1,59 +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.sample.domain.football.internal;
-
-import java.util.List;
-
-import org.springframework.batch.core.test.football.Game;
-import org.springframework.batch.item.ItemWriter;
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
-import org.springframework.jdbc.core.namedparam.SqlParameterSource;
-import org.springframework.jdbc.core.support.JdbcDaoSupport;
-import org.springframework.jdbc.core.simple.SimpleJdbcInsert;
-
-public class JdbcGameDao extends JdbcDaoSupport implements ItemWriter {
-
- private SimpleJdbcInsert insertGame;
-
- @Override
- protected void initDao() throws Exception {
- super.initDao();
- insertGame = new SimpleJdbcInsert(getDataSource()).withTableName("GAMES").usingColumns("player_id", "year_no",
- "team", "week", "opponent", " completes", "attempts", "passing_yards", "passing_td", "interceptions",
- "rushes", "rush_yards", "receptions", "receptions_yards", "total_td");
- }
-
- @Override
- public void write(List extends Game> games) {
-
- for (Game game : games) {
-
- SqlParameterSource values = new MapSqlParameterSource().addValue("player_id", game.getId()).addValue(
- "year_no", game.getYear()).addValue("team", game.getTeam()).addValue("week", game.getWeek())
- .addValue("opponent", game.getOpponent()).addValue("completes", game.getCompletes()).addValue(
- "attempts", game.getAttempts()).addValue("passing_yards", game.getPassingYards()).addValue(
- "passing_td", game.getPassingTd()).addValue("interceptions", game.getInterceptions())
- .addValue("rushes", game.getRushes()).addValue("rush_yards", game.getRushYards()).addValue(
- "receptions", game.getReceptions()).addValue("receptions_yards", game.getReceptionYards())
- .addValue("total_td", game.getTotalTd());
- this.insertGame.execute(values);
-
- }
-
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java
deleted file mode 100644
index cd059c4234..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerDao.java
+++ /dev/null
@@ -1,46 +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.sample.domain.football.internal;
-
-import org.springframework.batch.core.test.football.Player;
-import org.springframework.batch.core.test.football.PlayerDao;
-import org.springframework.jdbc.core.namedparam.BeanPropertySqlParameterSource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-
-import javax.sql.DataSource;
-
-/**
- * @author Lucas Ward
- *
- */
-public class JdbcPlayerDao implements PlayerDao {
-
- public static final String INSERT_PLAYER =
- "INSERT into PLAYERS (player_id, last_name, first_name, pos, year_of_birth, year_drafted)" +
- " values (:id, :lastName, :firstName, :position, :birthYear, :debutYear)";
-
- private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
-
- @Override
- public void savePlayer(Player player) {
- namedParameterJdbcTemplate.update(INSERT_PLAYER, new BeanPropertySqlParameterSource(player));
- }
-
- public void setDataSource(DataSource dataSource) {
- this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
- }
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerSummaryDao.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerSummaryDao.java
deleted file mode 100644
index 953ffa5fbb..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/JdbcPlayerSummaryDao.java
+++ /dev/null
@@ -1,57 +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.sample.domain.football.internal;
-
-import java.util.List;
-
-import org.springframework.batch.core.test.football.PlayerSummary;
-import org.springframework.batch.item.ItemWriter;
-import org.springframework.jdbc.core.namedparam.MapSqlParameterSource;
-import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-
-import javax.sql.DataSource;
-
-public class JdbcPlayerSummaryDao implements ItemWriter {
-
- private static final String INSERT_SUMMARY = "INSERT into PLAYER_SUMMARY(ID, YEAR_NO, COMPLETES, ATTEMPTS, PASSING_YARDS, PASSING_TD, "
- + "INTERCEPTIONS, RUSHES, RUSH_YARDS, RECEPTIONS, RECEPTIONS_YARDS, TOTAL_TD) "
- + "values(:id, :year, :completes, :attempts, :passingYards, :passingTd, "
- + ":interceptions, :rushes, :rushYards, :receptions, :receptionYards, :totalTd)";
-
- private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
-
- @Override
- public void write(List extends PlayerSummary> summaries) {
-
- for (PlayerSummary summary : summaries) {
-
- MapSqlParameterSource args = new MapSqlParameterSource().addValue("id", summary.getId()).addValue("year",
- summary.getYear()).addValue("completes", summary.getCompletes()).addValue("attempts",
- summary.getAttempts()).addValue("passingYards", summary.getPassingYards()).addValue("passingTd",
- summary.getPassingTd()).addValue("interceptions", summary.getInterceptions()).addValue("rushes",
- summary.getRushes()).addValue("rushYards", summary.getRushYards()).addValue("receptions",
- summary.getReceptions()).addValue("receptionYards", summary.getReceptionYards()).addValue(
- "totalTd", summary.getTotalTd());
-
- namedParameterJdbcTemplate.update(INSERT_SUMMARY, args);
- }
- }
-
- public void setDataSource(DataSource dataSource) {
- this.namedParameterJdbcTemplate = new NamedParameterJdbcTemplate(dataSource);
- }
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerFieldSetMapper.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerFieldSetMapper.java
deleted file mode 100644
index 0b517703b4..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerFieldSetMapper.java
+++ /dev/null
@@ -1,44 +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.sample.domain.football.internal;
-
-import org.springframework.batch.core.test.football.Player;
-import org.springframework.batch.item.file.mapping.FieldSetMapper;
-import org.springframework.batch.item.file.transform.FieldSet;
-
-public class PlayerFieldSetMapper implements FieldSetMapper {
-
- @Override
- public Player mapFieldSet(FieldSet fs) {
-
- if(fs == null){
- return null;
- }
-
- Player player = new Player();
- player.setId(fs.readString("ID"));
- player.setLastName(fs.readString("lastName"));
- player.setFirstName(fs.readString("firstName"));
- player.setPosition(fs.readString("position"));
- player.setDebutYear(fs.readInt("debutYear"));
- player.setBirthYear(fs.readInt("birthYear"));
-
- return player;
- }
-
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerItemWriter.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerItemWriter.java
deleted file mode 100644
index 16f53d616b..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerItemWriter.java
+++ /dev/null
@@ -1,40 +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.sample.domain.football.internal;
-
-import java.util.List;
-
-import org.springframework.batch.core.test.football.Player;
-import org.springframework.batch.core.test.football.PlayerDao;
-import org.springframework.batch.item.ItemWriter;
-
-public class PlayerItemWriter implements ItemWriter {
-
- private PlayerDao playerDao;
-
- @Override
- public void write(List extends Player> players) throws Exception {
- for (Player player : players) {
- playerDao.savePlayer(player);
- }
- }
-
- public void setPlayerDao(PlayerDao playerDao) {
- this.playerDao = playerDao;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerSummaryMapper.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerSummaryMapper.java
deleted file mode 100644
index cc7cb9f1e5..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerSummaryMapper.java
+++ /dev/null
@@ -1,56 +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.sample.domain.football.internal;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.springframework.batch.core.test.football.PlayerSummary;
-import org.springframework.jdbc.core.RowMapper;
-
-/**
- * RowMapper used to map a ResultSet to a {@link PlayerSummary}
- *
- * @author Lucas Ward
- *
- */
-public class PlayerSummaryMapper implements RowMapper {
-
- /* (non-Javadoc)
- * @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)
- */
- @Override
- public PlayerSummary mapRow(ResultSet rs, int rowNum) throws SQLException {
-
- PlayerSummary summary = new PlayerSummary();
-
- summary.setId(rs.getString(1));
- summary.setYear(rs.getInt(2));
- summary.setCompletes(rs.getInt(3));
- summary.setAttempts(rs.getInt(4));
- summary.setPassingYards(rs.getInt(5));
- summary.setPassingTd(rs.getInt(6));
- summary.setInterceptions(rs.getInt(7));
- summary.setRushes(rs.getInt(8));
- summary.setRushYards(rs.getInt(9));
- summary.setReceptions(rs.getInt(10));
- summary.setReceptionYards(rs.getInt(11));
- summary.setTotalTd(rs.getInt(12));
-
- return summary;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerSummaryRowMapper.java b/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerSummaryRowMapper.java
deleted file mode 100644
index e793a13963..0000000000
--- a/spring-batch-core-tests/src/main/java/org/springframework/batch/sample/domain/football/internal/PlayerSummaryRowMapper.java
+++ /dev/null
@@ -1,56 +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.sample.domain.football.internal;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-import org.springframework.batch.core.test.football.PlayerSummary;
-import org.springframework.jdbc.core.RowMapper;
-
-/**
- * RowMapper used to map a ResultSet to a {@link PlayerSummary}
- *
- * @author Lucas Ward
- *
- */
-public class PlayerSummaryRowMapper implements RowMapper {
-
- /* (non-Javadoc)
- * @see org.springframework.jdbc.core.RowMapper#mapRow(java.sql.ResultSet, int)
- */
- @Override
- public PlayerSummary mapRow(ResultSet rs, int rowNum) throws SQLException {
-
- PlayerSummary summary = new PlayerSummary();
-
- summary.setId(rs.getString(1));
- summary.setYear(rs.getInt(2));
- summary.setCompletes(rs.getInt(3));
- summary.setAttempts(rs.getInt(4));
- summary.setPassingYards(rs.getInt(5));
- summary.setPassingTd(rs.getInt(6));
- summary.setInterceptions(rs.getInt(7));
- summary.setRushes(rs.getInt(8));
- summary.setRushYards(rs.getInt(9));
- summary.setReceptions(rs.getInt(10));
- summary.setReceptionYards(rs.getInt(11));
- summary.setTotalTd(rs.getInt(12));
-
- return summary;
- }
-
-}
diff --git a/spring-batch-core-tests/src/main/resources/META-INF/batch/footballJob.xml b/spring-batch-core-tests/src/main/resources/META-INF/batch/footballJob.xml
deleted file mode 100644
index 8d45077b45..0000000000
--- a/spring-batch-core-tests/src/main/resources/META-INF/batch/footballJob.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SELECT GAMES.player_id, GAMES.year_no, SUM(COMPLETES),
- SUM(ATTEMPTS), SUM(PASSING_YARDS), SUM(PASSING_TD),
- SUM(INTERCEPTIONS), SUM(RUSHES), SUM(RUSH_YARDS),
- SUM(RECEPTIONS), SUM(RECEPTIONS_YARDS), SUM(TOTAL_TD)
- from GAMES, PLAYERS where PLAYERS.player_id =
- GAMES.player_id group by GAMES.player_id, GAMES.year_no
-
-
-
-
-
-
-
- games.file.name=games-small.csv
- player.file.name=player-small.csv
- job.commit.interval=2
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/main/resources/META-INF/batch/footballSkipJob.xml b/spring-batch-core-tests/src/main/resources/META-INF/batch/footballSkipJob.xml
deleted file mode 100644
index e6e0f7c737..0000000000
--- a/spring-batch-core-tests/src/main/resources/META-INF/batch/footballSkipJob.xml
+++ /dev/null
@@ -1,132 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SELECT GAMES.player_id, GAMES.year_no, SUM(COMPLETES),
- SUM(ATTEMPTS), SUM(PASSING_YARDS), SUM(PASSING_TD),
- SUM(INTERCEPTIONS), SUM(RUSHES), SUM(RUSH_YARDS),
- SUM(RECEPTIONS), SUM(RECEPTIONS_YARDS), SUM(TOTAL_TD)
- from GAMES,
- PLAYERS where PLAYERS.player_id =
- GAMES.player_id group by GAMES.player_id, GAMES.year_no
-
-
-
-
-
-
-
- games.file.name=games-small.csv
- player.file.name=player-small.csv
- job.commit.interval=2
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/main/resources/META-INF/batch/parallelJob.xml b/spring-batch-core-tests/src/main/resources/META-INF/batch/parallelJob.xml
deleted file mode 100644
index 76de2415fe..0000000000
--- a/spring-batch-core-tests/src/main/resources/META-INF/batch/parallelJob.xml
+++ /dev/null
@@ -1,119 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- SELECT GAMES.player_id, GAMES.year_no, SUM(COMPLETES),
- SUM(ATTEMPTS), SUM(PASSING_YARDS), SUM(PASSING_TD),
- SUM(INTERCEPTIONS), SUM(RUSHES), SUM(RUSH_YARDS),
- SUM(RECEPTIONS), SUM(RECEPTIONS_YARDS), SUM(TOTAL_TD)
- from GAMES, PLAYERS where PLAYERS.player_id =
- GAMES.player_id group by GAMES.player_id, GAMES.year_no
-
-
-
-
-
-
-
- games.file.name=games-small.csv
- player.file.name=player-small.csv
- job.commit.interval=2
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/main/resources/business-schema-derby.sql b/spring-batch-core-tests/src/main/resources/business-schema-derby.sql
deleted file mode 100644
index 3ddc496b04..0000000000
--- a/spring-batch-core-tests/src/main/resources/business-schema-derby.sql
+++ /dev/null
@@ -1,96 +0,0 @@
--- Autogenerated: do not edit this file
-DROP TABLE BATCH_STAGING_SEQ ;
-DROP TABLE TRADE_SEQ ;
-DROP TABLE CUSTOMER_SEQ ;
-DROP TABLE BATCH_STAGING ;
-DROP TABLE TRADE ;
-DROP TABLE CUSTOMER ;
-DROP TABLE PLAYERS ;
-DROP TABLE GAMES ;
-DROP TABLE PLAYER_SUMMARY ;
-DROP TABLE ERROR_LOG ;
-
--- Autogenerated: do not edit this file
-
-CREATE TABLE CUSTOMER_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1));
-INSERT INTO CUSTOMER_SEQ (ID) values (5);
-CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1));
-INSERT INTO BATCH_STAGING_SEQ (ID) values (0);
-CREATE TABLE TRADE_SEQ (ID BIGINT PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, DUMMY VARCHAR(1));
-INSERT INTO TRADE_SEQ (ID) values (0);
-
-CREATE TABLE BATCH_STAGING (
- ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
- JOB_ID BIGINT NOT NULL,
- VALUE BLOB NOT NULL,
- PROCESSED CHAR(1) NOT NULL
-) ;
-
-CREATE TABLE TRADE (
- ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
- VERSION BIGINT ,
- ISIN VARCHAR(45) NOT NULL,
- QUANTITY BIGINT ,
- PRICE DECIMAL(8,2) ,
- CUSTOMER VARCHAR(45)
-) ;
-
-CREATE TABLE CUSTOMER (
- ID BIGINT NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
- VERSION BIGINT ,
- NAME VARCHAR(45) ,
- CREDIT DECIMAL(10,2)
-) ;
-
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
-
-CREATE TABLE PLAYERS (
- PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
- LAST_NAME VARCHAR(35) NOT NULL,
- FIRST_NAME VARCHAR(25) NOT NULL,
- POS VARCHAR(10) ,
- YEAR_OF_BIRTH BIGINT NOT NULL,
- YEAR_DRAFTED BIGINT NOT NULL
-) ;
-
-CREATE TABLE GAMES (
- PLAYER_ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- TEAM CHAR(3) NOT NULL,
- WEEK BIGINT NOT NULL,
- OPPONENT CHAR(3) ,
- COMPLETES BIGINT ,
- ATTEMPTS BIGINT ,
- PASSING_YARDS BIGINT ,
- PASSING_TD BIGINT ,
- INTERCEPTIONS BIGINT ,
- RUSHES BIGINT ,
- RUSH_YARDS BIGINT ,
- RECEPTIONS BIGINT ,
- RECEPTIONS_YARDS BIGINT ,
- TOTAL_TD BIGINT
-) ;
-
-CREATE TABLE PLAYER_SUMMARY (
- ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- COMPLETES BIGINT NOT NULL ,
- ATTEMPTS BIGINT NOT NULL ,
- PASSING_YARDS BIGINT NOT NULL ,
- PASSING_TD BIGINT NOT NULL ,
- INTERCEPTIONS BIGINT NOT NULL ,
- RUSHES BIGINT NOT NULL ,
- RUSH_YARDS BIGINT NOT NULL ,
- RECEPTIONS BIGINT NOT NULL ,
- RECEPTIONS_YARDS BIGINT NOT NULL ,
- TOTAL_TD BIGINT NOT NULL
-) ;
-
-CREATE TABLE ERROR_LOG (
- JOB_NAME CHAR(20) ,
- STEP_NAME CHAR(20) ,
- MESSAGE VARCHAR(300) NOT NULL
-) ;
diff --git a/spring-batch-core-tests/src/main/resources/business-schema-hsqldb.sql b/spring-batch-core-tests/src/main/resources/business-schema-hsqldb.sql
deleted file mode 100644
index f3e15e0549..0000000000
--- a/spring-batch-core-tests/src/main/resources/business-schema-hsqldb.sql
+++ /dev/null
@@ -1,53 +0,0 @@
--- Autogenerated: do not edit this file
-DROP TABLE PLAYERS IF EXISTS;
-DROP TABLE GAMES IF EXISTS;
-DROP TABLE PLAYER_SUMMARY IF EXISTS;
-DROP TABLE ERROR_LOG IF EXISTS;
-
-CREATE TABLE PLAYERS (
- PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
- LAST_NAME VARCHAR(35) NOT NULL,
- FIRST_NAME VARCHAR(25) NOT NULL,
- POS VARCHAR(10) ,
- YEAR_OF_BIRTH BIGINT NOT NULL,
- YEAR_DRAFTED BIGINT NOT NULL
-) ;
-
-CREATE TABLE GAMES (
- PLAYER_ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- TEAM CHAR(3) NOT NULL,
- WEEK BIGINT NOT NULL,
- OPPONENT CHAR(3) ,
- COMPLETES BIGINT ,
- ATTEMPTS BIGINT ,
- PASSING_YARDS BIGINT ,
- PASSING_TD BIGINT ,
- INTERCEPTIONS BIGINT ,
- RUSHES BIGINT ,
- RUSH_YARDS BIGINT ,
- RECEPTIONS BIGINT ,
- RECEPTIONS_YARDS BIGINT ,
- TOTAL_TD BIGINT
-) ;
-
-CREATE TABLE PLAYER_SUMMARY (
- ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- COMPLETES BIGINT NOT NULL ,
- ATTEMPTS BIGINT NOT NULL ,
- PASSING_YARDS BIGINT NOT NULL ,
- PASSING_TD BIGINT NOT NULL ,
- INTERCEPTIONS BIGINT NOT NULL ,
- RUSHES BIGINT NOT NULL ,
- RUSH_YARDS BIGINT NOT NULL ,
- RECEPTIONS BIGINT NOT NULL ,
- RECEPTIONS_YARDS BIGINT NOT NULL ,
- TOTAL_TD BIGINT NOT NULL
-) ;
-
-CREATE TABLE ERROR_LOG (
- JOB_NAME CHAR(20) ,
- STEP_NAME CHAR(20) ,
- MESSAGE VARCHAR(300) NOT NULL
-) ;
diff --git a/spring-batch-core-tests/src/main/resources/business-schema-mysql.sql b/spring-batch-core-tests/src/main/resources/business-schema-mysql.sql
deleted file mode 100644
index 99fd85c657..0000000000
--- a/spring-batch-core-tests/src/main/resources/business-schema-mysql.sql
+++ /dev/null
@@ -1,96 +0,0 @@
--- Autogenerated: do not edit this file
-DROP TABLE IF EXISTS BATCH_STAGING_SEQ ;
-DROP TABLE IF EXISTS TRADE_SEQ ;
-DROP TABLE IF EXISTS CUSTOMER_SEQ ;
-DROP TABLE IF EXISTS BATCH_STAGING ;
-DROP TABLE IF EXISTS TRADE ;
-DROP TABLE IF EXISTS CUSTOMER ;
-DROP TABLE IF EXISTS PLAYERS ;
-DROP TABLE IF EXISTS GAMES ;
-DROP TABLE IF EXISTS PLAYER_SUMMARY ;
-DROP TABLE IF EXISTS ERROR_LOG ;
-
--- Autogenerated: do not edit this file
-
-CREATE TABLE CUSTOMER_SEQ (ID BIGINT NOT NULL) type=MYISAM;
-INSERT INTO CUSTOMER_SEQ values(5);
-CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT NOT NULL) type=MYISAM;
-INSERT INTO BATCH_STAGING_SEQ values(0);
-CREATE TABLE TRADE_SEQ (ID BIGINT NOT NULL) type=MYISAM;
-INSERT INTO TRADE_SEQ values(0);
-
-CREATE TABLE BATCH_STAGING (
- ID BIGINT NOT NULL PRIMARY KEY ,
- JOB_ID BIGINT NOT NULL,
- VALUE BLOB NOT NULL,
- PROCESSED CHAR(1) NOT NULL
-) type=InnoDB;
-
-CREATE TABLE TRADE (
- ID BIGINT NOT NULL PRIMARY KEY ,
- VERSION BIGINT ,
- ISIN VARCHAR(45) NOT NULL,
- QUANTITY BIGINT ,
- PRICE DECIMAL(8,2) ,
- CUSTOMER VARCHAR(45)
-) type=InnoDB;
-
-CREATE TABLE CUSTOMER (
- ID BIGINT NOT NULL PRIMARY KEY ,
- VERSION BIGINT ,
- NAME VARCHAR(45) ,
- CREDIT DECIMAL(10,2)
-) type=InnoDB;
-
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
-
-CREATE TABLE PLAYERS (
- PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
- LAST_NAME VARCHAR(35) NOT NULL,
- FIRST_NAME VARCHAR(25) NOT NULL,
- POS VARCHAR(10) ,
- YEAR_OF_BIRTH BIGINT NOT NULL,
- YEAR_DRAFTED BIGINT NOT NULL
-) type=InnoDB;
-
-CREATE TABLE GAMES (
- PLAYER_ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- TEAM CHAR(3) NOT NULL,
- WEEK BIGINT NOT NULL,
- OPPONENT CHAR(3) ,
- COMPLETES BIGINT ,
- ATTEMPTS BIGINT ,
- PASSING_YARDS BIGINT ,
- PASSING_TD BIGINT ,
- INTERCEPTIONS BIGINT ,
- RUSHES BIGINT ,
- RUSH_YARDS BIGINT ,
- RECEPTIONS BIGINT ,
- RECEPTIONS_YARDS BIGINT ,
- TOTAL_TD BIGINT
-) type=InnoDB;
-
-CREATE TABLE PLAYER_SUMMARY (
- ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- COMPLETES BIGINT NOT NULL ,
- ATTEMPTS BIGINT NOT NULL ,
- PASSING_YARDS BIGINT NOT NULL ,
- PASSING_TD BIGINT NOT NULL ,
- INTERCEPTIONS BIGINT NOT NULL ,
- RUSHES BIGINT NOT NULL ,
- RUSH_YARDS BIGINT NOT NULL ,
- RECEPTIONS BIGINT NOT NULL ,
- RECEPTIONS_YARDS BIGINT NOT NULL ,
- TOTAL_TD BIGINT NOT NULL
-) type=InnoDB;
-
-CREATE TABLE ERROR_LOG (
- JOB_NAME CHAR(20) ,
- STEP_NAME CHAR(20) ,
- MESSAGE VARCHAR(300) NOT NULL
-) type=InnoDB;
diff --git a/spring-batch-core-tests/src/main/resources/business-schema-postgresql.sql b/spring-batch-core-tests/src/main/resources/business-schema-postgresql.sql
deleted file mode 100644
index c7a27de5d3..0000000000
--- a/spring-batch-core-tests/src/main/resources/business-schema-postgresql.sql
+++ /dev/null
@@ -1,94 +0,0 @@
--- Autogenerated: do not edit this file
-DROP SEQUENCE BATCH_STAGING_SEQ ;
-DROP SEQUENCE TRADE_SEQ ;
-DROP SEQUENCE CUSTOMER_SEQ ;
-DROP TABLE BATCH_STAGING ;
-DROP TABLE TRADE ;
-DROP TABLE CUSTOMER ;
-DROP TABLE PLAYERS ;
-DROP TABLE GAMES ;
-DROP TABLE PLAYER_SUMMARY ;
-DROP TABLE ERROR_LOG ;
-
--- Autogenerated: do not edit this file
-
-CREATE SEQUENCE CUSTOMER_SEQ;
-CREATE SEQUENCE BATCH_STAGING_SEQ;
-CREATE SEQUENCE TRADE_SEQ;
-
-CREATE TABLE BATCH_STAGING (
- ID BIGINT NOT NULL PRIMARY KEY ,
- JOB_ID BIGINT NOT NULL,
- VALUE BYTEA NOT NULL,
- PROCESSED CHAR(1) NOT NULL
-) ;
-
-CREATE TABLE TRADE (
- ID BIGINT NOT NULL PRIMARY KEY ,
- VERSION BIGINT ,
- ISIN VARCHAR(45) NOT NULL,
- QUANTITY BIGINT ,
- PRICE DECIMAL(8,2) ,
- CUSTOMER VARCHAR(45)
-) ;
-
-CREATE TABLE CUSTOMER (
- ID BIGINT NOT NULL PRIMARY KEY ,
- VERSION BIGINT ,
- NAME VARCHAR(45) ,
- CREDIT DECIMAL(10,2)
-) ;
-
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
-INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
-
-CREATE TABLE PLAYERS (
- PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
- LAST_NAME VARCHAR(35) NOT NULL,
- FIRST_NAME VARCHAR(25) NOT NULL,
- POS VARCHAR(10) ,
- YEAR_OF_BIRTH BIGINT NOT NULL,
- YEAR_DRAFTED BIGINT NOT NULL
-) ;
-
-CREATE TABLE GAMES (
- PLAYER_ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- TEAM CHAR(3) NOT NULL,
- WEEK BIGINT NOT NULL,
- OPPONENT CHAR(3) ,
- COMPLETES BIGINT ,
- ATTEMPTS BIGINT ,
- PASSING_YARDS BIGINT ,
- PASSING_TD BIGINT ,
- INTERCEPTIONS BIGINT ,
- RUSHES BIGINT ,
- RUSH_YARDS BIGINT ,
- RECEPTIONS BIGINT ,
- RECEPTIONS_YARDS BIGINT ,
- TOTAL_TD BIGINT
-) ;
-
-CREATE TABLE PLAYER_SUMMARY (
- ID CHAR(8) NOT NULL,
- YEAR_NO BIGINT NOT NULL,
- COMPLETES BIGINT NOT NULL ,
- ATTEMPTS BIGINT NOT NULL ,
- PASSING_YARDS BIGINT NOT NULL ,
- PASSING_TD BIGINT NOT NULL ,
- INTERCEPTIONS BIGINT NOT NULL ,
- RUSHES BIGINT NOT NULL ,
- RUSH_YARDS BIGINT NOT NULL ,
- RECEPTIONS BIGINT NOT NULL ,
- RECEPTIONS_YARDS BIGINT NOT NULL ,
- TOTAL_TD BIGINT NOT NULL
-) ;
-
-CREATE TABLE ERROR_LOG (
- JOB_NAME CHAR(20) ,
- STEP_NAME CHAR(20) ,
- MESSAGE VARCHAR(300) NOT NULL
-);
-
diff --git a/spring-batch-core-tests/src/main/resources/log4j.properties b/spring-batch-core-tests/src/main/resources/log4j.properties
deleted file mode 100644
index f8c8855ebc..0000000000
--- a/spring-batch-core-tests/src/main/resources/log4j.properties
+++ /dev/null
@@ -1,12 +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{ABSOLUTE} %5p %t %c{1}:%L - %m%n
-
-log4j.category.org.apache.activemq=ERROR
-# log4j.category.org.springframework=DEBUG
-log4j.category.org.springframework.jdbc=DEBUG
-log4j.category.org.springframework.jms=DEBUG
-log4j.category.org.springframework.batch=DEBUG
-log4j.category.org.springframework.retry=DEBUG
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/IgnoredTestSuite.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/IgnoredTestSuite.java
deleted file mode 100644
index 513b54d9f5..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/IgnoredTestSuite.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2009-2010 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.test;
-
-import org.junit.Ignore;
-import org.junit.runner.RunWith;
-import org.junit.runners.Suite;
-import org.junit.runners.Suite.SuiteClasses;
-import org.springframework.batch.core.test.step.FaultTolerantStepFactoryBeanIntegrationTests;
-import org.springframework.batch.core.test.step.FaultTolerantStepFactoryBeanRollbackIntegrationTests;
-
-/**
- * A test suite that is ignored, but can be resurrected to help debug ordering
- * issues in tests.
- *
- * @author Dave Syer
- *
- */
-@RunWith(Suite.class)
-@SuiteClasses(value = { FaultTolerantStepFactoryBeanIntegrationTests.class, FaultTolerantStepFactoryBeanRollbackIntegrationTests.class })
-@Ignore
-public class IgnoredTestSuite {
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java
deleted file mode 100644
index bf21824b83..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/concurrent/ConcurrentTransactionTests.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- * Copyright 2015 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.test.concurrent;
-
-import static org.junit.Assert.assertEquals;
-
-import java.sql.Connection;
-import java.sql.Driver;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import javax.sql.DataSource;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.StepContribution;
-import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
-import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
-import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
-import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
-import org.springframework.batch.core.job.builder.FlowBuilder;
-import org.springframework.batch.core.job.flow.Flow;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.batch.core.repository.JobRepository;
-import org.springframework.batch.core.repository.support.JobRepositoryFactoryBean;
-import org.springframework.batch.core.scope.context.ChunkContext;
-import org.springframework.batch.core.step.tasklet.Tasklet;
-import org.springframework.batch.repeat.RepeatStatus;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.io.DefaultResourceLoader;
-import org.springframework.core.io.ResourceLoader;
-import org.springframework.core.task.SimpleAsyncTaskExecutor;
-import org.springframework.core.task.TaskExecutor;
-import org.springframework.jdbc.datasource.embedded.ConnectionProperties;
-import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseConfigurer;
-import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory;
-import org.springframework.jdbc.datasource.init.ResourceDatabasePopulator;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.util.ClassUtils;
-
-/**
- * @author Michael Minella
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = ConcurrentTransactionTests.ConcurrentJobConfiguration.class)
-public class ConcurrentTransactionTests {
-
- @Autowired
- private Job concurrentJob;
-
- @Autowired
- private JobLauncher jobLauncher;
-
- @DirtiesContext
- @Test
- public void testConcurrentLongRunningJobExecutions() throws Exception {
-
- JobExecution jobExecution = jobLauncher.run(concurrentJob, new JobParameters());
-
- assertEquals(jobExecution.getStatus(), BatchStatus.COMPLETED);
- }
-
- @Configuration
- @EnableBatchProcessing
- public static class ConcurrentJobConfiguration extends DefaultBatchConfigurer {
-
- @Autowired
- private JobBuilderFactory jobBuilderFactory;
-
- @Autowired
- private StepBuilderFactory stepBuilderFactory;
-
- @Bean
- public TaskExecutor taskExecutor() {
- return new SimpleAsyncTaskExecutor();
- }
-
- /**
- * This datasource configuration configures the HSQLDB instance using MVCC. When
- * configurd using the default behavior, transaction serialization errors are
- * thrown (default configuration example below).
- *
- * return new PooledEmbeddedDataSource(new EmbeddedDatabaseBuilder().
- * addScript("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql").
- * addScript("classpath:org/springframework/batch/core/schema-hsqldb.sql").
- * build());
-
- * @return
- */
- @Bean
- DataSource dataSource() {
- ResourceLoader defaultResourceLoader = new DefaultResourceLoader();
- EmbeddedDatabaseFactory embeddedDatabaseFactory = new EmbeddedDatabaseFactory();
- embeddedDatabaseFactory.setDatabaseConfigurer(new EmbeddedDatabaseConfigurer() {
-
- @Override
- public void configureConnectionProperties(ConnectionProperties properties, String databaseName) {
- try {
- properties.setDriverClass((Class extends Driver>) ClassUtils.forName("org.hsqldb.jdbcDriver", this.getClass().getClassLoader()));
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- properties.setUrl("jdbc:hsqldb:mem:" + databaseName + ";hsqldb.tx=mvcc");
- properties.setUsername("sa");
- properties.setPassword("");
- }
-
- @Override
- public void shutdown(DataSource dataSource, String databaseName) {
- try {
- Connection connection = dataSource.getConnection();
- Statement stmt = connection.createStatement();
- stmt.execute("SHUTDOWN");
- }
- catch (SQLException ex) {
- }
- }
- });
-
- ResourceDatabasePopulator databasePopulator = new ResourceDatabasePopulator();
- databasePopulator.addScript(defaultResourceLoader.getResource("classpath:org/springframework/batch/core/schema-drop-hsqldb.sql"));
- databasePopulator.addScript(defaultResourceLoader.getResource("classpath:org/springframework/batch/core/schema-hsqldb.sql"));
- embeddedDatabaseFactory.setDatabasePopulator(databasePopulator);
-
- return embeddedDatabaseFactory.getDatabase();
- }
-
- @Bean
- public Flow flow() {
- return new FlowBuilder("flow")
- .start(stepBuilderFactory.get("flow.step1")
- .tasklet(new Tasklet() {
- @Override
- public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
- return RepeatStatus.FINISHED;
- }
- }).build()
- ).next(stepBuilderFactory.get("flow.step2")
- .tasklet(new Tasklet() {
- @Override
- public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
- return RepeatStatus.FINISHED;
- }
- }).build()
- ).build();
- }
-
- @Bean
- public Step firstStep() {
- return stepBuilderFactory.get("firstStep")
- .tasklet(new Tasklet() {
- @Override
- public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
- System.out.println(">> Beginning concurrent job test");
- return RepeatStatus.FINISHED;
- }
- }).build();
- }
-
- @Bean
- public Step lastStep() {
- return stepBuilderFactory.get("lastStep")
- .tasklet(new Tasklet() {
- @Override
- public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
- System.out.println(">> Ending concurrent job test");
- return RepeatStatus.FINISHED;
- }
- }).build();
- }
-
- @Bean
- public Job concurrentJob() {
- Flow splitFlow = new FlowBuilder("splitflow").split(new SimpleAsyncTaskExecutor()).add(flow(), flow(), flow(), flow(), flow(), flow(), flow()).build();
-
- return jobBuilderFactory.get("concurrentJob")
- .start(firstStep())
- .next(stepBuilderFactory.get("splitFlowStep")
- .flow(splitFlow)
- .build())
- .next(lastStep())
- .build();
- }
-
- @Override
- protected JobRepository createJobRepository() throws Exception {
- JobRepositoryFactoryBean factory = new JobRepositoryFactoryBean();
- factory.setDataSource(dataSource());
- factory.setIsolationLevelForCreate("ISOLATION_READ_COMMITTED");
- factory.setTransactionManager(getTransactionManager());
- factory.afterPropertiesSet();
- return factory.getObject();
- }
- }
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/FootballJobIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/FootballJobIntegrationTests.java
deleted file mode 100644
index 240fa23424..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/FootballJobIntegrationTests.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright 2006-2009 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.test.football;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParametersBuilder;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-
-/**
- * @author Dave Syer
- *
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/META-INF/batch/footballJob.xml" })
-public class FootballJobIntegrationTests {
-
- /** Logger */
- private final Log logger = LogFactory.getLog(getClass());
-
- private JdbcTemplate jdbcTemplate;
-
- @Autowired
- private JobLauncher jobLauncher;
-
- @Autowired
- private Job job;
-
- @Autowired
- public void setDataSource(DataSource dataSource) {
- this.jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- @Before
- public void clear() {
- JdbcTestUtils.deleteFromTables(jdbcTemplate, "PLAYER_SUMMARY", "GAMES", "PLAYERS");
- }
-
- @Test
- public void testLaunchJob() throws Exception {
- JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().addLong("commit.interval", 10L)
- .toJobParameters());
- assertEquals(BatchStatus.COMPLETED, execution.getStatus());
- for (StepExecution stepExecution : execution.getStepExecutions()) {
- logger.info("Processed: " + stepExecution);
- if (stepExecution.getStepName().equals("playerload")) {
- // The effect of the retries
- assertEquals(new Double(Math.ceil(stepExecution.getReadCount() / 10. + 1)).intValue(),
- stepExecution.getCommitCount());
- }
- }
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/FootballJobSkipIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/FootballJobSkipIntegrationTests.java
deleted file mode 100644
index feceecc206..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/FootballJobSkipIntegrationTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2006-2009 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.test.football;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParametersBuilder;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.batch.support.DatabaseType;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-
-/**
- * @author Dave Syer
- *
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/META-INF/batch/footballSkipJob.xml" })
-public class FootballJobSkipIntegrationTests {
-
- /** Logger */
- private final Log logger = LogFactory.getLog(getClass());
-
- private JdbcTemplate jdbcTemplate;
-
- @Autowired
- private JobLauncher jobLauncher;
-
- @Autowired
- private Job job;
-
- private DatabaseType databaseType;
-
- @Autowired
- public void setDataSource(DataSource dataSource) throws Exception {
- this.jdbcTemplate = new JdbcTemplate(dataSource);
- databaseType = DatabaseType.fromMetaData(dataSource);
- }
-
- @Before
- public void clear() {
- JdbcTestUtils.deleteFromTables(jdbcTemplate, "PLAYER_SUMMARY", "GAMES", "PLAYERS");
- }
-
- @Test
- public void testLaunchJob() throws Exception {
- try {
- if (databaseType == DatabaseType.POSTGRES || databaseType == DatabaseType.ORACLE) {
- // Extra special test for these platforms (would have failed
- // the job with UNKNOWN status in Batch 2.0):
- jdbcTemplate.update("SET CONSTRAINTS ALL DEFERRED");
- }
- }
- catch (Exception e) {
- // Ignore (wrong platform)
- }
- JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().addLong("skip.limit", 0L)
- .toJobParameters());
- assertEquals(BatchStatus.COMPLETED, execution.getStatus());
- for (StepExecution stepExecution : execution.getStepExecutions()) {
- logger.info("Processed: " + stepExecution);
- }
- // They all skip on the second execution because of a primary key
- // violation
- long retryLimit = 2L;
- execution = jobLauncher.run(job,
- new JobParametersBuilder().addLong("skip.limit", 100000L).addLong("retry.limit", retryLimit)
- .toJobParameters());
- assertEquals(BatchStatus.COMPLETED, execution.getStatus());
- for (StepExecution stepExecution : execution.getStepExecutions()) {
- logger.info("Processed: " + stepExecution);
- if (stepExecution.getStepName().equals("playerload")) {
- // The effect of the retries is to increase the number of
- // rollbacks
- int commitInterval = stepExecution.getReadCount() / (stepExecution.getCommitCount() - 1);
- // Account for the extra empty commit if the read count is
- // commensurate with the commit interval
- int effectiveCommitCount = stepExecution.getReadCount() % commitInterval == 0 ? stepExecution
- .getCommitCount() - 1 : stepExecution.getCommitCount();
- long expectedRollbacks = Math.max(1, retryLimit) * effectiveCommitCount + stepExecution.getReadCount();
- assertEquals(expectedRollbacks, stepExecution.getRollbackCount());
- assertEquals(stepExecution.getReadCount(), stepExecution.getWriteSkipCount());
- }
- }
-
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/ParallelJobIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/ParallelJobIntegrationTests.java
deleted file mode 100644
index 61c590d4f4..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/football/ParallelJobIntegrationTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2006-2009 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.test.football;
-
-import static org.junit.Assert.assertEquals;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParametersBuilder;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-
-
-/**
- * @author Dave Syer
- *
- */
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/META-INF/batch/parallelJob.xml" })
-public class ParallelJobIntegrationTests {
-
- /** Logger */
- private final Log logger = LogFactory.getLog(getClass());
-
- @Autowired
- private JobLauncher jobLauncher;
-
- private JdbcTemplate jdbcTemplate;
-
- @Autowired
- private Job job;
-
- @Autowired
- public void setDataSource(DataSource dataSource) {
- this.jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- @Before
- public void clear() {
- JdbcTestUtils.deleteFromTables(jdbcTemplate, "PLAYER_SUMMARY", "GAMES", "PLAYERS");
- }
-
- @Test
- public void testLaunchJob() throws Exception {
- JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().toJobParameters());
- assertEquals(BatchStatus.COMPLETED, execution.getStatus());
- for (StepExecution stepExecution : execution.getStepExecutions()) {
- logger.info("Processed: "+stepExecution);
- }
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/LdifReaderTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/LdifReaderTests.java
deleted file mode 100644
index f1899b0ea9..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/LdifReaderTests.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright 2005-2014 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.test.ldif;
-
-import static org.junit.Assert.assertEquals;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.net.MalformedURLException;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.core.ExitStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.UrlResource;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.util.Assert;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/applicationContext-test1.xml"})
-public class LdifReaderTests {
-
- private Resource expected;
- private Resource actual;
-
- @Autowired
- private JobLauncher jobLauncher;
-
- @Autowired
- @Qualifier("job1")
- private Job job1;
-
- @Autowired
- @Qualifier("job2")
- private Job job2;
-
- public LdifReaderTests() throws MalformedURLException {
- expected = new ClassPathResource("/expectedOutput.ldif");
- actual = new UrlResource("file:target/test-outputs/output.ldif");
- }
-
- @Before
- public void checkFiles() {
- Assert.isTrue(expected.exists(), "Expected does not exist.");
- }
-
- @Test
- public void testValidRun() throws Exception {
- JobExecution jobExecution = jobLauncher.run(job1, new JobParameters());
-
- //Ensure job completed successfully.
- Assert.isTrue(jobExecution.getExitStatus().equals(ExitStatus.COMPLETED), "Step Execution did not complete normally: " + jobExecution.getExitStatus());
-
- //Check output.
- Assert.isTrue(actual.exists(), "Actual does not exist.");
- compareFiles(expected.getFile(), actual.getFile());
- }
-
- @Test
- public void testResourceNotExists() throws Exception {
- JobExecution jobExecution = jobLauncher.run(job2, new JobParameters());
-
- Assert.isTrue(jobExecution.getExitStatus().getExitCode().equals("FAILED"), "The job exit status is not FAILED.");
- Assert.isTrue(jobExecution.getAllFailureExceptions().get(0).getMessage().contains("Failed to initialize the reader"), "The job failed for the wrong reason.");
- }
-
- private void compareFiles(File expected, File actual) throws Exception {
- BufferedReader expectedReader = new BufferedReader(new FileReader(expected));
- BufferedReader actualReader = new BufferedReader(new FileReader(actual));
- try {
- int lineNum = 1;
- for (String expectedLine = null; (expectedLine = expectedReader.readLine()) != null; lineNum++) {
- String actualLine = actualReader.readLine();
- assertEquals("Line number " + lineNum + " does not match.", expectedLine, actualLine);
- }
-
- String actualLine = actualReader.readLine();
- assertEquals("More lines than expected. There should not be a line number " + lineNum + ".", null, actualLine);
- }
- finally {
- expectedReader.close();
- actualReader.close();
- }
- }
-}
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/MappingLdifReaderTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/MappingLdifReaderTests.java
deleted file mode 100644
index 4308859a65..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/MappingLdifReaderTests.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Copyright 2005-2014 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.test.ldif;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.batch.core.ExitStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.UrlResource;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.util.Assert;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStreamReader;
-import java.net.MalformedURLException;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/applicationContext-test2.xml"})
-public class MappingLdifReaderTests {
- private static Logger log = LoggerFactory.getLogger(MappingLdifReaderTests.class);
-
- private Resource expected;
- private Resource actual;
-
- @Autowired
- private JobLauncher launcher;
-
- @Autowired
- @Qualifier("job1")
- private Job job1;
-
- @Autowired
- @Qualifier("job2")
- private Job job2;
-
- public MappingLdifReaderTests() throws MalformedURLException {
- expected = new ClassPathResource("/expectedOutput.ldif");
- actual = new UrlResource("file:target/test-outputs/output.ldif");
- }
-
- @Before
- public void checkFiles() {
- Assert.isTrue(expected.exists(), "Expected does not exist.");
- }
-
- @Test
- public void testValidRun() throws Exception {
- JobExecution jobExecution = launcher.run(job1, new JobParameters());
-
- //Ensure job completed successfully.
- Assert.isTrue(jobExecution.getExitStatus().equals(ExitStatus.COMPLETED), "Step Execution did not complete normally: " + jobExecution.getExitStatus());
-
- //Check output.
- Assert.isTrue(actual.exists(), "Actual does not exist.");
- Assert.isTrue(compareFiles(expected.getFile(), actual.getFile()));
- }
-
- @Test
- public void testResourceNotExists() throws Exception {
- JobExecution jobExecution = launcher.run(job2, new JobParameters());
-
- Assert.isTrue(jobExecution.getExitStatus().getExitCode().equals("FAILED"), "The job exit status is not FAILED.");
- Assert.isTrue(jobExecution.getAllFailureExceptions().get(0).getMessage().contains("Failed to initialize the reader"), "The job failed for the wrong reason.");
- }
-
-
- private boolean compareFiles(File expected, File actual) throws Exception {
- boolean equal = true;
-
- FileInputStream expectedStream = new FileInputStream(expected);
- FileInputStream actualStream = new FileInputStream(actual);
-
- //Construct BufferedReader from InputStreamReader
- BufferedReader expectedReader = new BufferedReader(new InputStreamReader(expectedStream));
- BufferedReader actualReader = new BufferedReader(new InputStreamReader(actualStream));
-
- String line = null;
- while ((line = expectedReader.readLine()) != null) {
- if(!line.equals(actualReader.readLine())) {
- equal = false;
- break;
- }
- }
-
- if(actualReader.readLine() != null) {
- equal = false;
- }
-
- expectedReader.close();
-
- return equal;
- }
-}
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/MyMapper.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/MyMapper.java
deleted file mode 100644
index 0accc14e1b..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/ldif/MyMapper.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2005-2014 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.test.ldif;
-
-import org.springframework.batch.item.ldif.RecordMapper;
-import org.springframework.ldap.core.LdapAttributes;
-
-/**
- * This default implementation simply returns the LdapAttributes object and is only intended for test. As its not required
- * to return an object of a specific type to make the MappingLdifReader implementation work, this basic setting is sufficient
- * to demonstrate its function.
- *
- * @author Keith Barlow
- *
- */
-public class MyMapper implements RecordMapper {
-
- public LdapAttributes mapRecord(LdapAttributes attributes) {
- return attributes;
- }
-
-}
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/ConcurrentMapExecutionContextDaoTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/ConcurrentMapExecutionContextDaoTests.java
deleted file mode 100644
index c8812091fb..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/ConcurrentMapExecutionContextDaoTests.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Copyright 2006-2009 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.test.repository;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionService;
-import java.util.concurrent.ExecutorCompletionService;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import org.junit.Test;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.repository.dao.MapExecutionContextDao;
-import org.springframework.batch.item.ExecutionContext;
-import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.support.TransactionTemplate;
-import org.springframework.util.Assert;
-
-/**
- * @author Dave Syer
- *
- */
-public class ConcurrentMapExecutionContextDaoTests {
-
- private MapExecutionContextDao dao = new MapExecutionContextDao();
-
- private PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
-
- @Test
- public void testSaveUpdate() throws Exception {
- StepExecution stepExecution = new StepExecution("step", new JobExecution(11L));
- stepExecution.setId(123L);
- stepExecution.getExecutionContext().put("foo", "bar");
- dao.saveExecutionContext(stepExecution);
- ExecutionContext executionContext = dao.getExecutionContext(stepExecution);
- assertEquals("bar", executionContext.get("foo"));
- }
-
- @Test
- public void testTransactionalSaveUpdate() throws Exception {
- final StepExecution stepExecution = new StepExecution("step", new JobExecution(11L));
- stepExecution.setId(123L);
- new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
- @Override
- public Void doInTransaction(TransactionStatus status) {
- stepExecution.getExecutionContext().put("foo", "bar");
- dao.saveExecutionContext(stepExecution);
- return null;
- }
- });
- ExecutionContext executionContext = dao.getExecutionContext(stepExecution);
- assertEquals("bar", executionContext.get("foo"));
-
- }
-
- @Test
- public void testConcurrentTransactionalSaveUpdate() throws Exception {
-
- ExecutorService executor = Executors.newFixedThreadPool(3);
- CompletionService completionService = new ExecutorCompletionService(executor);
-
- final int outerMax = 10;
- final int innerMax = 100;
-
- for (int i = 0; i < outerMax; i++) {
-
- final StepExecution stepExecution1 = new StepExecution("step", new JobExecution(11L));
- stepExecution1.setId(123L + i);
- final StepExecution stepExecution2 = new StepExecution("step", new JobExecution(11L));
- stepExecution2.setId(1234L + i);
-
- completionService.submit(new Callable() {
- @Override
- public StepExecution call() throws Exception {
- for (int i = 0; i < innerMax; i++) {
- String value = "bar" + i;
- saveAndAssert(stepExecution1, value);
- }
- return stepExecution1;
- }
- });
-
- completionService.submit(new Callable() {
- @Override
- public StepExecution call() throws Exception {
- for (int i = 0; i < innerMax; i++) {
- String value = "spam" + i;
- saveAndAssert(stepExecution2, value);
- }
- return stepExecution2;
- }
- });
-
- completionService.take().get();
- completionService.take().get();
-
- }
-
- executor.shutdown();
-
- }
-
- private void saveAndAssert(final StepExecution stepExecution, final String value) {
-
- new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
- @Override
- public Void doInTransaction(TransactionStatus status) {
- stepExecution.getExecutionContext().put("foo", value);
- dao.saveExecutionContext(stepExecution);
- return null;
- }
- });
-
- ExecutionContext executionContext = dao.getExecutionContext(stepExecution);
- Assert.state(executionContext != null, "Lost insert: null executionContext at value=" + value);
- String foo = executionContext.getString("foo");
- Assert.state(value.equals(foo), "Lost update: wrong value=" + value + " (found " + foo + ") for id="
- + stepExecution.getId());
-
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/JdbcJobRepositoryTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/JdbcJobRepositoryTests.java
deleted file mode 100644
index 8085c4ed7b..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/JdbcJobRepositoryTests.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Copyright 2006-2013 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.test.repository;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.Serializable;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.sql.DataSource;
-
-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.BatchStatus;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException;
-import org.springframework.batch.core.repository.JobRepository;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml" })
-public class JdbcJobRepositoryTests {
-
- private JobSupport job;
-
- private Set jobExecutionIds = new HashSet();
-
- private Set jobIds = new HashSet();
-
- private List list = new ArrayList();
-
- private JdbcTemplate jdbcTemplate;
-
- @Autowired
- private JobRepository repository;
-
- /** Logger */
- private final Log logger = LogFactory.getLog(getClass());
-
- @Autowired
- public void setDataSource(DataSource dataSource) {
- this.jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- @Before
- public void onSetUpInTransaction() throws Exception {
- job = new JobSupport("test-job");
- job.setRestartable(true);
- jdbcTemplate.update("DELETE FROM BATCH_STEP_EXECUTION_CONTEXT");
- jdbcTemplate.update("DELETE FROM BATCH_JOB_EXECUTION_CONTEXT");
- jdbcTemplate.update("DELETE FROM BATCH_STEP_EXECUTION");
- jdbcTemplate.update("DELETE FROM BATCH_JOB_EXECUTION_PARAMS");
- jdbcTemplate.update("DELETE FROM BATCH_JOB_EXECUTION");
- jdbcTemplate.update("DELETE FROM BATCH_JOB_INSTANCE");
- }
-
- @After
- public void onTearDownAfterTransaction() throws Exception {
- for (Long id : jobExecutionIds) {
- jdbcTemplate.update("DELETE FROM BATCH_JOB_EXECUTION_CONTEXT where JOB_EXECUTION_ID=?", id);
- jdbcTemplate.update("DELETE FROM BATCH_JOB_EXECUTION where JOB_EXECUTION_ID=?", id);
- }
- for (Long id : jobIds) {
- jdbcTemplate.update("DELETE FROM BATCH_JOB_INSTANCE where JOB_INSTANCE_ID=?", id);
- }
- for (Long id : jobIds) {
- int count = jdbcTemplate.queryForObject(
- "SELECT COUNT(*) FROM BATCH_JOB_INSTANCE where JOB_INSTANCE_ID=?", Integer.class, id);
- assertEquals(0, count);
- }
- }
-
- @Test
- public void testFindOrCreateJob() throws Exception {
- job.setName("foo");
- int before = 0;
- JobExecution execution = repository.createJobExecution(job.getName(), new JobParameters());
- int after = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM BATCH_JOB_INSTANCE", Integer.class);
- assertEquals(before + 1, after);
- assertNotNull(execution.getId());
- }
-
- @Test
- public void testFindOrCreateJobWithExecutionContext() throws Exception {
- job.setName("foo");
- int before = 0;
- JobExecution execution = repository.createJobExecution(job.getName(), new JobParameters());
- execution.getExecutionContext().put("foo", "bar");
- repository.updateExecutionContext(execution);
- int after = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM BATCH_JOB_EXECUTION_CONTEXT", Integer.class);
- assertEquals(before + 1, after);
- assertNotNull(execution.getId());
- JobExecution last = repository.getLastJobExecution(job.getName(), new JobParameters());
- assertEquals(execution, last);
- assertEquals(execution.getExecutionContext(), last.getExecutionContext());
- }
-
- @Test
- public void testFindOrCreateJobConcurrently() throws Exception {
-
- job.setName("bar");
-
- int before = 0;
- assertEquals(0, before);
-
- long t0 = System.currentTimeMillis();
- try {
- doConcurrentStart();
- fail("Expected JobExecutionAlreadyRunningException");
- }
- catch (JobExecutionAlreadyRunningException e) {
- // expected
- }
- long t1 = System.currentTimeMillis();
-
- JobExecution execution = (JobExecution) list.get(0);
-
- assertNotNull(execution);
-
- int after = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM BATCH_JOB_INSTANCE", Integer.class);
- assertNotNull(execution.getId());
- assertEquals(before + 1, after);
-
- logger.info("Duration: " + (t1 - t0)
- + " - the second transaction did not block if this number is less than about 1000.");
- }
-
- @Test
- public void testFindOrCreateJobConcurrentlyWhenJobAlreadyExists() throws Exception {
-
- job = new JobSupport("test-job");
- job.setRestartable(true);
- job.setName("spam");
-
- JobExecution execution = repository.createJobExecution(job.getName(), new JobParameters());
- cacheJobIds(execution);
- execution.setEndTime(new Timestamp(System.currentTimeMillis()));
- repository.update(execution);
- execution.setStatus(BatchStatus.FAILED);
-
- int before = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM BATCH_JOB_INSTANCE", Integer.class);
- assertEquals(1, before);
-
- long t0 = System.currentTimeMillis();
- try {
- doConcurrentStart();
- fail("Expected JobExecutionAlreadyRunningException");
- }
- catch (JobExecutionAlreadyRunningException e) {
- // expected
- }
- long t1 = System.currentTimeMillis();
-
- int after = jdbcTemplate.queryForObject("SELECT COUNT(*) FROM BATCH_JOB_INSTANCE", Integer.class);
- assertNotNull(execution.getId());
- assertEquals(before, after);
-
- logger.info("Duration: " + (t1 - t0)
- + " - the second transaction did not block if this number is less than about 1000.");
- }
-
- private void cacheJobIds(JobExecution execution) {
- if (execution == null) {
- return;
- }
- jobExecutionIds.add(execution.getId());
- jobIds.add(execution.getJobId());
- }
-
- private JobExecution doConcurrentStart() throws Exception {
- new Thread(new Runnable() {
- @Override
- public void run() {
-
- try {
- JobExecution execution = repository.createJobExecution(job.getName(), new JobParameters());
- cacheJobIds(execution);
- list.add(execution);
- Thread.sleep(1000);
- }
- catch (Exception e) {
- list.add(e);
- }
-
- }
- }).start();
-
- Thread.sleep(400);
- JobExecution execution = repository.createJobExecution(job.getName(), new JobParameters());
- cacheJobIds(execution);
-
- int count = 0;
- while (list.size() == 0 && count++ < 100) {
- Thread.sleep(200);
- }
-
- assertEquals("Timed out waiting for JobExecution to be created", 1, list.size());
- assertTrue("JobExecution not created in thread: " + list.get(0), list.get(0) instanceof JobExecution);
- return (JobExecution) list.get(0);
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/JobSupport.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/JobSupport.java
deleted file mode 100644
index ff9ea9d93a..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/repository/JobSupport.java
+++ /dev/null
@@ -1,174 +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.test.repository;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParametersIncrementer;
-import org.springframework.batch.core.JobParametersValidator;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.UnexpectedJobExecutionException;
-import org.springframework.batch.core.job.DefaultJobParametersValidator;
-import org.springframework.beans.factory.BeanNameAware;
-import org.springframework.util.ClassUtils;
-
-/**
- * Batch domain object representing a job. Job is an explicit abstraction
- * representing the configuration of a job specified by a developer. It should
- * be noted that restart policy is applied to the job as a whole and not to a
- * step.
- *
- * @author Lucas Ward
- * @author Dave Syer
- */
-public class JobSupport implements BeanNameAware, Job {
-
- private List steps = new ArrayList();
-
- private String name;
-
- private boolean restartable = false;
-
- private int startLimit = Integer.MAX_VALUE;
-
- private JobParametersValidator jobParametersValidator = new DefaultJobParametersValidator();
-
- /**
- * Default constructor.
- */
- public JobSupport() {
- super();
- }
-
- /**
- * Convenience constructor to immediately add name (which is mandatory but
- * not final).
- *
- * @param name the name
- */
- public JobSupport(String name) {
- super();
- this.name = name;
- }
-
- /**
- * Set the name property if it is not already set. Because of the order of
- * the callbacks in a Spring container the name property will be set first
- * if it is present. Care is needed with bean definition inheritance - if a
- * parent bean has a name, then its children need an explicit name as well,
- * otherwise they will not be unique.
- *
- * @see org.springframework.beans.factory.BeanNameAware#setBeanName(java.lang.String)
- */
- @Override
- public void setBeanName(String name) {
- if (this.name == null) {
- this.name = name;
- }
- }
-
- /**
- * Set the name property. Always overrides the default value if this object
- * is a Spring bean.
- *
- * @see #setBeanName(java.lang.String)
- * @param name the name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /* (non-Javadoc)
- * @see org.springframework.batch.core.domain.IJob#getName()
- */
- @Override
- public String getName() {
- return name;
- }
-
- /**
- * @param jobParametersValidator the jobParametersValidator to set
- */
- public void setJobParametersValidator(JobParametersValidator jobParametersValidator) {
- this.jobParametersValidator = jobParametersValidator;
- }
-
- public void setSteps(List steps) {
- this.steps.clear();
- this.steps.addAll(steps);
- }
-
- public void addStep(Step step) {
- this.steps.add(step);
- }
-
- public List getSteps() {
- return steps;
- }
-
- /* (non-Javadoc)
- * @see org.springframework.batch.core.domain.IJob#getStartLimit()
- */
- public int getStartLimit() {
- return startLimit;
- }
-
- public void setStartLimit(int startLimit) {
- this.startLimit = startLimit;
- }
-
- public void setRestartable(boolean restartable) {
- this.restartable = restartable;
- }
-
- /* (non-Javadoc)
- * @see org.springframework.batch.core.domain.IJob#isRestartable()
- */
- @Override
- public boolean isRestartable() {
- return restartable;
- }
-
- /* (non-Javadoc)
- * @see org.springframework.batch.core.Job#getJobParametersIncrementer()
- */
- @Override
- public JobParametersIncrementer getJobParametersIncrementer() {
- return null;
- }
-
- @Override
- public JobParametersValidator getJobParametersValidator() {
- return jobParametersValidator;
- }
-
- /* (non-Javadoc)
- * @see org.springframework.batch.core.domain.Job#run(org.springframework.batch.core.domain.JobExecution)
- */
- @Override
- public void execute(JobExecution execution) throws UnexpectedJobExecutionException {
- throw new UnsupportedOperationException("JobSupport does not provide an implementation of run(). Use a smarter subclass.");
- }
-
- @Override
- public String toString() {
- return ClassUtils.getShortName(getClass()) + ": [name=" + name + "]";
- }
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java
deleted file mode 100644
index 55689f8ce4..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanIntegrationTests.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Copyright 2010-2014 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.test.step;
-
-import static org.junit.Assert.assertEquals;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.repository.JobRepository;
-import org.springframework.batch.core.step.factory.FaultTolerantStepFactoryBean;
-import org.springframework.batch.item.ItemProcessor;
-import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.ParseException;
-import org.springframework.batch.item.UnexpectedInputException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.util.Assert;
-
-/**
- * Tests for {@link FaultTolerantStepFactoryBean}.
- */
-@ContextConfiguration(locations = "/simple-job-launcher-context.xml")
-@RunWith(SpringJUnit4ClassRunner.class)
-public class FaultTolerantStepFactoryBeanIntegrationTests {
-
- private static final int MAX_COUNT = 1000;
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private FaultTolerantStepFactoryBean factory;
-
- private SkipProcessorStub processor;
-
- private SkipWriterStub writer;
-
- private JobExecution jobExecution;
-
- private StepExecution stepExecution;
-
- @Autowired
- private DataSource dataSource;
-
- @Autowired
- private JobRepository repository;
-
- @Autowired
- private PlatformTransactionManager transactionManager;
-
- @Before
- public void setUp() throws Exception {
-
- writer = new SkipWriterStub(dataSource);
- processor = new SkipProcessorStub(dataSource);
-
- factory = new FaultTolerantStepFactoryBean();
-
- factory.setBeanName("stepName");
- factory.setTransactionManager(transactionManager);
- factory.setJobRepository(repository);
- factory.setCommitInterval(3);
- ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
- taskExecutor.setCorePoolSize(3);
- taskExecutor.setMaxPoolSize(6);
- taskExecutor.setQueueCapacity(0);
- taskExecutor.afterPropertiesSet();
- factory.setTaskExecutor(taskExecutor);
-
- JdbcTestUtils.deleteFromTables(new JdbcTemplate(dataSource), "ERROR_LOG");
-
- }
-
- @Test
- public void testUpdatesNoRollback() throws Exception {
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
-
- writer.write(Arrays.asList("foo", "bar"));
- processor.process("spam");
- assertEquals(3, JdbcTestUtils.countRowsInTable(jdbcTemplate, "ERROR_LOG"));
-
- writer.clear();
- processor.clear();
- assertEquals(0, JdbcTestUtils.countRowsInTable(jdbcTemplate, "ERROR_LOG"));
-
- }
-
- @Test
- public void testMultithreadedSunnyDay() throws Throwable {
-
- jobExecution = repository.createJobExecution("vanillaJob", new JobParameters());
-
- for (int i = 0; i < MAX_COUNT; i++) {
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
-
- SkipReaderStub reader = new SkipReaderStub();
- reader.clear();
- reader.setItems("1", "2", "3", "4", "5");
- factory.setItemReader(reader);
- writer.clear();
- factory.setItemWriter(writer);
- processor.clear();
- factory.setItemProcessor(processor);
-
- assertEquals(0, JdbcTestUtils.countRowsInTable(jdbcTemplate, "ERROR_LOG"));
-
- try {
-
- Step step = factory.getObject();
-
- stepExecution = jobExecution.createStepExecution(factory.getName());
- repository.add(stepExecution);
- step.execute(stepExecution);
- assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
-
- List committed = new ArrayList(writer.getCommitted());
- Collections.sort(committed);
- assertEquals("[1, 2, 3, 4, 5]", committed.toString());
- List processed = new ArrayList(processor.getCommitted());
- Collections.sort(processed);
- assertEquals("[1, 2, 3, 4, 5]", processed.toString());
- assertEquals(0, stepExecution.getSkipCount());
-
- }
- catch (Throwable e) {
- logger.info("Failed on iteration " + i + " of " + MAX_COUNT);
- throw e;
- }
-
- }
-
- }
-
- private static class SkipReaderStub implements ItemReader {
-
- private String[] items;
-
- private int counter = -1;
-
- public SkipReaderStub() throws Exception {
- super();
- }
-
- public void setItems(String... items) {
- Assert.isTrue(counter < 0, "Items cannot be set once reading has started");
- this.items = items;
- }
-
- public void clear() {
- counter = -1;
- }
-
- @Override
- public synchronized String read() throws Exception, UnexpectedInputException, ParseException {
- counter++;
- if (counter >= items.length) {
- return null;
- }
- String item = items[counter];
- return item;
- }
- }
-
- private static class SkipWriterStub implements ItemWriter {
-
- private List written = new ArrayList();
-
- private Collection failures = Collections.emptySet();
-
- private JdbcTemplate jdbcTemplate;
-
- public SkipWriterStub(DataSource dataSource) {
- jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- public List getCommitted() {
- return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='written'",
- new RowMapper() {
- @Override
- public String mapRow(ResultSet rs, int rowNum) throws SQLException {
- return rs.getString(1);
- }
- });
- }
-
- public void clear() {
- written.clear();
- jdbcTemplate.update("DELETE FROM ERROR_LOG where STEP_NAME='written'");
- }
-
- @Override
- public void write(List extends String> items) throws Exception {
- for (String item : items) {
- written.add(item);
- jdbcTemplate.update("INSERT INTO ERROR_LOG (MESSAGE, STEP_NAME) VALUES (?, ?)", item, "written");
- checkFailure(item);
- }
- }
-
- private void checkFailure(String item) {
- if (failures.contains(item)) {
- throw new RuntimeException("Planned failure");
- }
- }
- }
-
- private static class SkipProcessorStub implements ItemProcessor {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private List processed = new ArrayList();
-
- private JdbcTemplate jdbcTemplate;
-
- /**
- * @param dataSource
- */
- public SkipProcessorStub(DataSource dataSource) {
- jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- public List getCommitted() {
- return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='processed'",
- new RowMapper() {
- @Override
- public String mapRow(ResultSet rs, int rowNum) throws SQLException {
- return rs.getString(1);
- }
- });
- }
-
- public void clear() {
- processed.clear();
- jdbcTemplate.update("DELETE FROM ERROR_LOG where STEP_NAME='processed'");
- }
-
- @Override
- public String process(String item) throws Exception {
- processed.add(item);
- logger.debug("Processed item: "+item);
- jdbcTemplate.update("INSERT INTO ERROR_LOG (MESSAGE, STEP_NAME) VALUES (?, ?)", item, "processed");
- return item;
- }
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java
deleted file mode 100644
index 90a2ce8581..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/FaultTolerantStepFactoryBeanRollbackIntegrationTests.java
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Copyright 2010-2014 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.test.step;
-
-import static org.junit.Assert.assertEquals;
-
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.repository.JobRepository;
-import org.springframework.batch.core.step.factory.FaultTolerantStepFactoryBean;
-import org.springframework.batch.item.ItemProcessor;
-import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.ParseException;
-import org.springframework.batch.item.UnexpectedInputException;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.core.RowMapper;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.test.context.ContextConfiguration;
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.springframework.test.jdbc.JdbcTestUtils;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.util.Assert;
-
-/**
- * Tests for {@link FaultTolerantStepFactoryBean}.
- */
-@ContextConfiguration(locations = "/simple-job-launcher-context.xml")
-@RunWith(SpringJUnit4ClassRunner.class)
-public class FaultTolerantStepFactoryBeanRollbackIntegrationTests {
-
- private static final int MAX_COUNT = 1000;
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private FaultTolerantStepFactoryBean factory;
-
- private SkipProcessorStub processor;
-
- private SkipWriterStub writer;
-
- private JobExecution jobExecution;
-
- private StepExecution stepExecution;
-
- @Autowired
- private DataSource dataSource;
-
- @Autowired
- private JobRepository repository;
-
- @Autowired
- private PlatformTransactionManager transactionManager;
-
- @Before
- public void setUp() throws Exception {
-
- writer = new SkipWriterStub(dataSource);
- processor = new SkipProcessorStub(dataSource);
-
- factory = new FaultTolerantStepFactoryBean();
-
- factory.setBeanName("stepName");
- factory.setTransactionManager(transactionManager);
- factory.setJobRepository(repository);
- factory.setCommitInterval(3);
- factory.setSkipLimit(10);
-
- JdbcTestUtils.deleteFromTables(new JdbcTemplate(dataSource), "ERROR_LOG");
-
- }
-
- @Test
- public void testUpdatesNoRollback() throws Exception {
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
-
- writer.write(Arrays.asList("foo", "bar"));
- processor.process("spam");
- assertEquals(3, JdbcTestUtils.countRowsInTable(jdbcTemplate, "ERROR_LOG"));
-
- writer.clear();
- processor.clear();
- assertEquals(0, JdbcTestUtils.countRowsInTable(jdbcTemplate, "ERROR_LOG"));
-
- }
-
- @Test
- public void testMultithreadedSkipInWriter() throws Throwable {
-
- ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
- taskExecutor.setCorePoolSize(3);
- taskExecutor.setMaxPoolSize(6);
- taskExecutor.setQueueCapacity(0);
- taskExecutor.afterPropertiesSet();
- factory.setTaskExecutor(taskExecutor);
-
- @SuppressWarnings("unchecked")
- Map, Boolean> skippable = getExceptionMap(Exception.class);
- factory.setSkippableExceptionClasses(skippable);
-
- jobExecution = repository.createJobExecution("skipJob", new JobParameters());
-
- for (int i = 0; i < MAX_COUNT; i++) {
-
- if (i % 100 == 0) {
- logger.info("Starting step: " + i);
- }
-
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- assertEquals(0, JdbcTestUtils.countRowsInTable(jdbcTemplate, "ERROR_LOG"));
-
- try {
-
- SkipReaderStub reader = new SkipReaderStub();
- reader.clear();
- reader.setItems("1", "2", "3", "4", "5");
- factory.setItemReader(reader);
- writer.clear();
- factory.setItemWriter(writer);
- processor.clear();
- factory.setItemProcessor(processor);
-
- writer.setFailures("1", "2", "3", "4", "5");
-
- Step step = factory.getObject();
-
- stepExecution = jobExecution.createStepExecution(factory.getName());
- repository.add(stepExecution);
- step.execute(stepExecution);
- assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
-
- assertEquals("[]", writer.getCommitted().toString());
- assertEquals("[]", processor.getCommitted().toString());
- List processed = new ArrayList(processor.getProcessed());
- Collections.sort(processed);
- assertEquals("[1, 1, 2, 2, 3, 3, 4, 4, 5, 5]", processed.toString());
- assertEquals(5, stepExecution.getSkipCount());
-
- }
- catch (Throwable e) {
- logger.info("Failed on iteration " + i + " of " + MAX_COUNT);
- throw e;
- }
-
- }
-
- }
-
- private Map, Boolean> getExceptionMap(Class extends Throwable>... args) {
- Map, Boolean> map = new HashMap, Boolean>();
- for (Class extends Throwable> arg : args) {
- map.put(arg, true);
- }
- return map;
- }
-
- private static class SkipReaderStub implements ItemReader {
-
- private String[] items;
-
- private int counter = -1;
-
- public SkipReaderStub() throws Exception {
- super();
- }
-
- public void setItems(String... items) {
- Assert.isTrue(counter < 0, "Items cannot be set once reading has started");
- this.items = items;
- }
-
- public void clear() {
- counter = -1;
- }
-
- @Override
- public synchronized String read() throws Exception, UnexpectedInputException, ParseException {
- counter++;
- if (counter >= items.length) {
- return null;
- }
- String item = items[counter];
- return item;
- }
- }
-
- private static class SkipWriterStub implements ItemWriter {
-
- private List written = new CopyOnWriteArrayList();
-
- private Collection failures = Collections.emptySet();
-
- private JdbcTemplate jdbcTemplate;
-
- public SkipWriterStub(DataSource dataSource) {
- jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- public void setFailures(String... failures) {
- this.failures = Arrays.asList(failures);
- }
-
- public List getCommitted() {
- return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='written'",
- new RowMapper() {
- @Override
- public String mapRow(ResultSet rs, int rowNum) throws SQLException {
- return rs.getString(1);
- }
- });
- }
-
- public void clear() {
- written.clear();
- jdbcTemplate.update("DELETE FROM ERROR_LOG where STEP_NAME='written'");
- }
-
- @Override
- public void write(List extends String> items) throws Exception {
- for (String item : items) {
- written.add(item);
- jdbcTemplate.update("INSERT INTO ERROR_LOG (MESSAGE, STEP_NAME) VALUES (?, ?)", item, "written");
- checkFailure(item);
- }
- }
-
- private void checkFailure(String item) {
- if (failures.contains(item)) {
- throw new RuntimeException("Planned failure");
- }
- }
- }
-
- private static class SkipProcessorStub implements ItemProcessor {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private List processed = new CopyOnWriteArrayList();
-
- private JdbcTemplate jdbcTemplate;
-
- /**
- * @param dataSource
- */
- public SkipProcessorStub(DataSource dataSource) {
- jdbcTemplate = new JdbcTemplate(dataSource);
- }
-
- /**
- * @return the processed
- */
- public List getProcessed() {
- return processed;
- }
-
- public List getCommitted() {
- return jdbcTemplate.query("SELECT MESSAGE from ERROR_LOG where STEP_NAME='processed'",
- new RowMapper() {
- @Override
- public String mapRow(ResultSet rs, int rowNum) throws SQLException {
- return rs.getString(1);
- }
- });
- }
-
- public void clear() {
- processed.clear();
- jdbcTemplate.update("DELETE FROM ERROR_LOG where STEP_NAME='processed'");
- }
-
- @Override
- public String process(String item) throws Exception {
- processed.add(item);
- logger.debug("Processed item: " + item);
- jdbcTemplate.update("INSERT INTO ERROR_LOG (MESSAGE, STEP_NAME) VALUES (?, ?)", item, "processed");
- return item;
- }
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/MapRepositoryFaultTolerantStepFactoryBeanRollbackTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/MapRepositoryFaultTolerantStepFactoryBeanRollbackTests.java
deleted file mode 100644
index ff467ff4ec..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/MapRepositoryFaultTolerantStepFactoryBeanRollbackTests.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright 2010-2014 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.test.step;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.repository.JobRepository;
-import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
-import org.springframework.batch.core.step.factory.FaultTolerantStepFactoryBean;
-import org.springframework.batch.item.ItemProcessor;
-import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.ParseException;
-import org.springframework.batch.item.UnexpectedInputException;
-import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.util.Assert;
-
-/**
- * Tests for {@link FaultTolerantStepFactoryBean}.
- */
-public class MapRepositoryFaultTolerantStepFactoryBeanRollbackTests {
-
- private static final int MAX_COUNT = 1000;
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private FaultTolerantStepFactoryBean factory;
-
- private SkipReaderStub reader;
-
- private SkipProcessorStub processor;
-
- private SkipWriterStub writer;
-
- private JobExecution jobExecution;
-
- private StepExecution stepExecution;
-
- private JobRepository repository;
-
- private PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
-
- @SuppressWarnings("unchecked")
- @Before
- public void setUp() throws Exception {
-
- reader = new SkipReaderStub();
- writer = new SkipWriterStub();
- processor = new SkipProcessorStub();
-
- factory = new FaultTolerantStepFactoryBean();
-
- factory.setTransactionManager(transactionManager);
- factory.setBeanName("stepName");
- factory.setCommitInterval(3);
- ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
- taskExecutor.setCorePoolSize(3);
- taskExecutor.setMaxPoolSize(6);
- taskExecutor.setQueueCapacity(0);
- taskExecutor.afterPropertiesSet();
- factory.setTaskExecutor(taskExecutor);
-
- factory.setSkipLimit(10);
- factory.setSkippableExceptionClasses(getExceptionMap(Exception.class));
-
- }
-
- @Test
- public void testUpdatesNoRollback() throws Exception {
-
- writer.write(Arrays.asList("foo", "bar"));
- processor.process("spam");
- assertEquals(2, writer.getWritten().size());
- assertEquals(1, processor.getProcessed().size());
-
- writer.clear();
- processor.clear();
- assertEquals(0, processor.getProcessed().size());
-
- }
-
- @Test
- public void testMultithreadedSkipInWrite() throws Throwable {
-
- for (int i = 0; i < MAX_COUNT; i++) {
-
- if (i%100==0) {
- logger.info("Starting step: "+i);
- repository = new MapJobRepositoryFactoryBean(transactionManager).getObject();
- factory.setJobRepository(repository);
- jobExecution = repository.createJobExecution("vanillaJob", new JobParameters());
- }
-
- reader.clear();
- reader.setItems("1", "2", "3", "4", "5");
- factory.setItemReader(reader);
- writer.clear();
- factory.setItemWriter(writer);
- processor.clear();
- factory.setItemProcessor(processor);
-
- writer.setFailures("1", "2", "3", "4", "5");
-
- try {
-
- Step step = factory.getObject();
-
- stepExecution = jobExecution.createStepExecution(factory.getName());
- repository.add(stepExecution);
- step.execute(stepExecution);
- assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
-
- assertEquals(5, stepExecution.getSkipCount());
- List processed = new ArrayList(processor.getProcessed());
- Collections.sort(processed);
- assertEquals("[1, 1, 2, 2, 3, 3, 4, 4, 5, 5]", processed.toString());
-
- }
- catch (Throwable e) {
- logger.info("Failed on iteration " + i + " of " + MAX_COUNT);
- throw e;
- }
-
- }
-
- }
-
- private static class SkipReaderStub implements ItemReader {
-
- private String[] items;
-
- private int counter = -1;
-
- public SkipReaderStub() throws Exception {
- super();
- }
-
- public void setItems(String... items) {
- Assert.isTrue(counter < 0, "Items cannot be set once reading has started");
- this.items = items;
- }
-
- public void clear() {
- counter = -1;
- }
-
- @Override
- public synchronized String read() throws Exception, UnexpectedInputException, ParseException {
- counter++;
- if (counter >= items.length) {
- return null;
- }
- String item = items[counter];
- return item;
- }
- }
-
- private static class SkipWriterStub implements ItemWriter {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private List written = new CopyOnWriteArrayList();
-
- private Collection failures = Collections.emptySet();
-
- public void setFailures(String... failures) {
- this.failures = Arrays.asList(failures);
- }
-
- public List getWritten() {
- return written;
- }
-
- public void clear() {
- written.clear();
- }
-
- @Override
- public void write(List extends String> items) throws Exception {
- for (String item : items) {
- logger.trace("Writing: "+item);
- written.add(item);
- checkFailure(item);
- }
- }
-
- private void checkFailure(String item) {
- if (failures.contains(item)) {
- throw new RuntimeException("Planned failure");
- }
- }
- }
-
- private static class SkipProcessorStub implements ItemProcessor {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private List processed = new CopyOnWriteArrayList();
-
- public List getProcessed() {
- return processed;
- }
-
- public void clear() {
- processed.clear();
- }
-
- @Override
- public String process(String item) throws Exception {
- processed.add(item);
- logger.debug("Processed item: "+item);
- return item;
- }
- }
-
- private Map, Boolean> getExceptionMap(Class extends Throwable>... args) {
- Map, Boolean> map = new HashMap, Boolean>();
- for (Class extends Throwable> arg : args) {
- map.put(arg, true);
- }
- return map;
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/MapRepositoryFaultTolerantStepFactoryBeanTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/MapRepositoryFaultTolerantStepFactoryBeanTests.java
deleted file mode 100644
index f5fdf64c59..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/MapRepositoryFaultTolerantStepFactoryBeanTests.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright 2010-2014 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.test.step;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Before;
-import org.junit.Test;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.Step;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.batch.core.repository.JobRepository;
-import org.springframework.batch.core.repository.support.MapJobRepositoryFactoryBean;
-import org.springframework.batch.core.step.factory.FaultTolerantStepFactoryBean;
-import org.springframework.batch.item.ItemProcessor;
-import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.ItemWriter;
-import org.springframework.batch.item.ParseException;
-import org.springframework.batch.item.UnexpectedInputException;
-import org.springframework.batch.support.transaction.ResourcelessTransactionManager;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.util.Assert;
-
-/**
- * Tests for {@link FaultTolerantStepFactoryBean}.
- */
-public class MapRepositoryFaultTolerantStepFactoryBeanTests {
-
- private static final int MAX_COUNT = 1000;
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private FaultTolerantStepFactoryBean factory;
-
- private SkipReaderStub reader;
-
- private SkipProcessorStub processor;
-
- private SkipWriterStub writer;
-
- private JobExecution jobExecution;
-
- private StepExecution stepExecution;
-
- private JobRepository repository;
-
- private PlatformTransactionManager transactionManager = new ResourcelessTransactionManager();
-
- @Before
- public void setUp() throws Exception {
-
- reader = new SkipReaderStub();
- writer = new SkipWriterStub();
- processor = new SkipProcessorStub();
-
- factory = new FaultTolerantStepFactoryBean();
-
- factory.setBeanName("stepName");
- factory.setTransactionManager(transactionManager);
- factory.setCommitInterval(3);
- ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
- taskExecutor.setCorePoolSize(3);
- taskExecutor.setMaxPoolSize(6);
- taskExecutor.setQueueCapacity(0);
- taskExecutor.afterPropertiesSet();
- factory.setTaskExecutor(taskExecutor);
-
- }
-
- @Test
- public void testUpdatesNoRollback() throws Exception {
-
- writer.write(Arrays.asList("foo", "bar"));
- processor.process("spam");
- assertEquals(2, writer.getWritten().size());
- assertEquals(1, processor.getProcessed().size());
-
- writer.clear();
- processor.clear();
- assertEquals(0, processor.getProcessed().size());
-
- }
-
- @Test
- public void testMultithreadedSunnyDay() throws Throwable {
-
- for (int i = 0; i < MAX_COUNT; i++) {
-
- if (i%100==0) {
- logger.info("Starting step: "+i);
- repository = new MapJobRepositoryFactoryBean(transactionManager).getObject();
- factory.setJobRepository(repository);
- jobExecution = repository.createJobExecution("vanillaJob", new JobParameters());
- }
-
- reader.clear();
- reader.setItems("1", "2", "3", "4", "5");
- factory.setItemReader(reader);
- writer.clear();
- factory.setItemWriter(writer);
- processor.clear();
- factory.setItemProcessor(processor);
-
- try {
-
- Step step = factory.getObject();
-
- stepExecution = jobExecution.createStepExecution(factory.getName());
- repository.add(stepExecution);
- step.execute(stepExecution);
- assertEquals(BatchStatus.COMPLETED, stepExecution.getStatus());
-
- List committed = new ArrayList(writer.getWritten());
- Collections.sort(committed);
- assertEquals("[1, 2, 3, 4, 5]", committed.toString());
- List processed = new ArrayList(processor.getProcessed());
- Collections.sort(processed);
- assertEquals("[1, 2, 3, 4, 5]", processed.toString());
- assertEquals(0, stepExecution.getSkipCount());
-
- }
- catch (Throwable e) {
- logger.info("Failed on iteration " + i + " of " + MAX_COUNT);
- throw e;
- }
-
- }
-
- }
-
- private static class SkipReaderStub implements ItemReader {
-
- private String[] items;
-
- private int counter = -1;
-
- public SkipReaderStub() throws Exception {
- super();
- }
-
- public void setItems(String... items) {
- Assert.isTrue(counter < 0, "Items cannot be set once reading has started");
- this.items = items;
- }
-
- public void clear() {
- counter = -1;
- }
-
- @Override
- public synchronized String read() throws Exception, UnexpectedInputException, ParseException {
- counter++;
- if (counter >= items.length) {
- return null;
- }
- String item = items[counter];
- return item;
- }
- }
-
- private static class SkipWriterStub implements ItemWriter {
-
- private List written = new CopyOnWriteArrayList();
-
- private Collection failures = Collections.emptySet();
-
- public List getWritten() {
- return written;
- }
-
- public void clear() {
- written.clear();
- }
-
- @Override
- public void write(List extends String> items) throws Exception {
- for (String item : items) {
- written.add(item);
- checkFailure(item);
- }
- }
-
- private void checkFailure(String item) {
- if (failures.contains(item)) {
- throw new RuntimeException("Planned failure");
- }
- }
- }
-
- private static class SkipProcessorStub implements ItemProcessor {
-
- private final Log logger = LogFactory.getLog(getClass());
-
- private List processed = new CopyOnWriteArrayList();
-
- public List getProcessed() {
- return processed;
- }
-
- public void clear() {
- processed.clear();
- }
-
- @Override
- public String process(String item) throws Exception {
- processed.add(item);
- logger.debug("Processed item: "+item);
- return item;
- }
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests.java
deleted file mode 100644
index 6c238d2943..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Copyright 2006-2009 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.test.step;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.concurrent.atomic.AtomicInteger;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Test;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParametersBuilder;
-import org.springframework.batch.core.StepContribution;
-import org.springframework.batch.core.launch.JobLauncher;
-import org.springframework.batch.core.scope.context.ChunkContext;
-import org.springframework.batch.core.step.tasklet.Tasklet;
-import org.springframework.batch.repeat.RepeatStatus;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
-
-/**
- * @author Dave Syer
- *
- */
-public class SplitJobMapRepositoryIntegrationTests {
-
- private static final int MAX_COUNT = 1000;
-
- /** Logger */
- private final Log logger = LogFactory.getLog(getClass());
-
- @SuppressWarnings("resource")
- @Test
- public void testMultithreadedSplit() throws Throwable {
-
- JobLauncher jobLauncher = null;
- Job job = null;
-
- ClassPathXmlApplicationContext context = null;
-
- for (int i = 0; i < MAX_COUNT; i++) {
-
- if (i % 100 == 0) {
- if (context!=null) {
- context.close();
- }
- logger.info("Starting job: " + i);
- context = new ClassPathXmlApplicationContext(getClass().getSimpleName()
- + "-context.xml", getClass());
- jobLauncher = context.getBean("jobLauncher", JobLauncher.class);
- job = context.getBean("job", Job.class);
- }
-
- try {
- JobExecution execution = jobLauncher.run(job, new JobParametersBuilder().addLong("count", new Long(i))
- .toJobParameters());
- assertEquals(BatchStatus.COMPLETED, execution.getStatus());
- }
- catch (Throwable e) {
- logger.info("Failed on iteration " + i + " of " + MAX_COUNT);
- throw e;
- }
-
- }
-
- }
-
- public static class CountingTasklet implements Tasklet {
-
- private int maxCount = 10;
-
- private AtomicInteger count = new AtomicInteger(0);
-
- @Override
- public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
- contribution.incrementReadCount();
- contribution.incrementWriteCount(1);
- return RepeatStatus.continueIf(count.incrementAndGet() < maxCount);
- }
-
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/StepExecutionSerializationUtilsTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/StepExecutionSerializationUtilsTests.java
deleted file mode 100644
index 8fc1ad4cc6..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/step/StepExecutionSerializationUtilsTests.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * Copyright 2006-2014 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.test.step;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.CompletionService;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorCompletionService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-
-import org.junit.Test;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobInstance;
-import org.springframework.batch.core.JobParameters;
-import org.springframework.batch.core.StepExecution;
-import org.springframework.util.SerializationUtils;
-
-/**
- * @author Dave Syer
- * @author Michael Minella
- */
-public class StepExecutionSerializationUtilsTests {
-
- @Test
- public void testCycle() throws Exception {
- StepExecution stepExecution = new StepExecution("step", new JobExecution(new JobInstance(123L,
- "job"), 321L, new JobParameters(), null), 11L);
- stepExecution.getExecutionContext().put("foo.bar.spam", 123);
- StepExecution result = getCopy(stepExecution);
- assertEquals(stepExecution, result);
- }
-
- @Test
- public void testMultipleCycles() throws Throwable {
-
- int count = 0;
- int repeats = 100;
- int threads = 10;
-
- Executor executor = Executors.newFixedThreadPool(threads);
- CompletionService completionService = new ExecutorCompletionService(executor);
-
- for (int i = 0; i < repeats; i++) {
- final JobExecution jobExecution = new JobExecution(new JobInstance(123L, "job"), 321L, new JobParameters(), null);
- for (int j = 0; j < threads; j++) {
- completionService.submit(new Callable() {
- @Override
- public StepExecution call() throws Exception {
- final StepExecution stepExecution = jobExecution.createStepExecution("step");
- stepExecution.getExecutionContext().put("foo.bar.spam", 123);
- StepExecution result = getCopy(stepExecution);
- assertEquals(stepExecution.getExecutionContext(), result.getExecutionContext());
- return result;
- }
- });
- }
- for (int j = 0; j < threads; j++) {
- Future future = completionService.poll(repeats, TimeUnit.MILLISECONDS);
- if (future != null) {
- count++;
- try {
- future.get();
- } catch (Throwable e) {
- throw new IllegalStateException("Failed on count="+count, e);
- }
- }
- }
- }
- while (count < threads*repeats) {
- Future future = completionService.poll();
- count++;
- try {
- future.get();
- } catch (Throwable e) {
- throw new IllegalStateException("Failed on count="+count, e);
- }
- }
- }
-
- private StepExecution getCopy(StepExecution stepExecution) {
- return (StepExecution) SerializationUtils.deserialize(SerializationUtils.serialize(stepExecution));
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/timeout/TimeoutJobIntegrationTests.java b/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/timeout/TimeoutJobIntegrationTests.java
deleted file mode 100644
index eec8e7fed9..0000000000
--- a/spring-batch-core-tests/src/test/java/org/springframework/batch/core/test/timeout/TimeoutJobIntegrationTests.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright 2014 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.test.timeout;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.batch.core.BatchStatus;
-import org.springframework.batch.core.Job;
-import org.springframework.batch.core.JobExecution;
-import org.springframework.batch.core.JobParametersBuilder;
-import org.springframework.batch.core.launch.JobLauncher;
-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;
-
-@RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(locations = { "/simple-job-launcher-context.xml", "/META-INF/batch/timeoutJob.xml" })
-public class TimeoutJobIntegrationTests {
-
- /** Logger */
- @SuppressWarnings("unused")
- private final Log logger = LogFactory.getLog(getClass());
-
- @Autowired
- private JobLauncher jobLauncher;
-
- @Autowired
- @Qualifier("chunkTimeoutJob")
- private Job chunkTimeoutJob;
-
- @Autowired
- @Qualifier("taskletTimeoutJob")
- private Job taskletTimeoutJob;
-
- @Test
- public void testChunkTimeoutShouldFail() throws Exception {
- JobExecution execution = jobLauncher.run(chunkTimeoutJob, new JobParametersBuilder().addLong("id", System.currentTimeMillis())
- .toJobParameters());
- assertEquals(BatchStatus.FAILED, execution.getStatus());
- }
-
- @Test
- public void testTaskletTimeoutShouldFail() throws Exception {
- JobExecution execution = jobLauncher.run(taskletTimeoutJob, new JobParametersBuilder().addLong("id", System.currentTimeMillis())
- .toJobParameters());
- assertEquals(BatchStatus.FAILED, execution.getStatus());
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/test/jdbc/datasource/DataSourceInitializer.java b/spring-batch-core-tests/src/test/java/test/jdbc/datasource/DataSourceInitializer.java
deleted file mode 100644
index 5fa3a7977f..0000000000
--- a/spring-batch-core-tests/src/test/java/test/jdbc/datasource/DataSourceInitializer.java
+++ /dev/null
@@ -1,165 +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 test.jdbc.datasource;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Arrays;
-
-import javax.sql.DataSource;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.factory.BeanInitializationException;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.core.io.Resource;
-import org.springframework.dao.DataAccessException;
-import org.springframework.jdbc.core.JdbcTemplate;
-import org.springframework.jdbc.datasource.DataSourceTransactionManager;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.support.TransactionTemplate;
-import org.springframework.util.Assert;
-import org.springframework.util.StringUtils;
-
-public class DataSourceInitializer implements InitializingBean, DisposableBean {
-
- private Resource[] initScripts;
-
- private Resource destroyScript;
-
- private DataSource dataSource;
-
- private boolean initialize = false;
-
- private Log logger = LogFactory.getLog(getClass());
-
- private static boolean initialized = false;
-
- public void setInitialize(boolean initialize) {
- this.initialize = initialize;
- }
-
- @Override
- public void destroy() throws Exception {
- if (!initialized) {
- return;
- }
- try {
- if (destroyScript!=null) {
- doExecuteScript(destroyScript);
- initialized = false;
- }
- }
- catch (Exception e) {
- if (logger.isDebugEnabled()) {
- logger.warn("Could not execute destroy script [" + destroyScript + "]", e);
- }
- else {
- logger.warn("Could not execute destroy script [" + destroyScript + "]");
- }
- }
- }
-
- @Override
- public void afterPropertiesSet() throws Exception {
- Assert.notNull(dataSource);
- logger.info("Initializing with scripts: "+Arrays.asList(initScripts));
- if (!initialized && initialize) {
- try {
- doExecuteScript(destroyScript);
- }
- catch (Exception e) {
- logger.debug("Could not execute destroy script [" + destroyScript + "]", e);
- }
- if (initScripts != null) {
- for (int i = 0; i < initScripts.length; i++) {
- Resource initScript = initScripts[i];
- logger.info("Executing init script: "+initScript);
- doExecuteScript(initScript);
- }
- }
- initialized = true;
- }
- }
-
- private void doExecuteScript(final Resource scriptResource) {
- if (scriptResource == null || !scriptResource.exists())
- return;
- TransactionTemplate transactionTemplate = new TransactionTemplate(new DataSourceTransactionManager(dataSource));
- transactionTemplate.execute(new TransactionCallback() {
-
- @Override
- @SuppressWarnings("unchecked")
- public Void doInTransaction(TransactionStatus status) {
- JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);
- String[] scripts;
- try {
- scripts = StringUtils.delimitedListToStringArray(stripComments(IOUtils.readLines(scriptResource
- .getInputStream())), ";");
- }
- catch (IOException e) {
- throw new BeanInitializationException("Cannot load script from [" + scriptResource + "]", e);
- }
- for (int i = 0; i < scripts.length; i++) {
- String script = scripts[i].trim();
- if (StringUtils.hasText(script)) {
- try {
- jdbcTemplate.execute(scripts[i]);
- } catch (DataAccessException e) {
- if (!script.toUpperCase().startsWith("DROP")) {
- throw e;
- }
- }
- }
- }
- return null;
- }
-
- });
-
- }
-
- private String stripComments(List list) {
- StringBuilder buffer = new StringBuilder();
- for (String line : list) {
- if (!line.startsWith("//") && !line.startsWith("--")) {
- buffer.append(line).append("\n");
- }
- }
- return buffer.toString();
- }
-
- public Class getObjectType() {
- return DataSource.class;
- }
-
- public void setInitScripts(Resource[] initScripts) {
- this.initScripts = initScripts;
- }
-
- public void setDestroyScript(Resource destroyScript) {
- this.destroyScript = destroyScript;
- }
-
- public void setDataSource(DataSource dataSource) {
- this.dataSource = dataSource;
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/java/test/jdbc/datasource/DerbyDataSourceFactoryBean.java b/spring-batch-core-tests/src/test/java/test/jdbc/datasource/DerbyDataSourceFactoryBean.java
deleted file mode 100644
index 8bd47a4a57..0000000000
--- a/spring-batch-core-tests/src/test/java/test/jdbc/datasource/DerbyDataSourceFactoryBean.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright 2009-2014 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 test.jdbc.datasource;
-
-import java.io.File;
-
-import javax.sql.DataSource;
-
-import org.apache.derby.jdbc.EmbeddedDataSource;
-import org.springframework.beans.factory.config.AbstractFactoryBean;
-
-public class DerbyDataSourceFactoryBean extends AbstractFactoryBean {
-
- private String dataDirectory = "derby-home";
-
- public void setDataDirectory(String dataDirectory) {
- this.dataDirectory = dataDirectory;
- }
-
- @Override
- protected DataSource createInstance() throws Exception {
- File directory = new File(dataDirectory);
- System.setProperty("derby.system.home", directory.getCanonicalPath());
- System.setProperty("derby.storage.fileSyncTransactionLog", "true");
- System.setProperty("derby.storage.pageCacheSize", "100");
-
- final EmbeddedDataSource ds = new EmbeddedDataSource();
- ds.setDatabaseName("derbydb");
- ds.setCreateDatabase("create");
-
- return ds;
- }
-
- @Override
- public Class getObjectType() {
- return DataSource.class;
- }
-
-}
diff --git a/spring-batch-core-tests/src/test/resources/applicationContext-test1.xml b/spring-batch-core-tests/src/test/resources/applicationContext-test1.xml
deleted file mode 100644
index 5f8be26c28..0000000000
--- a/spring-batch-core-tests/src/test/resources/applicationContext-test1.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/resources/applicationContext-test2.xml b/spring-batch-core-tests/src/test/resources/applicationContext-test2.xml
deleted file mode 100644
index 3712aeee6f..0000000000
--- a/spring-batch-core-tests/src/test/resources/applicationContext-test2.xml
+++ /dev/null
@@ -1,61 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/resources/batch-derby.properties b/spring-batch-core-tests/src/test/resources/batch-derby.properties
deleted file mode 100644
index 380004cd1d..0000000000
--- a/spring-batch-core-tests/src/test/resources/batch-derby.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# Placeholders batch.*
-# for Derby:
-batch.jdbc.driver=org.apache.derby.jdbc.EmbeddedDriver
-batch.jdbc.url=jdbc:derby:derby-home/test;create=true
-batch.jdbc.user=sa
-batch.jdbc.password=
-batch.jdbc.testWhileIdle=false
-batch.jdbc.validationQuery=
-batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-derby.sql
-batch.schema.script=classpath:/org/springframework/batch/core/schema-derby.sql
-batch.business.schema.script=business-schema-derby.sql
-batch.data.source.init=true
-batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
-batch.database.incrementer.parent=columnIncrementerParent
-batch.grid.size=2
-batch.verify.cursor.position=false
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/resources/batch-hsql.properties b/spring-batch-core-tests/src/test/resources/batch-hsql.properties
deleted file mode 100644
index 08baa13e80..0000000000
--- a/spring-batch-core-tests/src/test/resources/batch-hsql.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-# Placeholders batch.*
-# for HSQLDB:
-batch.jdbc.driver=org.hsqldb.jdbcDriver
-batch.jdbc.url=jdbc:hsqldb:mem:testdb;sql.enforce_strict_size=true;hsqldb.tx=mvcc
-# use this one for a separate server process so you can inspect the results
-# (or add it to system properties with -D to override at run time).
-# batch.jdbc.url=jdbc:hsqldb:hsql://localhost:9005/samples
-batch.jdbc.user=sa
-batch.jdbc.password=
-batch.jdbc.testWhileIdle=false
-batch.jdbc.validationQuery=
-batch.schema.script=classpath:/org/springframework/batch/core/schema-hsqldb.sql
-batch.business.schema.script=classpath:/business-schema-hsqldb.sql
-batch.data.source.init=true
-batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.HsqlMaxValueIncrementer
-batch.database.incrementer.parent=columnIncrementerParent
-batch.grid.size=2
-batch.verify.cursor.position=true
diff --git a/spring-batch-core-tests/src/test/resources/batch-mysql.properties b/spring-batch-core-tests/src/test/resources/batch-mysql.properties
deleted file mode 100644
index f7377931f1..0000000000
--- a/spring-batch-core-tests/src/test/resources/batch-mysql.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-# Placeholders batch.*
-# for MySQL:
-batch.jdbc.driver=com.mysql.jdbc.Driver
-batch.jdbc.url=jdbc:mysql://localhost/test
-batch.jdbc.user=root
-batch.jdbc.password=root
-batch.schema.script=classpath:/org/springframework/batch/core/schema-mysql.sql
-batch.business.schema.script=classpath:/business-schema-mysql.sql
-batch.data.source.init=false
-batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.MySQLMaxValueIncrementer
-batch.database.incrementer.parent=columnIncrementerParent
-batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
-batch.verify.cursor.position=true
\ No newline at end of file
diff --git a/spring-batch-core-tests/src/test/resources/batch-postgres.properties b/spring-batch-core-tests/src/test/resources/batch-postgres.properties
deleted file mode 100644
index 9e47c540f2..0000000000
--- a/spring-batch-core-tests/src/test/resources/batch-postgres.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-# Placeholders batch.*
-# for Postgres:
-batch.jdbc.driver=org.postgresql.Driver
-batch.jdbc.url=jdbc:postgresql://localhost/test
-batch.jdbc.user=test
-batch.jdbc.password=test
-batch.jdbc.testWhileIdle=false
-batch.jdbc.validationQuery=
-batch.schema.script=classpath:/org/springframework/batch/core/schema-postgresql.sql
-batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-postgresql.sql
-batch.business.schema.script=classpath:/business-schema-postgresql.sql
-batch.data.source.init=true
-batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.PostgreSQLSequenceMaxValueIncrementer
-batch.database.incrementer.parent=sequenceIncrementerParent
-batch.grid.size=2
-batch.verify.cursor.position=true
diff --git a/spring-batch-core-tests/src/test/resources/data-source-context.xml b/spring-batch-core-tests/src/test/resources/data-source-context.xml
deleted file mode 100644
index 250993947a..0000000000
--- a/spring-batch-core-tests/src/test/resources/data-source-context.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
- ${batch.drop.script}
- ${batch.schema.script}
- ${batch.business.schema.script}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-batch-core-tests/src/test/resources/log4j.properties b/spring-batch-core-tests/src/test/resources/log4j.properties
deleted file mode 100644
index 4f10f29e38..0000000000
--- a/spring-batch-core-tests/src/test/resources/log4j.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-log4j.rootCategory=WARN, stdout
-
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %t %c{1}:%L - %m%n
-
-log4j.category.org.apache.activemq=ERROR
-# log4j.category.org.springframework=DEBUG
-log4j.category.org.springframework.jdbc=INFO
-log4j.category.org.springframework.context=INFO
-log4j.category.org.springframework.jms=INFO
-# log4j.category.org.springframework.batch=INFO
-log4j.category.org.springframework.batch.core.test=INFO
-log4j.category.org.springframework.retry=INFO
-# log4j.category.org.springframework.beans.factory.config=TRACE
diff --git a/spring-batch-core-tests/src/test/resources/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests-context.xml b/spring-batch-core-tests/src/test/resources/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests-context.xml
deleted file mode 100644
index 06700a5981..0000000000
--- a/spring-batch-core-tests/src/test/resources/org/springframework/batch/core/test/step/SplitJobMapRepositoryIntegrationTests-context.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-batch-core-tests/src/test/resources/simple-job-launcher-context.xml b/spring-batch-core-tests/src/test/resources/simple-job-launcher-context.xml
deleted file mode 100644
index 682f45343b..0000000000
--- a/spring-batch-core-tests/src/test/resources/simple-job-launcher-context.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/spring-batch-core/.springBeans b/spring-batch-core/.springBeans
deleted file mode 100644
index b0422b610b..0000000000
--- a/spring-batch-core/.springBeans
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
- 1
-
-
-
-
-
-
- src/test/resources/org/springframework/batch/core/configuration/support/test-context.xml
- src/test/resources/org/springframework/batch/core/launch/support/job.xml
- src/test/resources/org/springframework/batch/core/launch/support/test-environment.xml
- src/test/resources/org/springframework/batch/core/launch/support/2jobs.xml
- src/test/resources/org/springframework/batch/core/repository/dao/data-source-context.xml
- src/test/resources/org/springframework/batch/core/launch/support/job2.xml
- src/test/resources/org/springframework/batch/core/repository/dao/sql-dao-test.xml
- src/test/resources/org/springframework/batch/core/launch/support/test-environment-with-registry.xml
- src/test/resources/org/springframework/batch/core/configuration/support/trivial-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/BranchStepJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/common-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/OneStepJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/TwoStepJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/AsyncStepScopeIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/DecisionJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobExecutionListenerParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserTests-context.xml
- src/test/resources/org/springframework/batch/core/partition/launch-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/NextAttributeJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/RepositoryJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/SplitJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeDestructionCallbackIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeNestedIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopePlaceholderIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeStartupIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepWithBasicProcessTaskJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepWithFaultTolerantProcessTaskJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepWithSimpleTaskJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/EndTransitionJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/DefaultFailureJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/DefaultSuccessJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/EndTransitionDefaultStatusJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/FailTransitionDefaultStatusJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/FailTransitionJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/SplitDifferentResultsFailFirstJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/SplitDifferentResultsFailSecondJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepParserBeanNameTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepParserTaskletAttributesTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopIncompleteJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForJobElementTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringStepScopeForStepElementTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopAndRestartJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnCompletedStepJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopRestartOnFailedStepJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobRegistryJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/launch/JobLauncherIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopCustomStatusJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/child-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementParentAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/launch/support/error.xml
- src/test/resources/org/springframework/batch/core/step/item/FaultTolerantExceptionClassesTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/FlowJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/InlineItemHandlerParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobParserNextOutOfScopeTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobParserParentAttributeTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryParserReferenceTests-context.xml
- src/test/resources/org/springframework/batch/core/launch/support/launcher-with-environment.xml
- src/test/resources/org/springframework/batch/core/launch/support/launcher-with-locator.xml
- src/test/resources/org/springframework/batch/core/resource/ListPreparedStatementSetterTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/parent-context.xml
- src/test/resources/org/springframework/batch/core/repository/support/SimpleJobRepositoryProxyTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/SplitInterruptedJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCommitIntervalTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepParserCompletionPolicyTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepParserParentAttributeTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopePerformanceTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeProxyTargetClassIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StopAndRestartFailedJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/launch/support/test-environment-with-registry-and-auto-register.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementIllegalAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementIllegalTransactionalAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementSimpleAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementTransactionalAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/FlowStepParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementSkipPolicyParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobStepParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/AutomaticJobRegistrarContextTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/AsyncJobScopeIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringJobScopeForJobElementTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/AutoRegisteringJobScopeForStepElementTests-context.xml
- src/main/resources/baseContext.xml
- src/main/resources/beanRefContext.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementIllegalSkipAndRetryAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementLateBindingParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementRetryPolicyParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ChunkElementSkipAndRetryAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ChunkListenerParsingTests-context.xml
- src/test/resources/META-INF/batch-jobs/contextClosingTests.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionAfterFlow-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionAfterSplit-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionAsFirstStep-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionCustomExitStatus-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionInvalidExitStatus-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionThrowsException-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-decisionValidExitStatus-context.xml
- src/test/resources/META-INF/batch-jobs/DecisionStepTests-restart-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/default-split-task-executor-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/DefaultUnknownJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ExceptionHandlingParsingTests-context.xml
- src/test/resources/META-INF/batch-jobs/FlowParserTests-context.xml
- src/test/resources/META-INF/batch-jobs/FlowParserTestsStepGetsFailedTransitionWhenNextAttributePresent.xml
- src/test/resources/META-INF/batch-jobs/FlowParserTestsStepNoOverrideWhenNextAndFailedTransitionElementExists.xml
- src/test/resources/META-INF/batch-jobs/FlowParserTestsWildcardAndNextAttrJob.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/InlineItemHandlerWithStepScopeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ItemListenerParsingTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/ItemSkipParsingTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/job-context-with-separate-steps.xml
- src/test/resources/org/springframework/batch/core/configuration/support/job-context-with-steps.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobExecutionListenerMethodAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobListenerParsingTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobParserValidatorTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JobPropertySubstitutionTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/JobRegistryIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/JobRepositoryDefaultParserTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/JobScopeDestructionCallbackIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/JobScopeIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/JobScopeNestedIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/JobScopePlaceholderIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/JobScopeProxyTargetClassIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/JobScopeStartupIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/JsrDecisionParsingTests-context.xml
- src/test/resources/META-INF/batch-jobs/JsrSplitParsingTests-context.xml
- src/test/resources/META-INF/batch-jobs/jsrSpringInstanceTests.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/NamespacePrefixedJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/NextAttributeUnknownJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/override_batch.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ParentRetryableLateBindingStepFactoryBeanParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ParentRetryableStepFactoryBeanParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ParentSkippableLateBindingStepFactoryBeanParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ParentSkippableStepFactoryBeanParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/ParentStepFactoryBeanParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithFlowParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithLateBindingParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/PartitionStepWithNonDefaultTransactionManagerParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/placeholder-context.xml
- src/test/resources/org/springframework/batch/core/configuration/support/profiles.xml
- src/test/resources/org/springframework/batch/core/step/RestartInPriorStepTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryListenerTestBase-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryReadListenerExhausted.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryReadListenerListenerException.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/RetryReadListenerRetryOnce.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleItemBasedJobParsingTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/SimpleJobParsingTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/SplitNestedJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerInStepParserTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepListenerMethodAttributeParserTests-context.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/StepListenerParsingTests-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeClassIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTestsInheritence-context.xml
- src/test/resources/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTestsInterface-context.xml
- src/test/resources/org/springframework/batch/core/configuration/annotation/StepScopeConfigurationTestsProxyTargetClass-context.xml
- src/test/resources/org/springframework/batch/core/scope/StepScopeProxyTargetClassOverrideIntegrationTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/StepWithPojoListenerJobParserTests-context.xml
- src/test/resources/org/springframework/batch/core/repository/dao/TablePrefixTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserAdapterTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/TaskletParserBeanPropertiesTests-context.xml
- src/test/resources/org/springframework/batch/core/configuration/xml/TaskletStepAllowStartIfCompleteTest-context.xml
- src/test/resources/org/springframework/batch/core/launch/support/test-environment-with-loader.xml
- src/test/resources/org/springframework/batch/core/configuration/support/trivial-context-autoregister.xml
- src/test/resources/org/springframework/batch/core/jsr/configuration/xml/user-specified-split-task-executor-context.xml
- java:org.springframework.batch.core.configuration.annotation.AbstractBatchConfiguration
- java:org.springframework.batch.core.configuration.annotation.JobBuilderConfigurationTests$AnotherConfiguration
- java:org.springframework.batch.core.jsr.configuration.xml.BatchParserTests$BaseConfiguration
- java:org.springframework.batch.core.configuration.annotation.JobBuilderConfigurationTests$BeansConfigurer
- java:org.springframework.batch.core.explore.support.SimpleJobExplorerIntegrationTests$Config
- java:org.springframework.batch.core.configuration.annotation.DataSourceConfiguration
- java:org.springframework.batch.core.configuration.annotation.JobLoaderConfigurationTests$LoaderFactoryConfiguration
- java:org.springframework.batch.core.configuration.annotation.JobLoaderConfigurationTests$LoaderRegistrarConfiguration
- java:org.springframework.batch.core.configuration.annotation.ModularBatchConfiguration
- java:org.springframework.batch.core.step.builder.RegisterMultiListenerTests$MultiListenerFaultTolerantTestConfiguration
- java:org.springframework.batch.core.step.builder.RegisterMultiListenerTests$MultiListenerTestConfiguration
- java:org.springframework.batch.core.configuration.annotation.SimpleBatchConfiguration
- java:org.springframework.batch.core.configuration.annotation.StepScopeConfigurationTests$StepScopeConfigurationForcingInterfaceProxy
- java:org.springframework.batch.core.configuration.annotation.StepScopeConfigurationTests$StepScopeConfigurationInjectingProxy
- java:org.springframework.batch.core.configuration.annotation.StepScopeConfigurationTests$StepScopeConfigurationRequiringProxyTargetClass
- java:org.springframework.batch.core.configuration.annotation.StepScopeConfigurationTests$StepScopeConfigurationWithDefaults
- java:org.springframework.batch.core.configuration.annotation.JobLoaderConfigurationTests$TestConfiguration
- java:org.springframework.batch.core.configuration.annotation.JobBuilderConfigurationTests$TestConfiguration
- java:org.springframework.batch.core.configuration.annotation.JobBuilderConfigurationTests$TestConfigurer
- java:org.springframework.batch.core.configuration.annotation.JobLoaderConfigurationTests$VanillaConfiguration
- java:org.springframework.batch.core.configuration.annotation.StepScopeConfiguration
-
-
-
-
- true
- false
-
- src/test/resources/org/springframework/batch/core/launch/support/job.xml
- src/test/resources/org/springframework/batch/core/launch/support/test-environment.xml
-
-
-
-
-
-
diff --git a/spring-batch-core/build.gradle b/spring-batch-core/build.gradle
deleted file mode 100644
index 3e7271a2d8..0000000000
--- a/spring-batch-core/build.gradle
+++ /dev/null
@@ -1,45 +0,0 @@
-/**
- * Generate schema creation and drop scripts for various databases
- * supported by Spring Batch.
- *
- * @author David Syer (original Ant/Maven work)
- * @author Chris Beams (port to Gradle)
- */
-task generateSql {
- group = "Build"
- description = "Generates schema creation and drop scripts for supported databases."
-
- configurations { vpp }
- dependencies { vpp 'foundrylogic.vpp:vpp:2.2.1' }
-
- def generatedResourcesDir = new File('src/main/resources/org/springframework/batch/core')
-
- outputs.dir generatedResourcesDir
-
- ant.typedef(resource: 'foundrylogic/vpp/typedef.properties',
- classpath: configurations.vpp.asPath)
- ant.taskdef(resource: 'foundrylogic/vpp/taskdef.properties',
- classpath: configurations.vpp.asPath)
-
- doLast {
- ['db2', 'derby', 'h2', 'hsqldb', 'mysql',
- 'oracle10g', 'postgresql', 'sqlf', 'sqlserver', 'sybase'].each { dbType ->
- ant.vppcopy(todir: generatedResourcesDir, overwrite: 'true') {
- config {
- context {
- property key: 'includes', value: 'src/main/sql'
- property file: "src/main/sql/${dbType}.properties"
- }
- engine {
- property key: 'velocimacro.library', value: "src/main/sql/${dbType}.vpp"
- }
- }
- fileset dir: 'src/main/sql', includes: 'schema*.sql.vpp'
- mapper type: 'glob', from: '*.sql.vpp', to: "*-${dbType}.sql"
- }
- }
- }
-}
-
-// tie schema generation to the build lifecycle
-//compileJava.dependsOn generateSql
diff --git a/spring-batch-core/pom.xml b/spring-batch-core/pom.xml
new file mode 100644
index 0000000000..048a1e24f1
--- /dev/null
+++ b/spring-batch-core/pom.xml
@@ -0,0 +1,415 @@
+
+
+ 4.0.0
+
+ org.springframework.batch
+ spring-batch
+ 6.0.0-SNAPSHOT
+
+ spring-batch-core
+ jar
+ Spring Batch Core
+ Core domain for batch processing, expressing a domain of Jobs, Steps, Chunks, etc
+ https://projects.spring.io/spring-batch
+
+
+ https://github.com/spring-projects/spring-batch
+ git://github.com/spring-projects/spring-batch.git
+ git@github.com:spring-projects/spring-batch.git
+
+
+
+ spring.batch.core
+
+
+
+
+
+ org.springframework.batch
+ spring-batch-infrastructure
+ ${project.parent.version}
+
+
+ org.springframework
+ spring-aop
+ ${spring-framework.version}
+
+
+ org.springframework
+ spring-beans
+ ${spring-framework.version}
+
+
+ org.springframework
+ spring-context
+ ${spring-framework.version}
+
+
+ org.springframework
+ spring-tx
+ ${spring-framework.version}
+
+
+ org.springframework
+ spring-jdbc
+ ${spring-framework.version}
+
+
+ io.micrometer
+ micrometer-core
+ ${micrometer.version}
+
+
+ io.micrometer
+ micrometer-observation
+ ${micrometer.version}
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ ${jackson.version}
+ true
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ ${jackson.version}
+ true
+
+
+ jakarta.annotation
+ jakarta.annotation-api
+ ${jakarta.annotation-api.version}
+ true
+
+
+ org.aspectj
+ aspectjrt
+ ${aspectj.version}
+ true
+
+
+ org.aspectj
+ aspectjweaver
+ ${aspectj.version}
+ true
+
+
+ org.springframework.data
+ spring-data-mongodb
+ ${spring-data-mongodb.version}
+ true
+
+
+ org.slf4j
+ slf4j-api
+
+
+ org.mongodb
+ mongodb-driver-core
+
+
+ org.mongodb
+ mongodb-driver-sync
+
+
+ org.springframework
+ spring-expression
+
+
+ org.springframework.data
+ spring-data-commons
+
+
+
+
+ org.springframework.data
+ spring-data-commons
+ ${spring-data-commons.version}
+ true
+
+
+ org.mongodb
+ mongodb-driver-core
+ ${mongodb-driver.version}
+ true
+
+
+ org.mongodb
+ mongodb-driver-sync
+ ${mongodb-driver.version}
+ true
+
+
+
+
+ org.junit.jupiter
+ junit-jupiter
+ ${junit-jupiter.version}
+ test
+
+
+ org.testcontainers
+ junit-jupiter
+ ${testcontainers.version}
+ test
+
+
+ org.junit.platform
+ junit-platform-launcher
+ ${junit-platform-launcher.version}
+ test
+
+
+ org.hsqldb
+ hsqldb
+ ${hsqldb.version}
+ test
+
+
+ com.mysql
+ mysql-connector-j
+ ${mysql-connector-j.version}
+ test
+
+
+ org.testcontainers
+ mysql
+ ${testcontainers.version}
+ test
+
+
+ org.testcontainers
+ mongodb
+ ${testcontainers.version}
+ test
+
+
+ org.mariadb.jdbc
+ mariadb-java-client
+ ${mariadb-java-client.version}
+ test
+
+
+ org.testcontainers
+ mariadb
+ ${testcontainers.version}
+ test
+
+
+ org.postgresql
+ postgresql
+ ${postgresql.version}
+ test
+
+
+ org.testcontainers
+ postgresql
+ ${testcontainers.version}
+ test
+
+
+ com.ibm.db2
+ jcc
+ ${db2.version}
+ test
+
+
+ org.testcontainers
+ db2
+ ${testcontainers.version}
+ test
+
+
+ org.testcontainers
+ oracle-xe
+ ${testcontainers.version}
+ test
+
+
+ com.oracle.database.jdbc
+ ojdbc10
+ ${oracle.version}
+ test
+
+
+ org.testcontainers
+ mssqlserver
+ ${testcontainers.version}
+ test
+
+
+ com.microsoft.sqlserver
+ mssql-jdbc
+ ${sqlserver.version}
+ test
+
+
+ net.sourceforge.jtds
+ jtds
+ ${jtds.version}
+ test
+
+
+ org.xerial
+ sqlite-jdbc
+ ${sqlite.version}
+ test
+
+
+ org.slf4j
+ slf4j-api
+
+
+
+
+ com.h2database
+ h2
+ ${h2.version}
+ test
+
+
+ org.apache.derby
+ derby
+ ${derby.version}
+ test
+
+
+ org.apache.derby
+ derbytools
+ ${derby.version}
+ test
+
+
+ com.sap.cloud.db.jdbc
+ ngdbc
+ ${hana.version}
+ test
+
+
+ commons-io
+ commons-io
+ ${commons-io.version}
+ test
+
+
+ org.apache.commons
+ commons-dbcp2
+ ${commons-dbcp2.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ ${junit-jupiter.version}
+ test
+
+
+ org.hamcrest
+ hamcrest-library
+ ${hamcrest.version}
+ test
+
+
+ org.springframework
+ spring-test
+ ${spring-framework.version}
+ test
+
+
+ org.slf4j
+ slf4j-simple
+ ${slf4j.version}
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ ${mockito.version}
+ test
+
+
+ org.springframework.ldap
+ spring-ldap-core
+ ${spring-ldap.version}
+ test
+
+
+ org.springframework.ldap
+ spring-ldap-ldif-core
+ ${spring-ldap.version}
+ test
+
+
+ jakarta.xml.bind
+ jakarta.xml.bind-api
+ ${jakarta.xml.bind-api.version}
+ test
+
+
+ com.sun.xml.bind
+ jaxb-core
+ ${jaxb-core.version}
+ test
+
+
+ com.sun.xml.bind
+ jaxb-impl
+ ${jaxb-core.version}
+ test
+
+
+ jakarta.inject
+ jakarta.inject-api
+ ${jakarta.inject-api.version}
+ test
+
+
+ io.micrometer
+ micrometer-test
+ ${micrometer.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter
+
+
+
+
+ io.micrometer
+ micrometer-tracing-integration-test
+ ${micrometer-tracing.version}
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.core
+ jackson-annotations
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-yaml
+
+
+
+
+
+
+ com.google.code.findbugs
+ jsr305
+ ${jsr305.version}
+ provided
+
+
+
+
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java
index ff158edc3f..02f0179845 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/BatchStatus.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2006-2007 the original author or authors.
+ * Copyright 2006-2023 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
+ * https://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,
@@ -17,60 +17,96 @@
package org.springframework.batch.core;
/**
- * Enumeration representing the status of a an Execution.
- *
+ * Enumeration representing the status of an execution.
+ *
* @author Lucas Ward
* @author Dave Syer
* @author Michael Minella
+ * @author Mahmoud Ben Hassine
*/
public enum BatchStatus {
+ /*
+ * The order of the status values is significant because it can be used to aggregate a
+ * set of status values. The result should be the maximum value. Since {@code
+ * COMPLETED} is first in the order, only if all elements of an execution are {@code
+ * COMPLETED} can the aggregate status be COMPLETED. A running execution is expected
+ * to move from {@code STARTING} to {@code STARTED} to {@code COMPLETED} (through the
+ * order defined by {@link #upgradeTo(BatchStatus)}). Higher values than {@code
+ * STARTED} signify more serious failures. {@code ABANDONED} is used for steps that
+ * have finished processing but were not successful and where they should be skipped
+ * on a restart (so {@code FAILED} is the wrong status).
+ */
+
+ /**
+ * The batch job has successfully completed its execution.
+ */
+ COMPLETED,
+ /**
+ * Status of a batch job prior to its execution.
+ */
+ STARTING,
+ /**
+ * Status of a batch job that is running.
+ */
+ STARTED,
+ /**
+ * Status of batch job waiting for a step to complete before stopping the batch job.
+ */
+ STOPPING,
+ /**
+ * Status of a batch job that has been stopped by request.
+ */
+ STOPPED,
/**
- * The order of the status values is significant because it can be used to
- * aggregate a set of status values - the result should be the maximum
- * value. Since COMPLETED is first in the order, only if all elements of an
- * execution are COMPLETED will the aggregate status be COMPLETED. A running
- * execution is expected to move from STARTING to STARTED to COMPLETED
- * (through the order defined by {@link #upgradeTo(BatchStatus)}). Higher
- * values than STARTED signify more serious failure. ABANDONED is used for
- * steps that have finished processing, but were not successful, and where
- * they should be skipped on a restart (so FAILED is the wrong status).
- */
- COMPLETED, STARTING, STARTED, STOPPING, STOPPED, FAILED, ABANDONED, UNKNOWN;
+ * Status of a batch job that has failed during its execution.
+ */
+ FAILED,
+ /**
+ * Status of a batch job that did not stop properly and can not be restarted.
+ */
+ ABANDONED,
+ /**
+ * Status of a batch job that is in an uncertain state.
+ */
+ UNKNOWN;
+ /**
+ * Convenience method to return the higher value status of the statuses passed to the
+ * method.
+ * @param status1 The first status to check.
+ * @param status2 The second status to check.
+ * @return The higher value status of the two statuses.
+ */
public static BatchStatus max(BatchStatus status1, BatchStatus status2) {
return status1.isGreaterThan(status2) ? status1 : status2;
}
/**
- * Convenience method to decide if a status indicates work is in progress.
- *
- * @return true if the status is STARTING, STARTED
+ * Convenience method to decide if a status indicates that work is in progress.
+ * @return true if the status is STARTING, STARTED, STOPPING
*/
public boolean isRunning() {
- return this == STARTING || this == STARTED;
+ return this == STARTING || this == STARTED || this == STOPPING;
}
/**
- * Convenience method to decide if a status indicates execution was
- * unsuccessful.
- *
- * @return true if the status is FAILED or greater
+ * Convenience method to decide if a status indicates execution was unsuccessful.
+ * @return {@code true} if the status is {@code FAILED} or greater.
*/
public boolean isUnsuccessful() {
return this == FAILED || this.isGreaterThan(FAILED);
}
/**
- * Method used to move status values through their logical progression, and
- * override less severe failures with more severe ones. This value is
- * compared with the parameter and the one that has higher priority is
- * returned. If both are STARTED or less than the value returned is the
- * largest in the sequence STARTING, STARTED, COMPLETED. Otherwise the value
- * returned is the maximum of the two.
- *
- * @param other another status to compare to
- * @return either this or the other status depending on their priority
+ * Method used to move status values through their logical progression, and override
+ * less severe failures with more severe ones. This value is compared with the
+ * parameter, and the one that has higher priority is returned. If both are
+ * {@code STARTED} or less than the value returned is the largest in the sequence
+ * {@code STARTING}, {@code STARTED}, {@code COMPLETED}. Otherwise, the value returned
+ * is the maximum of the two.
+ * @param other Another status to which to compare.
+ * @return either this or the other status, depending on their priority.
*/
public BatchStatus upgradeTo(BatchStatus other) {
if (isGreaterThan(STARTED) || other.isGreaterThan(STARTED)) {
@@ -84,59 +120,35 @@ public BatchStatus upgradeTo(BatchStatus other) {
}
/**
- * @param other a status value to compare
- * @return true if this is greater than other
+ * @param other A status value to which to compare.
+ * @return {@code true} if this is greater than {@code other}.
*/
public boolean isGreaterThan(BatchStatus other) {
return this.compareTo(other) > 0;
}
/**
- * @param other a status value to compare
- * @return true if this is less than other
+ * @param other A status value to which to compare.
+ * @return {@code true} if this is less than {@code other}.
*/
public boolean isLessThan(BatchStatus other) {
return this.compareTo(other) < 0;
}
/**
- * @param other a status value to compare
- * @return true if this is less than other
+ * @param other A status value to which to compare.
+ * @return {@code true} if this is less than {@code other}.
*/
public boolean isLessThanOrEqualTo(BatchStatus other) {
return this.compareTo(other) <= 0;
}
/**
- * Converts the current status to the JSR-352 equivalent
- *
- * @return JSR-352 equivalent to the current status
- */
- public javax.batch.runtime.BatchStatus getBatchStatus() {
- if(this == ABANDONED) {
- return javax.batch.runtime.BatchStatus.ABANDONED;
- } else if(this == COMPLETED) {
- return javax.batch.runtime.BatchStatus.COMPLETED;
- } else if(this == STARTED) {
- return javax.batch.runtime.BatchStatus.STARTED;
- } else if(this == STARTING) {
- return javax.batch.runtime.BatchStatus.STARTING;
- } else if(this == STOPPED) {
- return javax.batch.runtime.BatchStatus.STOPPED;
- } else if(this == STOPPING) {
- return javax.batch.runtime.BatchStatus.STOPPING;
- } else {
- return javax.batch.runtime.BatchStatus.FAILED;
- }
- }
-
- /**
- * Find a BatchStatus that matches the beginning of the given value. If no
- * match is found, return COMPLETED as the default because has is low
+ * Find a {@code BatchStatus} that matches the beginning of the given value. If no
+ * match is found, return {@code COMPLETED} as the default because it has low
* precedence.
- *
- * @param value a string representing a status
- * @return a BatchStatus
+ * @param value A string representing a status.
+ * @return a {BatchStatus} object.
*/
public static BatchStatus match(String value) {
for (BatchStatus status : values()) {
@@ -147,4 +159,5 @@ public static BatchStatus match(String value) {
// Default match should be the lowest priority
return COMPLETED;
}
+
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java
deleted file mode 100644
index 8596bd4d37..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/ChunkListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import org.springframework.batch.core.scope.context.ChunkContext;
-
-/**
- * Listener interface for the lifecycle of a chunk. A chunk
- * can be through of as a collection of items that will be
- * committed together.
- *
- * @author Lucas Ward
- * @author Michael Minella
- *
- */
-public interface ChunkListener extends StepListener {
-
- static final String ROLLBACK_EXCEPTION_KEY = "sb_rollback_exception";
-
- /**
- * Callback before the chunk is executed, but inside the transaction.
- *
- * @param context The current {@link ChunkContext}
- */
- void beforeChunk(ChunkContext context);
-
- /**
- * Callback after the chunk is executed, outside the transaction.
- *
- * @param context The current {@link ChunkContext}
- */
- void afterChunk(ChunkContext context);
-
- /**
- * Callback after a chunk has been marked for rollback. It is invoked
- * after transaction rollback. While the rollback will have occurred,
- * transactional resources might still be active and accessible. Due to
- * this, data access code within this callback will still "participate" in
- * the original transaction unless it declares that it run in its own
- * transaction. Hence: Use PROPAGATION_REQUIRES_NEW for any
- * transactional operation that is called from here.
- *
- * @param context the chunk context containing the exception that caused
- * the underlying rollback.
- */
- void afterChunkError(ChunkContext context);
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java
deleted file mode 100644
index bb9920c72a..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/DefaultJobKeyGenerator.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import java.io.UnsupportedEncodingException;
-import java.math.BigInteger;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Default implementation of the {@link JobKeyGenerator} interface.
- * This implementation provides a single hash value based on the JobParameters
- * passed in. Only identifying parameters (per {@link JobParameter#isIdentifying()})
- * are used in the calculation of the key.
- *
- * @author Michael Minella
- * @since 2.2
- */
-public class DefaultJobKeyGenerator implements JobKeyGenerator {
-
- /**
- * Generates the job key to be used based on the {@link JobParameters} instance
- * provided.
- */
- @Override
- public String generateKey(JobParameters source) {
-
- Map props = source.getParameters();
- StringBuilder stringBuffer = new StringBuilder();
- List keys = new ArrayList(props.keySet());
- Collections.sort(keys);
- for (String key : keys) {
- JobParameter jobParameter = props.get(key);
- if(jobParameter.isIdentifying()) {
- String value = jobParameter.getValue()==null ? "" : jobParameter.toString();
- stringBuffer.append(key).append("=").append(value).append(";");
- }
- }
-
- MessageDigest digest;
- try {
- digest = MessageDigest.getInstance("MD5");
- } catch (NoSuchAlgorithmException e) {
- throw new IllegalStateException(
- "MD5 algorithm not available. Fatal (should be in the JDK).");
- }
-
- try {
- byte[] bytes = digest.digest(stringBuffer.toString().getBytes(
- "UTF-8"));
- return String.format("%032x", new BigInteger(1, bytes));
- } catch (UnsupportedEncodingException e) {
- throw new IllegalStateException(
- "UTF-8 encoding not available. Fatal (should be in the JDK).");
- }
- }
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java
index 53cd33e1be..d440c93f2c 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/Entity.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2006-2013 the original author or authors.
+ * Copyright 2006-2025 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
+ * https://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,
@@ -17,120 +17,89 @@
package org.springframework.batch.core;
import java.io.Serializable;
+import java.util.Objects;
+
+import org.jspecify.annotations.Nullable;
import org.springframework.util.ClassUtils;
/**
- * Batch Domain Entity class. Any class that should be uniquely identifiable
- * from another should subclass from Entity. More information on this pattern
- * and the difference between Entities and Value Objects can be found in Domain
- * Driven Design by Eric Evans.
+ * Batch Domain Entity class. Any class that should be uniquely identifiable from another
+ * should subclass from Entity. See Domain Driven Design, by Eric Evans, for more
+ * information on this pattern and the difference between Entities and Value Objects.
*
* @author Lucas Ward
* @author Dave Syer
+ * @author Mahmoud Ben Hassine
*
*/
-@SuppressWarnings("serial")
public class Entity implements Serializable {
- private Long id;
-
- private volatile Integer version;
-
- public Entity() {
- super();
- }
+ private final long id;
- public Entity(Long id) {
- super();
+ private @Nullable Integer version;
- //Commented out because StepExecutions are still created in a disconnected
- //manner. The Repository should create them, then this can be uncommented.
- //Assert.notNull(id, "Entity id must not be null.");
+ /**
+ * The constructor for the {@link Entity} where the ID is established.
+ * @param id The ID for the entity.
+ */
+ public Entity(long id) {
this.id = id;
}
- public Long getId() {
+ /**
+ * @return The ID associated with the {@link Entity}.
+ */
+ public long getId() {
return id;
}
- public void setId(Long id) {
- this.id = id;
- }
-
/**
- * @return the version
+ * @return the version.
*/
- public Integer getVersion() {
+ public @Nullable Integer getVersion() {
return version;
}
/**
- * Public setter for the version needed only by repository methods.
- * @param version the version to set
+ * Public setter for the version. Needed only by repository methods.
+ * @param version The version to set.
*/
public void setVersion(Integer version) {
this.version = version;
}
/**
- * Increment the version number
+ * Increment the version number.
*/
public void incrementVersion() {
if (version == null) {
version = 0;
- } else {
+ }
+ else {
version = version + 1;
}
}
+ /**
+ * Creates a string representation of the {@code Entity}, including the {@code id},
+ * {@code version}, and class name.
+ */
@Override
public String toString() {
return String.format("%s: id=%d, version=%d", ClassUtils.getShortName(getClass()), id, version);
}
- /**
- * Attempt to establish identity based on id if both exist. If either id
- * does not exist use Object.equals().
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
@Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if (other == null) {
- return false;
- }
- if (!(other instanceof Entity)) {
+ public boolean equals(Object o) {
+ if (!(o instanceof Entity entity))
return false;
- }
- Entity entity = (Entity) other;
- if (id == null || entity.getId() == null) {
- return false;
- }
- return id.equals(entity.getId());
+ return id == entity.id;
}
- /**
- * Use ID if it exists to establish hash code, otherwise fall back to
- * Object.hashCode(). Based on the same information as equals, so if that
- * changes, this will. N.B. this follows the contract of Object.hashCode(),
- * but will cause problems for anyone adding an unsaved {@link Entity} to a
- * Set because Set.contains() will almost certainly return false for the
- * {@link Entity} after it is saved. Spring Batch does not store any of its
- * entities in Sets as a matter of course, so internally this is consistent.
- * Clients should not be exposed to unsaved entities.
- *
- * @see java.lang.Object#hashCode()
- */
@Override
public int hashCode() {
- if (id == null) {
- return super.hashCode();
- }
- return 39 + 87 * id.hashCode();
+ return Objects.hashCode(id);
}
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java
index cd5c129671..e03c084b95 100644
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java
+++ b/spring-batch-core/src/main/java/org/springframework/batch/core/ExitStatus.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2006-2014 the original author or authors.
+ * Copyright 2006-2025 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
+ * https://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,
@@ -15,6 +15,7 @@
*/
package org.springframework.batch.core;
+import org.jspecify.annotations.Nullable;
import org.springframework.util.StringUtils;
import java.io.PrintWriter;
@@ -22,29 +23,28 @@
import java.io.StringWriter;
/**
- * Value object used to carry information about the status of a
- * job or step execution.
- *
- * ExitStatus is immutable and therefore thread-safe.
+ * Value object used to carry information about the status of a job or step execution.
+ *
+ * {@code ExitStatus} is immutable and, therefore, thread-safe.
*
* @author Dave Syer
+ * @author Mahmoud Ben Hassine
+ * @author JiWon Seo
*
*/
-@SuppressWarnings("serial")
public class ExitStatus implements Serializable, Comparable {
/**
- * Convenient constant value representing unknown state - assumed not
+ * Convenient constant value representing unknown state - assumed to not be
* continuable.
*/
public static final ExitStatus UNKNOWN = new ExitStatus("UNKNOWN");
/**
- * Convenient constant value representing continuable state where processing
- * is still taking place, so no further action is required. Used for
- * asynchronous execution scenarios where the processing is happening in
- * another thread or process and the caller is not required to wait for the
- * result.
+ * Convenient constant value representing continuable state where processing is still
+ * taking place, so no further action is required. Used for asynchronous execution
+ * scenarios where the processing is happening in another thread or process and the
+ * caller is not required to wait for the result.
*/
public static final ExitStatus EXECUTING = new ExitStatus("EXECUTING");
@@ -54,7 +54,7 @@ public class ExitStatus implements Serializable, Comparable {
public static final ExitStatus COMPLETED = new ExitStatus("COMPLETED");
/**
- * Convenient constant value representing job that did no processing (e.g.
+ * Convenient constant value representing a job that did no processing (for example,
* because it was already complete).
*/
public static final ExitStatus NOOP = new ExitStatus("NOOP");
@@ -65,8 +65,7 @@ public class ExitStatus implements Serializable, Comparable {
public static final ExitStatus FAILED = new ExitStatus("FAILED");
/**
- * Convenient constant value representing finished processing with
- * interrupted status.
+ * Convenient constant value representing finished processing with interrupted status.
*/
public static final ExitStatus STOPPED = new ExitStatus("STOPPED");
@@ -74,10 +73,21 @@ public class ExitStatus implements Serializable, Comparable {
private final String exitDescription;
+ /**
+ * Constructor that accepts the exit code and sets the exit description to an empty
+ * {@link String}.
+ * @param exitCode The exit code to be used for the {@link ExitStatus}.
+ */
public ExitStatus(String exitCode) {
this(exitCode, "");
}
+ /**
+ * Constructor that establishes the exit code and the exit description for the
+ * {@link ExitStatus}.
+ * @param exitCode The exit code to be used for the {@link ExitStatus}.
+ * @param exitDescription The exit description to be used for the {@link ExitStatus}.
+ */
public ExitStatus(String exitCode, String exitDescription) {
super();
this.exitCode = exitCode;
@@ -86,7 +96,6 @@ public ExitStatus(String exitCode, String exitDescription) {
/**
* Getter for the exit code (defaults to blank).
- *
* @return the exit code.
*/
public String getExitCode() {
@@ -95,17 +104,17 @@ public String getExitCode() {
/**
* Getter for the exit description (defaults to blank)
+ * @return {@link String} containing the exit description.
*/
public String getExitDescription() {
return exitDescription;
}
/**
- * Create a new {@link ExitStatus} with a logical combination of the exit
- * code, and a concatenation of the descriptions. If either value has a
- * higher severity then its exit code will be used in the result. In the
- * case of equal severity, the exit code is replaced if the new value is
- * alphabetically greater.
+ * Create a new {@link ExitStatus} with a logical combination of the exit code and a
+ * concatenation of the descriptions. If either value has a higher severity, its exit
+ * code is used in the result. In the case of equal severity, the exit code is
+ * replaced if the new value is alphabetically greater.
*
*
* Severity is defined by the exit code:
@@ -119,11 +128,10 @@ public String getExitDescription() {
*
* Others have severity 7, so custom exit codes always win.
*
- * If the input is null just return this.
- *
- * @param status an {@link ExitStatus} to combine with this one.
- * @return a new {@link ExitStatus} combining the current value and the
- * argument provided.
+ * If the input is {@code null} just return this.
+ * @param status An {@link ExitStatus} object to combine with this one.
+ * @return a new {@link ExitStatus} combining the current value and the argument
+ * provided.
*/
public ExitStatus and(ExitStatus status) {
if (status == null) {
@@ -137,8 +145,9 @@ public ExitStatus and(ExitStatus status) {
}
/**
- * @param status an {@link ExitStatus} to compare
- * @return greater than zero, 0, less than zero according to the severity and exit code
+ * @param status An {@link ExitStatus} to compare
+ * @return greater than zero, 0, or less than zero, according to the severity and exit
+ * code.
* @see java.lang.Comparable
*/
@Override
@@ -153,8 +162,10 @@ public int compareTo(ExitStatus status) {
}
/**
- * @param status
- * @return
+ * Determines severity (an int between 1 and 7, inclusive) based on an
+ * {@code ExitStatus} object.
+ * @param status The {@code ExitStatus} object from which to determine the severity.
+ * @return the severity number.
*/
private int severity(ExitStatus status) {
if (status.exitCode.startsWith(EXECUTING.exitCode)) {
@@ -178,23 +189,18 @@ private int severity(ExitStatus status) {
return 7;
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#toString()
- */
@Override
public String toString() {
return String.format("exitCode=%s;exitDescription=%s", exitCode, exitDescription);
}
/**
- * Compare the fields one by one.
+ * Compare the fields, one by one.
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
- public boolean equals(Object obj) {
+ public boolean equals(@Nullable Object obj) {
if (obj == null) {
return false;
}
@@ -212,12 +218,10 @@ public int hashCode() {
}
/**
- * Add an exit code to an existing {@link ExitStatus}. If there is already a
- * code present tit will be replaced.
- *
- * @param code the code to add
- * @return a new {@link ExitStatus} with the same properties but a new exit
- * code.
+ * Add an exit code to an existing {@link ExitStatus}. If there is already a code
+ * present, it will be replaced.
+ * @param code The code to add.
+ * @return a new {@link ExitStatus} with the same properties but a new exit code.
*/
public ExitStatus replaceExitCode(String code) {
return new ExitStatus(code, exitDescription);
@@ -225,43 +229,40 @@ public ExitStatus replaceExitCode(String code) {
/**
* Check if this status represents a running process.
- *
- * @return true if the exit code is "EXECUTING" or "UNKNOWN"
+ * @return {@code true} if the exit code is {@code EXECUTING} or {@code UNKNOWN}.
*/
public boolean isRunning() {
- return "EXECUTING".equals(this.exitCode) || "UNKNOWN".equals(this.exitCode);
+ return EXECUTING.exitCode.equals(this.exitCode) || UNKNOWN.exitCode.equals(this.exitCode);
}
/**
- * Add an exit description to an existing {@link ExitStatus}. If there is
- * already a description present the two will be concatenated with a
- * semicolon.
- *
- * @param description the description to add
+ * Add an exit description to an existing {@link ExitStatus}. If there is already a
+ * description present, the two are concatenated with a semicolon.
+ * @param description The description to add.
* @return a new {@link ExitStatus} with the same properties but a new exit
- * description
+ * description.
*/
public ExitStatus addExitDescription(String description) {
- StringBuilder buffer = new StringBuilder();
- boolean changed = StringUtils.hasText(description) && !exitDescription.equals(description);
if (StringUtils.hasText(exitDescription)) {
- buffer.append(exitDescription);
- if (changed) {
+ if (StringUtils.hasText(description) && !exitDescription.equals(description)) {
+ StringBuilder buffer = new StringBuilder(description.length() + 2 + exitDescription.length());
+ buffer.append(exitDescription);
buffer.append("; ");
+ buffer.append(description);
+ return new ExitStatus(exitCode, buffer.toString());
}
+ return this;
}
- if (changed) {
- buffer.append(description);
+ else {
+ return new ExitStatus(exitCode, description);
}
- return new ExitStatus(exitCode, buffer.toString());
}
/**
- * Extract the stack trace from the throwable provided and append it to
- * the exist description.
- *
- * @param throwable
- * @return a new ExitStatus with the stack trace appended
+ * Extract the stack trace from the throwable provided and append it to the existing
+ * description.
+ * @param throwable A {@link Throwable} instance containing the stack trace.
+ * @return a new ExitStatus with the stack trace appended.
*/
public ExitStatus addExitDescription(Throwable throwable) {
StringWriter writer = new StringWriter();
@@ -271,16 +272,18 @@ public ExitStatus addExitDescription(Throwable throwable) {
}
/**
- * @param status the exit code to be evaluated
- * @return true if the value matches a known exit code
+ * @param status The {@code ExitStatus} object containing the exit code to be
+ * evaluated.
+ * @return {@code true} if the value matches a known exit code.
*/
public static boolean isNonDefaultExitStatus(ExitStatus status) {
- return status == null || status.getExitCode() == null ||
- status.getExitCode().equals(ExitStatus.COMPLETED.getExitCode()) ||
- status.getExitCode().equals(ExitStatus.EXECUTING.getExitCode()) ||
- status.getExitCode().equals(ExitStatus.FAILED.getExitCode()) ||
- status.getExitCode().equals(ExitStatus.NOOP.getExitCode()) ||
- status.getExitCode().equals(ExitStatus.STOPPED.getExitCode()) ||
- status.getExitCode().equals(ExitStatus.UNKNOWN.getExitCode());
+ return status == null || status.getExitCode() == null
+ || status.getExitCode().equals(ExitStatus.COMPLETED.getExitCode())
+ || status.getExitCode().equals(ExitStatus.EXECUTING.getExitCode())
+ || status.getExitCode().equals(ExitStatus.FAILED.getExitCode())
+ || status.getExitCode().equals(ExitStatus.NOOP.getExitCode())
+ || status.getExitCode().equals(ExitStatus.STOPPED.getExitCode())
+ || status.getExitCode().equals(ExitStatus.UNKNOWN.getExitCode());
}
+
}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java
deleted file mode 100644
index 544ec5e5f8..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemProcessListener.java
+++ /dev/null
@@ -1,55 +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;
-
-import org.springframework.batch.item.ItemProcessor;
-
-/**
- * Listener interface for the processing of an item. Implementations
- * of this interface will be notified before and after an item is
- * passed to the {@link ItemProcessor} and in the event of any
- * exceptions thrown by the processor.
- *
- * @author Dave Syer
- *
- */
-public interface ItemProcessListener extends StepListener {
-
- /**
- * Called before {@link ItemProcessor#process(Object)}.
- *
- * @param item to be processed.
- */
- void beforeProcess(T item);
-
- /**
- * Called after {@link ItemProcessor#process(Object)} returns. If the
- * processor returns null, this method will still be called, with
- * a null result, allowing for notification of 'filtered' items.
- *
- * @param item to be processed
- * @param result of processing
- */
- void afterProcess(T item, S result);
-
- /**
- * Called if an exception was thrown from {@link ItemProcessor#process(Object)}.
- *
- * @param item attempted to be processed
- * @param e - exception thrown during processing.
- */
- void onProcessError(T item, Exception e);
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java
deleted file mode 100644
index 72ff04c874..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemReadListener.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2006-2008 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;
-
-import org.springframework.batch.item.ItemReader;
-import org.springframework.batch.item.ItemWriter;
-
-/**
- * Listener interface around the reading of an item.
- *
- * @author Lucas Ward
- *
- */
-public interface ItemReadListener extends StepListener {
-
- /**
- * Called before {@link ItemReader#read()}
- */
- void beforeRead();
-
- /**
- * Called after {@link ItemReader#read()}
- *
- * @param item returned from read()
- */
- void afterRead(T item);
-
- /**
- * Called if an error occurs while trying to read.
- *
- * @param ex thrown from {@link ItemWriter}
- */
- void onReadError(Exception ex);
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java
deleted file mode 100644
index 7cdb2f772a..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/ItemWriteListener.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import java.util.List;
-
-import org.springframework.batch.core.scope.context.ChunkContext;
-import org.springframework.batch.item.ItemWriter;
-
-/**
- *
- * Listener interface for the writing of items. Implementations
- * of this interface will be notified before, after, and in case
- * of any exception thrown while writing a list of items.
- *
- *
- *
- * Note: This listener is designed to work around the
- * lifecycle of an item. This means that each method should be
- * called once within the lifecycle of an item and in fault
- * tolerant scenarios, any transactional work that is done in
- * one of these methods would be rolled back and not re-applied.
- * Because of this, it is recommended to not perform any logic
- * using this listener that participates in a transaction.
- *
- *
- * @author Lucas Ward
- *
- */
-public interface ItemWriteListener extends StepListener {
-
- /**
- * Called before {@link ItemWriter#write(java.util.List)}
- *
- * @param items to be written
- */
- void beforeWrite(List extends S> items);
-
- /**
- * Called after {@link ItemWriter#write(java.util.List)} This will be
- * called before any transaction is committed, and before
- * {@link ChunkListener#afterChunk(ChunkContext)}
- *
- * @param items written items
- */
- void afterWrite(List extends S> items);
-
- /**
- * Called if an error occurs while trying to write. Will be called inside a
- * transaction, but the transaction will normally be rolled back. There is
- * no way to identify from this callback which of the items (if any) caused
- * the error.
- *
- * @param exception thrown from {@link ItemWriter}
- * @param items attempted to be written.
- */
- void onWriteError(Exception exception, List extends S> items);
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java b/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java
deleted file mode 100644
index f6c5cafaf7..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/Job.java
+++ /dev/null
@@ -1,67 +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;
-
-/**
- * Batch domain object representing a job. Job is an explicit abstraction
- * representing the configuration of a job specified by a developer. It should
- * be noted that restart policy is applied to the job as a whole and not to a
- * step.
- *
- * @author Dave Syer
- *
- */
-public interface Job {
-
- String getName();
-
- /**
- * Flag to indicate if this job can be restarted, at least in principle.
- *
- * @return true if this job can be restarted after a failure
- */
- boolean isRestartable();
-
- /**
- * Run the {@link JobExecution} and update the meta information like status
- * and statistics as necessary. This method should not throw any exceptions
- * for failed execution. Clients should be careful to inspect the
- * {@link JobExecution} status to determine success or failure.
- *
- * @param execution a {@link JobExecution}
- */
- void execute(JobExecution execution);
-
- /**
- * If clients need to generate new parameters for the next execution in a
- * sequence they can use this incrementer. The return value may be null, in
- * the case that this job does not have a natural sequence.
- *
- * @return in incrementer to be used for creating new parameters
- */
- JobParametersIncrementer getJobParametersIncrementer();
-
- /**
- * A validator for the job parameters of a {@link JobExecution}. Clients of
- * a Job may need to validate the parameters for a launch, before or during
- * the execution.
- *
- * @return a validator that can be used to check parameter values (never
- * null)
- */
- JobParametersValidator getJobParametersValidator();
-
-}
\ No newline at end of file
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java
deleted file mode 100644
index 71b3522940..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecution.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import org.springframework.batch.item.ExecutionContext;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-/**
- * Batch domain object representing the execution of a job.
- *
- * @author Lucas Ward
- * @author Michael Minella
- *
- */
-@SuppressWarnings("serial")
-public class JobExecution extends Entity {
-
- private final JobParameters jobParameters;
-
- private JobInstance jobInstance;
-
- private volatile Collection stepExecutions = new CopyOnWriteArraySet();
-
- private volatile BatchStatus status = BatchStatus.STARTING;
-
- private volatile Date startTime = null;
-
- private volatile Date createTime = new Date(System.currentTimeMillis());
-
- private volatile Date endTime = null;
-
- private volatile Date lastUpdated = null;
-
- private volatile ExitStatus exitStatus = ExitStatus.UNKNOWN;
-
- private volatile ExecutionContext executionContext = new ExecutionContext();
-
- private transient volatile List failureExceptions = new CopyOnWriteArrayList();
-
- private final String jobConfigurationName;
-
- public JobExecution(JobExecution original) {
- this.jobParameters = original.getJobParameters();
- this.jobInstance = original.getJobInstance();
- this.stepExecutions = original.getStepExecutions();
- this.status = original.getStatus();
- this.startTime = original.getStartTime();
- this.createTime = original.getCreateTime();
- this.endTime = original.getEndTime();
- this.lastUpdated = original.getLastUpdated();
- this.exitStatus = original.getExitStatus();
- this.executionContext = original.getExecutionContext();
- this.failureExceptions = original.getFailureExceptions();
- this.jobConfigurationName = original.getJobConfigurationName();
- this.setId(original.getId());
- this.setVersion(original.getVersion());
- }
-
- /**
- * Because a JobExecution isn't valid unless the job is set, this
- * constructor is the only valid one from a modeling point of view.
- *
- * @param job the job of which this execution is a part
- */
- public JobExecution(JobInstance job, Long id, JobParameters jobParameters, String jobConfigurationName) {
- super(id);
- this.jobInstance = job;
- this.jobParameters = jobParameters == null ? new JobParameters() : jobParameters;
- this.jobConfigurationName = jobConfigurationName;
- }
-
- public JobExecution(JobInstance job, JobParameters jobParameters, String jobConfigurationName) {
- this(job, null, jobParameters, jobConfigurationName);
- }
-
- public JobExecution(Long id, JobParameters jobParameters, String jobConfigurationName) {
- this(null, id, jobParameters, jobConfigurationName);
- }
-
- /**
- * Constructor for transient (unsaved) instances.
- *
- * @param job the enclosing {@link JobInstance}
- */
- public JobExecution(JobInstance job, JobParameters jobParameters) {
- this(job, null, jobParameters, null);
- }
-
- public JobExecution(Long id, JobParameters jobParameters) {
- this(null, id, jobParameters, null);
- }
-
- public JobExecution(Long id) {
- this(null, id, null, null);
- }
-
- public JobParameters getJobParameters() {
- return this.jobParameters;
- }
-
- public Date getEndTime() {
- return endTime;
- }
-
- public void setJobInstance(JobInstance jobInstance) {
- this.jobInstance = jobInstance;
- }
-
- public void setEndTime(Date endTime) {
- this.endTime = endTime;
- }
-
- public Date getStartTime() {
- return startTime;
- }
-
- public void setStartTime(Date startTime) {
- this.startTime = startTime;
- }
-
- public BatchStatus getStatus() {
- return status;
- }
-
- /**
- * Set the value of the status field.
- *
- * @param status the status to set
- */
- public void setStatus(BatchStatus status) {
- this.status = status;
- }
-
- /**
- * Upgrade the status field if the provided value is greater than the
- * existing one. Clients using this method to set the status can be sure
- * that they don't overwrite a failed status with an successful one.
- *
- * @param status the new status value
- */
- public void upgradeStatus(BatchStatus status) {
- this.status = this.status.upgradeTo(status);
- }
-
- /**
- * Convenience getter for for the id of the enclosing job. Useful for DAO
- * implementations.
- *
- * @return the id of the enclosing job
- */
- public Long getJobId() {
- if (jobInstance != null) {
- return jobInstance.getId();
- }
- return null;
- }
-
- /**
- * @param exitStatus
- */
- public void setExitStatus(ExitStatus exitStatus) {
- this.exitStatus = exitStatus;
- }
-
- /**
- * @return the exitCode
- */
- public ExitStatus getExitStatus() {
- return exitStatus;
- }
-
- /**
- * @return the Job that is executing.
- */
- public JobInstance getJobInstance() {
- return jobInstance;
- }
-
- /**
- * Accessor for the step executions.
- *
- * @return the step executions that were registered
- */
- public Collection getStepExecutions() {
- return Collections.unmodifiableList(new ArrayList(stepExecutions));
- }
-
- /**
- * Register a step execution with the current job execution.
- * @param stepName the name of the step the new execution is associated with
- */
- public StepExecution createStepExecution(String stepName) {
- StepExecution stepExecution = new StepExecution(stepName, this);
- this.stepExecutions.add(stepExecution);
- return stepExecution;
- }
-
- /**
- * Test if this {@link JobExecution} indicates that it is running. It should
- * be noted that this does not necessarily mean that it has been persisted
- * as such yet.
- * @return true if the end time is null
- */
- public boolean isRunning() {
- return endTime == null;
- }
-
- /**
- * Test if this {@link JobExecution} indicates that it has been signalled to
- * stop.
- * @return true if the status is {@link BatchStatus#STOPPING}
- */
- public boolean isStopping() {
- return status == BatchStatus.STOPPING;
- }
-
- /**
- * Signal the {@link JobExecution} to stop. Iterates through the associated
- * {@link StepExecution}s, calling {@link StepExecution#setTerminateOnly()}.
- *
- */
- public void stop() {
- for (StepExecution stepExecution : stepExecutions) {
- stepExecution.setTerminateOnly();
- }
- status = BatchStatus.STOPPING;
- }
-
- /**
- * Sets the {@link ExecutionContext} for this execution
- *
- * @param executionContext the context
- */
- public void setExecutionContext(ExecutionContext executionContext) {
- this.executionContext = executionContext;
- }
-
- /**
- * Returns the {@link ExecutionContext} for this execution. The content is
- * expected to be persisted after each step completion (successful or not).
- *
- * @return the context
- */
- public ExecutionContext getExecutionContext() {
- return executionContext;
- }
-
- /**
- * @return the time when this execution was created.
- */
- public Date getCreateTime() {
- return createTime;
- }
-
- /**
- * @param createTime creation time of this execution.
- */
- public void setCreateTime(Date createTime) {
- this.createTime = createTime;
- }
-
- public String getJobConfigurationName() {
- return this.jobConfigurationName;
- }
-
- /**
- * Package private method for re-constituting the step executions from
- * existing instances.
- * @param stepExecution
- */
- void addStepExecution(StepExecution stepExecution) {
- stepExecutions.add(stepExecution);
- }
-
- /**
- * Get the date representing the last time this JobExecution was updated in
- * the JobRepository.
- *
- * @return Date representing the last time this JobExecution was updated.
- */
- public Date getLastUpdated() {
- return lastUpdated;
- }
-
- /**
- * Set the last time this JobExecution was updated.
- *
- * @param lastUpdated
- */
- public void setLastUpdated(Date lastUpdated) {
- this.lastUpdated = lastUpdated;
- }
-
- public List getFailureExceptions() {
- return failureExceptions;
- }
-
- /**
- * Add the provided throwable to the failure exception list.
- *
- * @param t
- */
- public synchronized void addFailureException(Throwable t) {
- this.failureExceptions.add(t);
- }
-
- /**
- * Return all failure causing exceptions for this JobExecution, including
- * step executions.
- *
- * @return List<Throwable> containing all exceptions causing failure for
- * this JobExecution.
- */
- public synchronized List getAllFailureExceptions() {
-
- Set allExceptions = new HashSet(failureExceptions);
- for (StepExecution stepExecution : stepExecutions) {
- allExceptions.addAll(stepExecution.getFailureExceptions());
- }
-
- return new ArrayList(allExceptions);
- }
-
- /**
- * Deserialize and ensure transient fields are re-instantiated when read
- * back
- */
- private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
- stream.defaultReadObject();
- failureExceptions = new ArrayList();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.springframework.batch.core.domain.Entity#toString()
- */
- @Override
- public String toString() {
- return super.toString()
- + String.format(", startTime=%s, endTime=%s, lastUpdated=%s, status=%s, exitStatus=%s, job=[%s], jobParameters=[%s]",
- startTime, endTime, lastUpdated, status, exitStatus, jobInstance, jobParameters);
- }
-
- /**
- * Add some step executions. For internal use only.
- * @param stepExecutions step executions to add to the current list
- */
- public void addStepExecutions(List stepExecutions) {
- if (stepExecutions!=null) {
- this.stepExecutions.removeAll(stepExecutions);
- this.stepExecutions.addAll(stepExecutions);
- }
- }
-
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java
deleted file mode 100644
index 4e6a46e65f..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionException.java
+++ /dev/null
@@ -1,48 +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;
-
-/**
- * Root of exception hierarchy for checked exceptions in job and step execution.
- * Clients of the {@link Job} should expect to have to catch and deal with these
- * exceptions because they signal a user error, or an inconsistent state between
- * the user's instructions and the data.
- *
- * @author Dave Syer
- *
- */
-@SuppressWarnings("serial")
-public class JobExecutionException extends Exception {
-
- /**
- * Construct a {@link JobExecutionException} with a generic message.
- * @param msg the message
- */
- public JobExecutionException(String msg) {
- super(msg);
- }
-
- /**
- * Construct a {@link JobExecutionException} with a generic message and a
- * cause.
- *
- * @param msg the message
- * @param cause the cause of the exception
- */
- public JobExecutionException(String msg, Throwable cause) {
- super(msg, cause);
- }
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java
deleted file mode 100644
index 1cd2fd2b4a..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobExecutionListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-/**
- * Provide callbacks at specific points in the lifecycle of a {@link Job}.
- * Implementations can be stateful if they are careful to either ensure thread
- * safety, or to use one instance of a listener per job, assuming that job
- * instances themselves are not used by more than one thread.
- *
- * @author Dave Syer
- *
- */
-public interface JobExecutionListener {
-
- /**
- * Callback before a job executes.
- *
- * @param jobExecution the current {@link JobExecution}
- */
- void beforeJob(JobExecution jobExecution);
-
- /**
- * Callback after completion of a job. Called after both both successful and
- * failed executions. To perform logic on a particular status, use
- * "if (jobExecution.getStatus() == BatchStatus.X)".
- *
- * @param jobExecution the current {@link JobExecution}
- */
- void afterJob(JobExecution jobExecution);
-
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java
deleted file mode 100644
index 54f04cb1d7..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInstance.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import org.springframework.util.Assert;
-
-/**
- * Batch domain object representing a uniquely identifiable job run.
- * JobInstance can be restarted multiple times in case of execution failure and
- * it's lifecycle ends with first successful execution.
- *
- * Trying to execute an existing JobIntance that has already completed
- * successfully will result in error. Error will be raised also for an attempt
- * to restart a failed JobInstance if the Job is not restartable.
- *
- * @see Job
- * @see JobParameters
- * @see JobExecution
- * @see javax.batch.runtime.JobInstance
- *
- * @author Lucas Ward
- * @author Dave Syer
- * @author Robert Kasanicky
- * @author Michael Minella
- *
- */
-@SuppressWarnings("serial")
-public class JobInstance extends Entity implements javax.batch.runtime.JobInstance{
-
- private final String jobName;
-
- public JobInstance(Long id, String jobName) {
- super(id);
- Assert.hasLength(jobName);
- this.jobName = jobName;
- }
-
- /**
- * @return the job name. (Equivalent to getJob().getName())
- */
- @Override
- public String getJobName() {
- return jobName;
- }
-
- @Override
- public String toString() {
- return super.toString() + ", Job=[" + jobName + "]";
- }
-
- @Override
- public long getInstanceId() {
- return super.getId();
- }
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java
deleted file mode 100644
index a91f7398e8..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobInterruptedException.java
+++ /dev/null
@@ -1,53 +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;
-
-
-/**
- * Exception to indicate the the job has been interrupted. The exception state
- * indicated is not normally recoverable by batch application clients, but
- * internally it is useful to force a check. The exception will often be wrapped
- * in a runtime exception (usually {@link UnexpectedJobExecutionException} before
- * reaching the client.
- *
- * @author Lucas Ward
- * @author Dave Syer
- *
- */
-@SuppressWarnings("serial")
-public class JobInterruptedException extends JobExecutionException {
-
- private BatchStatus status = BatchStatus.STOPPED;
-
- public JobInterruptedException(String msg) {
- super(msg);
- }
-
- public JobInterruptedException(String msg, BatchStatus status) {
- super(msg);
- this.status = status;
- }
-
- /**
- * The desired status of the surrounding execution after the interruption.
- *
- * @return the status of the interruption (default STOPPED)
- */
- public BatchStatus getStatus() {
- return status;
- }
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java
deleted file mode 100644
index 54e0ba200c..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobKeyGenerator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright 2013-2013 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;
-
-/**
- * Strategy interface for the generation of the key used in identifying
- * unique {@link JobInstance}.
- *
- * @author Michael Minella
- *
- * @param The type of the source data used to calculate the key.
- * @since 2.2
- */
-public interface JobKeyGenerator {
-
- /**
- * Method to generate the unique key used to identify a job instance.
- *
- * @param source Source information used to generate the key
- *
- * @return a unique string identifying the job based on the information
- * supplied
- */
- String generateKey(T source);
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java
deleted file mode 100644
index 8938876741..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameter.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import java.io.Serializable;
-import java.util.Date;
-
-/**
- * Domain representation of a parameter to a batch job. Only the following types
- * can be parameters: String, Long, Date, and Double. The identifying flag is
- * used to indicate if the parameter is to be used as part of the identification of
- * a job instance.
- *
- * @author Lucas Ward
- * @author Dave Syer
- * @author Michael Minella
- * @since 2.0
- *
- */
-@SuppressWarnings("serial")
-public class JobParameter implements Serializable {
-
- private final Object parameter;
-
- private final ParameterType parameterType;
-
- private final boolean identifying;
-
- /**
- * Construct a new JobParameter as a String.
- */
- public JobParameter(String parameter, boolean identifying) {
- this.parameter = parameter;
- parameterType = ParameterType.STRING;
- this.identifying = identifying;
- }
-
- /**
- * Construct a new JobParameter as a Long.
- *
- * @param parameter
- */
- public JobParameter(Long parameter, boolean identifying) {
- this.parameter = parameter;
- parameterType = ParameterType.LONG;
- this.identifying = identifying;
- }
-
- /**
- * Construct a new JobParameter as a Date.
- *
- * @param parameter
- */
- public JobParameter(Date parameter, boolean identifying) {
- this.parameter = parameter;
- parameterType = ParameterType.DATE;
- this.identifying = identifying;
- }
-
- /**
- * Construct a new JobParameter as a Double.
- *
- * @param parameter
- */
- public JobParameter(Double parameter, boolean identifying) {
- this.parameter = parameter;
- parameterType = ParameterType.DOUBLE;
- this.identifying = identifying;
- }
-
-
- /**
- * Construct a new JobParameter as a String.
- */
- public JobParameter(String parameter) {
- this.parameter = parameter;
- parameterType = ParameterType.STRING;
- this.identifying = true;
- }
-
- /**
- * Construct a new JobParameter as a Long.
- *
- * @param parameter
- */
- public JobParameter(Long parameter) {
- this.parameter = parameter;
- parameterType = ParameterType.LONG;
- this.identifying = true;
- }
-
- /**
- * Construct a new JobParameter as a Date.
- *
- * @param parameter
- */
- public JobParameter(Date parameter) {
- this.parameter = parameter;
- parameterType = ParameterType.DATE;
- this.identifying = true;
- }
-
- /**
- * Construct a new JobParameter as a Double.
- *
- * @param parameter
- */
- public JobParameter(Double parameter) {
- this.parameter = parameter;
- parameterType = ParameterType.DOUBLE;
- this.identifying = true;
- }
-
- public boolean isIdentifying() {
- return identifying;
- }
-
- /**
- * @return the value contained within this JobParameter.
- */
- public Object getValue() {
-
- if (parameter != null && parameter.getClass().isInstance(Date.class)) {
- return new Date(((Date) parameter).getTime());
- }
- else {
- return parameter;
- }
- }
-
- /**
- * @return a ParameterType representing the type of this parameter.
- */
- public ParameterType getType() {
- return parameterType;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj instanceof JobParameter == false) {
- return false;
- }
-
- if (this == obj) {
- return true;
- }
-
- JobParameter rhs = (JobParameter) obj;
- return parameter==null ? rhs.parameter==null && parameterType==rhs.parameterType: parameter.equals(rhs.parameter);
- }
-
- @Override
- public String toString() {
- return parameter == null ? null : (parameterType == ParameterType.DATE ? "" + ((Date) parameter).getTime()
- : parameter.toString());
- }
-
- @Override
- public int hashCode() {
- return 7 + 21 * (parameter == null ? parameterType.hashCode() : parameter.hashCode());
- }
-
- /**
- * Enumeration representing the type of a JobParameter.
- */
- public enum ParameterType {
-
- STRING, DATE, LONG, DOUBLE;
- }
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java
deleted file mode 100644
index 5a7231baa3..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParameters.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import java.io.Serializable;
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Value object representing runtime parameters to a batch job. Because the
- * parameters have no individual meaning outside of the JobParameters they are
- * contained within, it is a value object rather than an entity. It is also
- * extremely important that a parameters object can be reliably compared to
- * another for equality, in order to determine if one JobParameters object
- * equals another. Furthermore, because these parameters will need to be
- * persisted, it is vital that the types added are restricted.
- *
- * This class is immutable and therefore thread-safe.
- *
- * @author Lucas Ward
- * @author Michael Minella
- * @since 1.0
- */
-@SuppressWarnings("serial")
-public class JobParameters implements Serializable {
-
- private final Map parameters;
-
- public JobParameters() {
- this.parameters = new LinkedHashMap();
- }
-
- public JobParameters(Map parameters) {
- this.parameters = new LinkedHashMap(parameters);
- }
-
- /**
- * Typesafe Getter for the Long represented by the provided key.
- *
- * @param key The key to get a value for
- * @return The Long value
- */
- public Long getLong(String key){
- if (!parameters.containsKey(key)) {
- return 0L;
- }
- Object value = parameters.get(key).getValue();
- return value==null ? 0L : ((Long)value).longValue();
- }
-
- /**
- * Typesafe Getter for the Long represented by the provided key. If the
- * key does not exist, the default value will be returned.
- *
- * @param key to return the value for
- * @param defaultValue to return if the value doesn't exist
- * @return the parameter represented by the provided key, defaultValue
- * otherwise.
- */
- public Long getLong(String key, long defaultValue){
- if(parameters.containsKey(key)){
- return getLong(key);
- }
- else{
- return defaultValue;
- }
- }
-
- /**
- * Typesafe Getter for the String represented by the provided key.
- *
- * @param key The key to get a value for
- * @return The String value
- */
- public String getString(String key){
- JobParameter value = parameters.get(key);
- return value==null ? null : value.toString();
- }
-
- /**
- * Typesafe Getter for the String represented by the provided key. If the
- * key does not exist, the default value will be returned.
- *
- * @param key to return the value for
- * @param defaultValue to return if the value doesn't exist
- * @return the parameter represented by the provided key, defaultValue
- * otherwise.
- */
- public String getString(String key, String defaultValue){
- if(parameters.containsKey(key)){
- return getString(key);
- }
- else{
- return defaultValue;
- }
- }
-
- /**
- * Typesafe Getter for the Long represented by the provided key.
- *
- * @param key The key to get a value for
- * @return The Double value
- */
- public Double getDouble(String key){
- if (!parameters.containsKey(key)) {
- return 0.0;
- }
- Double value = (Double)parameters.get(key).getValue();
- return value==null ? 0.0 : value.doubleValue();
- }
-
- /**
- * Typesafe Getter for the Double represented by the provided key. If the
- * key does not exist, the default value will be returned.
- *
- * @param key to return the value for
- * @param defaultValue to return if the value doesn't exist
- * @return the parameter represented by the provided key, defaultValue
- * otherwise.
- */
- public Double getDouble(String key, double defaultValue){
- if(parameters.containsKey(key)){
- return getDouble(key);
- }
- else{
- return defaultValue;
- }
- }
-
- /**
- * Typesafe Getter for the Date represented by the provided key.
- *
- * @param key The key to get a value for
- * @return The java.util.Date value
- */
- public Date getDate(String key){
- return this.getDate(key,null);
- }
-
- /**
- * Typesafe Getter for the Date represented by the provided key. If the
- * key does not exist, the default value will be returned.
- *
- * @param key to return the value for
- * @param defaultValue to return if the value doesn't exist
- * @return the parameter represented by the provided key, defaultValue
- * otherwise.
- */
- public Date getDate(String key, Date defaultValue){
- if(parameters.containsKey(key)){
- return (Date)parameters.get(key).getValue();
- }
- else{
- return defaultValue;
- }
- }
-
- /**
- * Get a map of all parameters, including string, long, and date.
- *
- * @return an unmodifiable map containing all parameters.
- */
- public Map getParameters(){
- return new LinkedHashMap(parameters);
- }
-
- /**
- * @return true if the parameters is empty, false otherwise.
- */
- public boolean isEmpty(){
- return parameters.isEmpty();
- }
-
- @Override
- public boolean equals(Object obj) {
- if(obj instanceof JobParameters == false){
- return false;
- }
-
- if(obj == this){
- return true;
- }
-
- JobParameters rhs = (JobParameters)obj;
- return this.parameters.equals(rhs.parameters);
- }
-
- @Override
- public int hashCode() {
- return 17 + 23 * parameters.hashCode();
- }
-
- @Override
- public String toString() {
- return parameters.toString();
- }
-
- public Properties toProperties() {
- Properties props = new Properties();
-
- for (Map.Entry param : parameters.entrySet()) {
- if(param.getValue() != null) {
- props.put(param.getKey(), param.getValue().toString());
- }
- }
-
- return props;
- }
-}
diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java b/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java
deleted file mode 100644
index bedee3b52e..0000000000
--- a/spring-batch-core/src/main/java/org/springframework/batch/core/JobParametersBuilder.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright 2006-2013 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;
-
-import org.springframework.util.Assert;
-
-import java.util.Date;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * Helper class for creating {@link JobParameters}. Useful because all
- * {@link JobParameter} objects are immutable, and must be instantiated separately
- * to ensure typesafety. Once created, it can be used in the
- * same was a java.lang.StringBuilder (except, order is irrelevant), by adding
- * various parameter types and creating a valid {@link JobParameters} once
- * finished.
- *
- * Using the identifying flag indicates if the parameter will be used
- * in the identification of a JobInstance. That flag defaults to true.
- *
- * @author Lucas Ward
- * @author Michael Minella
- * @since 1.0
- * @see JobParameters
- * @see JobParameter
- */
-public class JobParametersBuilder {
-
- private final Map parameterMap;
-
- /**
- * Default constructor. Initializes the builder with empty parameters.
- */
- public JobParametersBuilder() {
-
- this.parameterMap = new LinkedHashMap();
- }
-
- /**
- * Copy constructor. Initializes the builder with the supplied parameters.
- */
- public JobParametersBuilder(JobParameters jobParameters) {
- this.parameterMap = new LinkedHashMap(jobParameters.getParameters());
- }
-
- /**
- * Constructor to add conversion capabilities to support JSR-352. Per the spec, it is expected that all
- * keys and values in the provided {@link Properties} instance are Strings
- *
- * @param properties the job parameters to be used
- */
- public JobParametersBuilder(Properties properties) {
- this.parameterMap = new LinkedHashMap();
-
- if(properties != null) {
- for (Map.Entry