├── .editorconfig
├── .gitattributes
├── .github
└── workflows
│ ├── 0.x.x_build.yml
│ ├── build.yml
│ └── deploy.yml
├── .gitignore
├── CHANGELOG.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── RELEASE_PROCESS.md
├── build.gradle.kts
├── buildSrc
├── build.gradle.kts
├── config
│ ├── naver-checkstyle-rules.xml
│ ├── naver-checkstyle-suppressions.xml
│ └── naver-intellij-formatter.xml
└── src
│ └── main
│ └── kotlin
│ ├── spring.batch.plus.coverage-all-conventions.gradle.kts
│ ├── spring.batch.plus.java-library-conventions.gradle.kts
│ ├── spring.batch.plus.kotlin-conventions.gradle.kts
│ └── spring.batch.plus.maven-publish-conventions.gradle.kts
├── doc
├── en
│ ├── README.md
│ ├── configuration
│ │ └── kotlin-dsl
│ │ │ ├── README.md
│ │ │ ├── flow
│ │ │ └── README.md
│ │ │ ├── job
│ │ │ ├── README.md
│ │ │ ├── job-configuration.md
│ │ │ ├── job-flow-decider.md
│ │ │ ├── job-flow-flow.md
│ │ │ ├── job-flow-step.md
│ │ │ ├── job-flow-transition.md
│ │ │ └── job-split.md
│ │ │ └── step
│ │ │ ├── README.md
│ │ │ ├── chunk-oriented-step.md
│ │ │ ├── flow-step.md
│ │ │ ├── job-step.md
│ │ │ ├── partition-step.md
│ │ │ ├── step-configuration.md
│ │ │ └── tasklet-step.md
│ ├── job
│ │ ├── clear-run-id-incrementer.md
│ │ └── delete-metadata-job.md
│ └── step
│ │ ├── item-stream-flux-reader-processor-writer.md
│ │ ├── item-stream-iterable-reader-processor-writer.md
│ │ ├── item-stream-iterator-reader-processor-writer.md
│ │ └── item-stream-simple-reader-processor-writer.md
└── ko
│ ├── README.md
│ ├── configuration
│ └── kotlin-dsl
│ │ ├── README.md
│ │ ├── flow
│ │ └── README.md
│ │ ├── job
│ │ ├── README.md
│ │ ├── job-configuration.md
│ │ ├── job-flow-decider.md
│ │ ├── job-flow-flow.md
│ │ ├── job-flow-step.md
│ │ ├── job-flow-transition.md
│ │ └── job-split.md
│ │ └── step
│ │ ├── README.md
│ │ ├── chunk-oriented-step.md
│ │ ├── flow-step.md
│ │ ├── job-step.md
│ │ ├── partition-step.md
│ │ ├── step-configuration.md
│ │ └── tasklet-step.md
│ ├── job
│ ├── clear-run-id-incrementer.md
│ └── delete-metadata-job.md
│ └── step
│ ├── item-stream-flux-reader-processor-writer.md
│ ├── item-stream-iterable-reader-processor-writer.md
│ ├── item-stream-iterator-reader-processor-writer.md
│ └── item-stream-simple-reader-processor-writer.md
├── gradle.properties
├── gradle
├── libs.versions.toml
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle.kts
├── spring-batch-plus-kotlin
├── README.md
├── build.gradle.kts
└── src
│ ├── integrationTest
│ ├── kotlin
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── kotlin
│ │ │ └── configuration
│ │ │ ├── ConcreteFlowBuilderDslIntegrationTest.kt
│ │ │ ├── DeciderTransitionBuilderDslIntegrationTest.kt
│ │ │ ├── FlowJobBuilderDslIntegrationTest.kt
│ │ │ ├── FlowTransitionBuilderDslIntegrationTest.kt
│ │ │ ├── SimpleJobBuilderDslIntegrationTest.kt
│ │ │ ├── SplitBuilderDslIntegrationTest.kt
│ │ │ ├── StepBuilderDslIntegrationTest.kt
│ │ │ ├── StepTransitionBuilderDslIntegrationTest.kt
│ │ │ └── TransitionBuilderDslIntegrationTest.kt
│ └── resources
│ │ └── log4j2-test.xml
│ ├── main
│ └── kotlin
│ │ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── batch
│ │ └── plus
│ │ └── kotlin
│ │ ├── configuration
│ │ ├── BatchDsl.kt
│ │ ├── ConcreteFlowBuilderDsl.kt
│ │ ├── DeciderTransitionBuilderDsl.kt
│ │ ├── FlowBuilderDsl.kt
│ │ ├── FlowJobBuilderDsl.kt
│ │ ├── FlowTransitionBuilderDsl.kt
│ │ ├── JobBuilderDsl.kt
│ │ ├── SimpleJobBuilderDsl.kt
│ │ ├── SimpleJobBuilderDslAdapter.kt
│ │ ├── SplitBuilderDsl.kt
│ │ ├── StepBuilderDsl.kt
│ │ ├── StepTransitionBuilderDsl.kt
│ │ ├── TransitionBuilderDsl.kt
│ │ ├── step
│ │ │ ├── FlowStepBuilderDsl.kt
│ │ │ ├── JobStepBuilderDsl.kt
│ │ │ ├── PartitionStepBuilderDsl.kt
│ │ │ ├── SimpleStepBuilderDsl.kt
│ │ │ └── TaskletStepBuilderDsl.kt
│ │ └── support
│ │ │ ├── BatchDslMarker.kt
│ │ │ ├── DslContext.kt
│ │ │ └── LazyConfigurer.kt
│ │ ├── item
│ │ └── adapter
│ │ │ └── ItemDelegates.kt
│ │ └── step
│ │ └── adapter
│ │ └── ItemDelegates.kt
│ └── test
│ ├── kotlin
│ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── batch
│ │ └── plus
│ │ └── kotlin
│ │ ├── configuration
│ │ ├── JobBuilderDslHelperTest.kt
│ │ ├── SimpleJobBuilderDslAdapterTest.kt
│ │ ├── StepBuilderDslHelperTest.kt
│ │ ├── step
│ │ │ ├── FaultTolerantStepBuilderDslTest.kt
│ │ │ ├── FlowStepBuilderDslTest.kt
│ │ │ ├── JobStepBuilderDslTest.kt
│ │ │ ├── PartitionStepBuilderDslTest.kt
│ │ │ ├── SimpleStepBuilderDslTest.kt
│ │ │ └── TaskletStepBuilderDslTest.kt
│ │ └── support
│ │ │ └── LazyConfigurerTest.kt
│ │ ├── item
│ │ └── adapter
│ │ │ └── ItemDelegatesTest.kt
│ │ └── step
│ │ └── adapter
│ │ └── ItemDelegatesTest.kt
│ └── resources
│ └── log4j2-test.xml
├── spring-batch-plus-sample
├── clear-run-id-incrementer-kotlin-sample
│ ├── build.gradle.kts
│ └── src
│ │ └── test
│ │ ├── kotlin
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── sample
│ │ │ ├── clear
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ └── clearwithid
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ └── resources
│ │ └── application.yml
├── clear-run-id-incrementer-sample
│ ├── build.gradle.kts
│ └── src
│ │ └── test
│ │ ├── java
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── sample
│ │ │ ├── clear
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── clearwithid
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ └── comparison
│ │ │ ├── bad
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ └── good
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ └── resources
│ │ └── application.yml
├── delete-meta-data-job-kotlin-sample
│ ├── build.gradle.kts
│ └── src
│ │ └── test
│ │ ├── kotlin
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── sample
│ │ │ └── deletemedadata
│ │ │ ├── customdryrun
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── dryrun
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── formatter
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── jobname
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── parametername
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── plain
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── prefix
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ └── prefixfromvariable
│ │ │ ├── JdbcConfig.kt
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ └── resources
│ │ ├── application.yml
│ │ └── sql
│ │ └── schema-h2-custom.sql
├── delete-meta-data-job-sample
│ ├── build.gradle.kts
│ └── src
│ │ └── test
│ │ ├── java
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── sample
│ │ │ └── deletemetadata
│ │ │ ├── customdryrun
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── dryrun
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── formatter
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── jobname
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── parametername
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── plain
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ ├── prefix
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ │ └── prefixfromvariable
│ │ │ ├── JdbcConfig.java
│ │ │ ├── SampleApplicationTest.java
│ │ │ └── TestJobConfig.java
│ │ └── resources
│ │ ├── application.yml
│ │ └── sql
│ │ └── schema-h2-custom.sql
├── kotlin-dsl-sample
│ ├── build.gradle.kts
│ └── src
│ │ └── test
│ │ ├── kotlin
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── sample
│ │ │ ├── comparison
│ │ │ ├── after
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── before
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── flow
│ │ │ └── creation
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── job
│ │ │ ├── configuration
│ │ │ │ ├── incrementer
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── listenerannotation
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── listenerobject
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── meterregistry
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── observationconvention
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── observationregistry
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── preventrestart
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── validator
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ ├── creation
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── flow
│ │ │ │ ├── decider
│ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ ├── TestDecider.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── variable
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── flow
│ │ │ │ │ ├── plain
│ │ │ │ │ │ ├── bean
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ ├── init
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ └── variable
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── transition
│ │ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ ├── init
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ └── variable
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── step
│ │ │ │ │ ├── comparison
│ │ │ │ │ │ ├── after
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ └── before
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── plain
│ │ │ │ │ │ ├── bean
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ ├── init
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ └── variable
│ │ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── transition
│ │ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ ├── init
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ │ └── variable
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── transition
│ │ │ │ │ ├── decider
│ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── variable
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── finish
│ │ │ │ │ ├── end
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── fail
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── stop
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── flow
│ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── init
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── nested
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── variable
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── step
│ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── init
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── nested
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── variable
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── stopandrestart
│ │ │ │ │ ├── decider
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── flow
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── step
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ └── split
│ │ │ │ ├── bean
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── init
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── variable
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── step
│ │ │ ├── chunkorientedstep
│ │ │ ├── chunkpolicy
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── chunksize
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── config
│ │ │ │ ├── annotationlistener
│ │ │ │ │ ├── chunklistener
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── mixed
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── processorlistener
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ ├── readerlistener
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ │ └── writerlistener
│ │ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── chunklistener
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── exceptionhandler
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── executor
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── processorlistener
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── readerlistener
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── stepoperation
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── stream
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── transactionattribute
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── writerlistener
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ ├── faulttolerant
│ │ │ │ ├── backoffpolicy
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── keygenerator
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── noretry
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── noskip
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── processornontx
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── retry
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── retrycontextcache
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── retrylistener
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── retrypolicy
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── rollback
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── skip
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── skiplistener
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ ├── skiplistenerannotation
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── skippolicy
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ └── repeatoperation
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── configuration
│ │ │ ├── allowstartifcomplete
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── listenerannotation
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── listenerobject
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── meterregistry
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── observationconvention
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── observationregistry
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── startlimit
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── creation
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── flowstep
│ │ │ ├── bean
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── init
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── variable
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── jobstep
│ │ │ ├── bean
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── config
│ │ │ │ ├── extractor
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── launcher
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ └── variable
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── partitionstep
│ │ │ ├── aggregator
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── partitionhandler
│ │ │ │ ├── direct
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── inner
│ │ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ │ └── TestJobConfig.kt
│ │ │ └── splitter
│ │ │ │ ├── direct
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ │ └── inner
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── taskletstep
│ │ │ ├── bean
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── config
│ │ │ ├── exceptionhandler
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── executor
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── listenerannotation
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── listenerobject
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── stepoperation
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── stream
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── transactionattribute
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── variable
│ │ │ ├── SampleApplicationTest.kt
│ │ │ └── TestJobConfig.kt
│ │ └── resources
│ │ └── application.yml
├── single-class-reader-processor-writer-kotlin-sample
│ ├── build.gradle.kts
│ └── src
│ │ └── test
│ │ ├── kotlin
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ └── sample
│ │ │ ├── flux
│ │ │ ├── callback
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessor
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessorwriter
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── readerwriter
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── iterable
│ │ │ ├── callback
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessor
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessorwriter
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── readerwriter
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── iterator
│ │ │ ├── callback
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessor
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessorwriter
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── readerwriter
│ │ │ │ ├── SampleApplicationTest.kt
│ │ │ │ ├── SampleTasklet.kt
│ │ │ │ └── TestJobConfig.kt
│ │ │ └── simple
│ │ │ ├── callback
│ │ │ ├── SampleApplicationTest.kt
│ │ │ ├── SampleTasklet.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessor
│ │ │ ├── SampleApplicationTest.kt
│ │ │ ├── SampleTasklet.kt
│ │ │ └── TestJobConfig.kt
│ │ │ ├── readerprocessorwriter
│ │ │ ├── SampleApplicationTest.kt
│ │ │ ├── SampleTasklet.kt
│ │ │ └── TestJobConfig.kt
│ │ │ └── readerwriter
│ │ │ ├── SampleApplicationTest.kt
│ │ │ ├── SampleTasklet.kt
│ │ │ └── TestJobConfig.kt
│ │ └── resources
│ │ └── application.yml
└── single-class-reader-processor-writer-sample
│ ├── build.gradle.kts
│ └── src
│ └── test
│ ├── java
│ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── batch
│ │ └── plus
│ │ └── sample
│ │ ├── flux
│ │ ├── callback
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── readerprocessor
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── readerprocessorwriter
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ └── readerwriter
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── iterable
│ │ ├── callback
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── readerprocessor
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── readerprocessorwriter
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ └── readerwriter
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── iterator
│ │ ├── callback
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── readerprocessor
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ ├── readerprocessorwriter
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ └── readerwriter
│ │ │ ├── SampleApplicationTest.java
│ │ │ ├── SampleTasklet.java
│ │ │ └── TestJobConfig.java
│ │ └── simple
│ │ ├── callback
│ │ ├── SampleApplicationTest.java
│ │ ├── SampleTasklet.java
│ │ └── TestJobConfig.java
│ │ ├── readerprocessor
│ │ ├── SampleApplicationTest.java
│ │ ├── SampleTasklet.java
│ │ └── TestJobConfig.java
│ │ ├── readerprocessorwriter
│ │ ├── SampleApplicationTest.java
│ │ ├── SampleTasklet.java
│ │ └── TestJobConfig.java
│ │ └── readerwriter
│ │ ├── SampleApplicationTest.java
│ │ ├── SampleTasklet.java
│ │ └── TestJobConfig.java
│ └── resources
│ └── application.yml
├── spring-batch-plus
├── README.md
├── build.gradle.kts
└── src
│ ├── integrationTest
│ ├── java
│ │ └── com
│ │ │ └── navercorp
│ │ │ └── spring
│ │ │ └── batch
│ │ │ └── plus
│ │ │ ├── item
│ │ │ └── adapter
│ │ │ │ ├── ItemStreamReaderProcessorWriterIntegrationTest.java
│ │ │ │ └── ItemStreamReaderWriterIntegrationTest.java
│ │ │ └── step
│ │ │ └── adapter
│ │ │ ├── ItemStreamFluxReaderProcessorIT.java
│ │ │ ├── ItemStreamFluxReaderProcessorWriterIT.java
│ │ │ ├── ItemStreamFluxReaderWriterIT.java
│ │ │ ├── ItemStreamIterableReaderProcessorIT.java
│ │ │ ├── ItemStreamIterableReaderProcessorWriterIT.java
│ │ │ ├── ItemStreamIterableReaderWriterIT.java
│ │ │ ├── ItemStreamIteratorReaderProcessorIT.java
│ │ │ ├── ItemStreamIteratorReaderProcessorWriterIT.java
│ │ │ ├── ItemStreamIteratorReaderWriterIT.java
│ │ │ ├── ItemStreamSimpleReaderProcessorIT.java
│ │ │ ├── ItemStreamSimpleReaderProcessorWriterIT.java
│ │ │ └── ItemStreamSimpleReaderWriterIT.java
│ └── resources
│ │ └── log4j2-test.xml
│ ├── main
│ └── java
│ │ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── batch
│ │ └── plus
│ │ ├── item
│ │ └── adapter
│ │ │ ├── AdapterFactory.java
│ │ │ ├── ItemProcessorAdapter.java
│ │ │ ├── ItemProcessorDelegate.java
│ │ │ ├── ItemStreamReaderAdapter.java
│ │ │ ├── ItemStreamReaderDelegate.java
│ │ │ ├── ItemStreamReaderProcessorWriter.java
│ │ │ ├── ItemStreamReaderWriter.java
│ │ │ ├── ItemStreamWriterAdapter.java
│ │ │ ├── ItemStreamWriterDelegate.java
│ │ │ ├── StepScopeItemStreamReader.java
│ │ │ └── package-info.java
│ │ ├── job
│ │ ├── ClearRunIdIncrementer.java
│ │ ├── metadata
│ │ │ ├── CheckMaxJobInstanceIdToDeleteTasklet.java
│ │ │ ├── DeleteMetadataJobBuilder.java
│ │ │ ├── DeleteMetadataTasklet.java
│ │ │ ├── JobMetadataDao.java
│ │ │ ├── MetadataSql.java
│ │ │ └── package-info.java
│ │ └── package-info.java
│ │ └── step
│ │ └── adapter
│ │ ├── AdapterFactory.java
│ │ ├── ItemProcessorAdapter.java
│ │ ├── ItemProcessorDelegate.java
│ │ ├── ItemStreamFluxReaderAdapter.java
│ │ ├── ItemStreamFluxReaderDelegate.java
│ │ ├── ItemStreamFluxReaderProcessor.java
│ │ ├── ItemStreamFluxReaderProcessorWriter.java
│ │ ├── ItemStreamFluxReaderWriter.java
│ │ ├── ItemStreamIterableReaderAdapter.java
│ │ ├── ItemStreamIterableReaderDelegate.java
│ │ ├── ItemStreamIterableReaderProcessor.java
│ │ ├── ItemStreamIterableReaderProcessorWriter.java
│ │ ├── ItemStreamIterableReaderWriter.java
│ │ ├── ItemStreamIteratorReaderAdapter.java
│ │ ├── ItemStreamIteratorReaderDelegate.java
│ │ ├── ItemStreamIteratorReaderProcessor.java
│ │ ├── ItemStreamIteratorReaderProcessorWriter.java
│ │ ├── ItemStreamIteratorReaderWriter.java
│ │ ├── ItemStreamSimpleReaderAdapter.java
│ │ ├── ItemStreamSimpleReaderDelegate.java
│ │ ├── ItemStreamSimpleReaderProcessor.java
│ │ ├── ItemStreamSimpleReaderProcessorWriter.java
│ │ ├── ItemStreamSimpleReaderWriter.java
│ │ ├── ItemStreamWriterAdapter.java
│ │ ├── ItemStreamWriterDelegate.java
│ │ ├── StepScopeItemStreamReader.java
│ │ └── package-info.java
│ └── test
│ ├── java
│ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── batch
│ │ └── plus
│ │ ├── item
│ │ └── adapter
│ │ │ ├── AdapterFactoryTest.java
│ │ │ ├── ItemProcessorAdapterTest.java
│ │ │ ├── ItemStreamReaderAdapterTest.java
│ │ │ ├── ItemStreamWriterAdapterTest.java
│ │ │ └── StepScopeItemStreamReaderTest.java
│ │ ├── job
│ │ ├── ClearRunIdIncrementerTest.java
│ │ └── metadata
│ │ │ ├── CheckMaxJobInstanceIdToDeleteTaskletTest.java
│ │ │ ├── DeleteMetadataJobBuilderTest.java
│ │ │ ├── DeleteMetadataJobTest.java
│ │ │ ├── DeleteMetadataTaskletTest.java
│ │ │ ├── JobMetadataCountDao.java
│ │ │ ├── JobMetadataDaoTest.java
│ │ │ ├── MetadataTestSupports.java
│ │ │ └── TestJobRepositoryConfig.java
│ │ └── step
│ │ └── adapter
│ │ ├── AdapterFactoryTest.java
│ │ ├── ItemProcessorAdapterTest.java
│ │ ├── ItemStreamFluxReaderAdapterTest.java
│ │ ├── ItemStreamIterableReaderAdapterTest.java
│ │ ├── ItemStreamIteratorReaderAdapterTest.java
│ │ ├── ItemStreamSimpleReaderAdapterTest.java
│ │ ├── ItemStreamWriterAdapterTest.java
│ │ └── StepScopeItemStreamReaderTest.java
│ └── resources
│ └── log4j2-test.xml
├── spring-boot-autoconfigure-batch-plus-kotlin
├── README.md
├── build.gradle.kts
└── src
│ ├── integrationTest
│ └── kotlin
│ │ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── boot
│ │ └── autoconfigure
│ │ └── batch
│ │ └── plus
│ │ └── kotlin
│ │ └── BatchPlusAutoConfigurationIT.kt
│ └── main
│ ├── kotlin
│ └── com
│ │ └── navercorp
│ │ └── spring
│ │ └── boot
│ │ └── autoconfigure
│ │ └── batch
│ │ └── plus
│ │ └── kotlin
│ │ └── BatchPlusAutoConfiguration.kt
│ └── resources
│ └── META-INF
│ └── spring
│ └── org.springframework.boot.autoconfigure.AutoConfiguration.imports
├── spring-boot-autoconfigure-batch-plus
├── README.md
└── build.gradle.kts
├── spring-boot-starter-batch-plus-kotlin
├── README.md
└── build.gradle.kts
└── spring-boot-starter-batch-plus
├── README.md
└── build.gradle.kts
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | [*]
5 | # [encoding-utf8]
6 | charset = utf-8
7 |
8 | # [newline-lf]
9 | end_of_line = lf
10 |
11 | # [newline-eof]
12 | insert_final_newline = true
13 |
14 | [*.bat]
15 | end_of_line = crlf
16 |
17 | [{*.kt, *.kts}]
18 | # [indentation-tab]
19 | indent_style = space
20 | # [allow-trailing-comma]
21 | ij_kotlin_allow_trailing_comma = true
22 | ij_kotlin_allow_trailing_comma_on_call_site = true
23 | # [disable-star-import]
24 | ij_kotlin_name_count_to_use_star_import = 2147483647
25 | ij_kotlin_name_count_to_use_star_import_for_members = 2147483647
26 |
27 | # [4-spaces-tab]
28 | indent_size = 4
29 | tab_width = 4
30 |
31 | # [no-trailing-spaces]
32 | trim_trailing_whitespace = true
33 |
34 | [*.java]
35 | # [indentation-tab]
36 | indent_style = tab
37 |
38 | # [4-spaces-tab]
39 | indent_size = 4
40 | tab_width = 4
41 |
42 | # [no-trailing-spaces]
43 | trim_trailing_whitespace = true
44 |
45 | [*.md]
46 | # [indentation-tab]
47 | indent_style = space
48 |
49 | # [4-spaces-tab]
50 | indent_size = 4
51 | tab_width = 4
52 |
53 | # [no-trailing-spaces]
54 | trim_trailing_whitespace = true
55 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | #
2 | # https://help.github.com/articles/dealing-with-line-endings/
3 | #
4 | # These are explicitly windows files and should use crlf
5 | *.bat text eol=crlf
6 |
7 |
--------------------------------------------------------------------------------
/.github/workflows/0.x.x_build.yml:
--------------------------------------------------------------------------------
1 | name: 0.x.x Build
2 |
3 | on:
4 | push:
5 | branches: [ '0.[0-9]+.x' ]
6 | pull_request:
7 | branches: [ '0.[0-9]+.x' ]
8 | workflow_dispatch:
9 | inputs:
10 | commit_id:
11 | description: 'Git commit id'
12 | required: true
13 |
14 | jobs:
15 | build:
16 | name: Gradle build on JDK ${{ matrix.java-version }}
17 | runs-on: ubuntu-latest
18 | strategy:
19 | matrix:
20 | java-version: [ '8', '11', '17', '21' ]
21 |
22 | steps:
23 | - name: Setup Commit ID
24 | run: |
25 | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
26 | echo "COMMIT_ID=${{ github.event.inputs.commit_id }}" >> ${GITHUB_ENV}
27 | else
28 | echo "COMMIT_ID=${{ github.sha }}" >> ${GITHUB_ENV}
29 | fi
30 |
31 | - name: Checkout
32 | uses: actions/checkout@v3
33 | with:
34 | ref: ${{ env.COMMIT_ID }}
35 | fetch-depth: 0
36 |
37 | - name: Setup JDK
38 | uses: actions/setup-java@v4
39 | with:
40 | distribution: 'temurin'
41 | java-version: ${{ matrix.java-version }}
42 | cache: 'gradle'
43 |
44 | - name: Run check
45 | run: ./gradlew clean build
46 |
47 | - name: Check coverage
48 | run: ./gradlew koverMergedVerify
49 |
50 | - name: Merge coverage reports
51 | run: ./gradlew koverMergedReport
52 |
53 |
--------------------------------------------------------------------------------
/.github/workflows/build.yml:
--------------------------------------------------------------------------------
1 | name: Build
2 |
3 | on:
4 | push:
5 | branches: [ main, '[1-9]+.[0-9]+.x' ]
6 | pull_request:
7 | branches: [ main, '[1-9]+.[0-9]+.x' ]
8 | workflow_dispatch:
9 | inputs:
10 | commit_id:
11 | description: 'Git commit id'
12 | required: true
13 |
14 | jobs:
15 | build:
16 | name: Gradle build on JDK ${{ matrix.java-version }}
17 | runs-on: ubuntu-latest
18 | strategy:
19 | matrix:
20 | java-version: [ '17', '21' ]
21 |
22 | steps:
23 | - name: Setup Commit ID
24 | run: |
25 | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
26 | echo "COMMIT_ID=${{ github.event.inputs.commit_id }}" >> ${GITHUB_ENV}
27 | else
28 | echo "COMMIT_ID=${{ github.sha }}" >> ${GITHUB_ENV}
29 | fi
30 |
31 | - name: Checkout
32 | uses: actions/checkout@v3
33 | with:
34 | ref: ${{ env.COMMIT_ID }}
35 | fetch-depth: 0
36 |
37 | - name: Setup JDK
38 | uses: actions/setup-java@v4
39 | with:
40 | distribution: 'temurin'
41 | java-version: ${{ matrix.java-version }}
42 | cache: 'gradle'
43 |
44 | - name: Run check
45 | run: ./gradlew clean build
46 |
47 | - name: Upload coverage to Codecov
48 | uses: codecov/codecov-action@v3
49 | if: ${{ matrix.java-version == '17' && github.ref == 'refs/heads/main' }}
50 | with:
51 | files: ./build/jacoco/result.xml
52 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: Deploy
2 |
3 | on:
4 | push:
5 | tags:
6 | - 'v[0-9]+.[0-9]+.[0-9]+'
7 | workflow_dispatch:
8 | inputs:
9 | commit_id:
10 | description: 'Git commit id'
11 | required: true
12 |
13 | jobs:
14 | deploy:
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - name: Setup Commit ID
19 | run: |
20 | if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
21 | echo "COMMIT_ID=${{ github.event.inputs.commit_id }}" >> ${GITHUB_ENV}
22 | else
23 | echo "COMMIT_ID=${{ github.sha }}" >> ${GITHUB_ENV}
24 | fi
25 |
26 | - name: Checkout
27 | uses: actions/checkout@v3
28 | with:
29 | ref: ${{ env.COMMIT_ID }}
30 | fetch-depth: 0
31 |
32 | - name: Setup JDK
33 | uses: actions/setup-java@v3
34 | with:
35 | distribution: 'temurin'
36 | java-version: '17'
37 |
38 | - name: Run check
39 | run: ./gradlew clean build
40 |
41 | - name: Publish
42 | run: ./gradlew publish --no-parallel
43 | env:
44 | MAVEN_USER: ${{ secrets.MAVEN_USER }}
45 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
46 | SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
47 | SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
48 | SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
49 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # gradle
2 | .gradle
3 | build
4 |
5 | # idea
6 | .idea/
7 | *.iml
8 | out/
9 |
10 | # eclipse
11 | .settings
12 | .classpath
13 | .project
14 |
15 | # .envrc
16 | .envrc
17 |
18 | # osx
19 | .DS_Store
20 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | ## Code of Conduct
4 |
5 | This project is governed by the [Code of Conduct](./CODE_OF_CONDUCT.md). By participating you are expected to uphold
6 | this code. Please report unacceptable behavior to [issue](https://github.com/naver/spring-batch-plus/issues).
7 |
8 | ## IDE
9 |
10 | Use [Intellij Community](https://www.jetbrains.com/idea/download/#section=mac) (also Ultimate is possible).
11 |
12 | Import code style schema from [naver-intellij-formatter](./buildSrc/config). You can see [how to import schemas](https://www.jetbrains.com/help/idea/configuring-code-style.html#import-export-schemes) in the Intellij guide.
13 |
14 | ## How to contribute
15 |
16 | ### Issue
17 |
18 | Feel free to make an any issue.
19 |
20 | ### Pull request
21 |
22 | We doesn't require a lot.
23 |
24 | 1. Make sure that all check passes (`./gradlew check` should pass)
25 | 2. Make sure to write test for all code changes.
26 |
27 | You can check build guide in [build from source](./README.md#build-from-source).
28 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.coverage-all-conventions")
3 | }
4 |
--------------------------------------------------------------------------------
/buildSrc/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | `kotlin-dsl` // support convension plugins in kotlin
3 | }
4 |
5 | repositories {
6 | mavenCentral()
7 | mavenLocal()
8 | gradlePluginPortal() // give access to gradle community plugins
9 | }
10 |
11 | dependencies {
12 | // see also (compatibility matrix) : https://docs.gradle.org/current/userguide/compatibility.html
13 | implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
14 | implementation("org.jlleitschuh.gradle.ktlint:org.jlleitschuh.gradle.ktlint.gradle.plugin:11.6.1")
15 | }
16 |
--------------------------------------------------------------------------------
/buildSrc/config/naver-checkstyle-suppressions.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/buildSrc/src/main/kotlin/spring.batch.plus.kotlin-conventions.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2 | import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
3 |
4 | plugins {
5 | // kotlin itself
6 | // https://kotlinlang.org/docs/gradle-configure-project.html#targeting-the-jvm
7 | id("org.jetbrains.kotlin.jvm")
8 |
9 | // for lint
10 | // https://github.com/JLLeitschuh/ktlint-gradle
11 | id("org.jlleitschuh.gradle.ktlint")
12 | }
13 |
14 |
15 | /* kotlin */
16 |
17 | kotlin {
18 | jvmToolchain(17) // use this version when development
19 | compilerOptions {
20 | freeCompilerArgs = listOf(
21 | "-Xjsr305=strict", // enable jsr305 null-safety in kotlin
22 | )
23 | jvmTarget = JvmTarget.JVM_17 // make class files for this version
24 | languageVersion = KotlinVersion.KOTLIN_1_6 // language feature level
25 | apiVersion = KotlinVersion.KOTLIN_1_6 // std api level
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/doc/en/README.md:
--------------------------------------------------------------------------------
1 | # Spring Batch Plus
2 |
3 | Spring Batch Plus provides useful classes available in [Spring Batch](https://github.com/spring-projects/spring-batch). Being originally designed to be served as a repository for the Kotlin DSL, it has been expanded to cover functions useful for Spring Batch.
4 |
5 | ## User guide
6 |
7 | The Kotlin DSL helps you declaratively declare a `Job`, `Step`, and `Flow` by using Kotlin’s [type-safe builders](https://kotlinlang.org/docs/type-safe-builders.html), without using `JobBuilder`, `StepBuilder`, or `FlowBuilder`. `ClearRunIdIncrementer` is a class that can replace the `RunIdIncrementer` of Spring Batch which reuses JobParameters in the previous JobExecution. `DeleteMetadataJob` is a `Job` that deletes old metadata. `ItemStreamFluxReaderProcessorWriter`, `ItemStreamIterableReaderProcessorWriter`, `ItemStreamIteratorReaderProcessorWriter` and `ItemStreamSimpleReaderProcessorWriter` helps you implement `ItemStreamReader`, `ItemProcessor`, and `ItemStreamWriter` as a single class.
8 |
9 | - [Kotlin DSL](./configuration/kotlin-dsl/README.md)
10 | - [ClearRunIdIncrementer](./job/clear-run-id-incrementer.md)
11 | - [DeleteMetadataJob](./job/delete-metadata-job.md)
12 | - [ItemStreamFluxReaderProcessorWriter](./step/item-stream-flux-reader-processor-writer.md)
13 | - [ItemStreamIterableReaderProcessorWriter](./step/item-stream-iterable-reader-processor-writer.md)
14 | - [ItemStreamIteratorReaderProcessorWriter](./step/item-stream-iterator-reader-processor-writer.md)
15 | - [ItemStreamSimpleReaderProcessorWriter](./step/item-stream-simple-reader-processor-writer.md)
16 |
17 | ## Code samples
18 |
19 | See [sample](../../spring-batch-plus-sample/) for various code samples.
20 |
--------------------------------------------------------------------------------
/doc/en/configuration/kotlin-dsl/flow/README.md:
--------------------------------------------------------------------------------
1 | # Flow
2 |
3 | - [Create a flow](#create-a-flow)
4 |
5 | A `Flow` defines the flow of a `Job`. Although you can create a `Flow` when you define a `Job` as in [Set a job flow](../job/README.md#set-a-job-flow), you can also directly create it as another object. For more information about how a `Flow` works, including sequential and conditional execution, which is the same as how a `Job` works except that a `Flow` can be created as another object, see [Set a job flow](../job/README.md#set-a-job-flow).
6 |
7 | ## Create a flow
8 |
9 | You can use `BatchDsl` to create a `Flow`.
10 |
11 | ```kotlin
12 | @Configuration
13 | open class TestJobConfig(
14 | private val batch: BatchDsl,
15 | private val transactionManager: PlatformTransactionManager,
16 | ) {
17 |
18 | @Bean
19 | open fun testJob(): Job = batch {
20 | job("testJob") {
21 | flow(testFlow())
22 | }
23 | }
24 |
25 | @Bean
26 | open fun testFlow(): Flow = batch {
27 | flow("testFlow") {
28 | step(testStep()) {
29 | on("COMPLETED") {
30 | stop()
31 | }
32 | on("*") {
33 | fail()
34 | }
35 | }
36 | }
37 | }
38 |
39 | @Bean
40 | open fun testStep(): Step = batch {
41 | step("testStep") {
42 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
43 | }
44 | }
45 | }
46 | ```
47 |
--------------------------------------------------------------------------------
/doc/en/configuration/kotlin-dsl/job/README.md:
--------------------------------------------------------------------------------
1 | # Job
2 |
3 | - [How to create a job](#how-to-create-a-job)
4 | - [Set a job flow](#set-a-job-flow)
5 | - [How to set a job](#how-to-set-a-job)
6 |
7 | Spring Batch runs a batch by `Job`. A `Job` consists of one or more `Steps`, which can be run sequentially or conditionally. Spring Batch Plus helps you easily create a `Flow` declaratively.
8 |
9 | ## How to create a job
10 |
11 | You can use `BatchDsl` to create a `Job`.
12 |
13 | ```kotlin
14 | @Configuration
15 | open class TestJobConfig(
16 | private val batch: BatchDsl,
17 | private val transactionManager: PlatformTransactionManager,
18 | ) {
19 |
20 | @Bean
21 | open fun testJob(): Job = batch {
22 | job("testJob") {
23 | step("testStep") {
24 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
25 | }
26 | step("testStep2") {
27 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
28 | }
29 | }
30 | }
31 | }
32 | ```
33 |
34 | ## Set a job flow
35 |
36 | `Steps` can be run sequentially, conditionally, or in parallel in multiple threads. To create a `Flow` of a `Job`, you can use another `Flow` or a `JobExecutionDecider` as well as a `Step`. For more information, see the following topics:
37 |
38 | - [Using Steps](./job-flow-step.md)
39 | - [Using Other Flows](./job-flow-flow.md)
40 | - [Using a JobExecutionDecider](./job-flow-decider.md)
41 | - [Transition from a Flow](./job-flow-transition.md)
42 | - [Processing Flows in Parallel](./job-split.md)
43 |
44 | ## How to set a job
45 |
46 | Spring Batch helps you set a listener or an incrementer for a `Job`. The Kotlin DSL for Spring Batch Plus also helps you do so. For more information, see the following topic:
47 |
48 | - [Job Configuration](./job-configuration.md)
49 |
--------------------------------------------------------------------------------
/doc/ko/README.md:
--------------------------------------------------------------------------------
1 | # Spring Batch Plus
2 |
3 | Spring Batch Plus는 [Spring Batch](https://github.com/spring-projects/spring-batch)에서 사용할 수 있는 여러 유용한 class들을 제공합니다. 처음에 Kotlin DSL을 위한 repository로만 개발하려고 했으나 Spring Batch를 쓰면서 '아 이런게 있으면 좋겠다' 싶은 것들도 같이 모았습니다.
4 |
5 | ## 사용자 가이드
6 |
7 | Kotlin DSL은 `JobBuilder`, `StepBuilder`, `FlowBuilder`를 이용하지 않고 Kotlin의 [Type-safe builder](https://kotlinlang.org/docs/type-safe-builders.html)를 이용하여 선언적으로 `Job`, `Step`, `Flow`를 선언할 수 있는 기능을 제공합니다. `ClearRunIdIncrementer`는 Spring Batch에서 제공하는 `RunIdIncrementer`를 대신하는 class로 `RunIdIncrementer`가 이전의 JobExecution에 있는 JobParameter를 재사용하는 문제를 해결한 class 입니다. `DeleteMetadataJob`은 오래된 metadata를 삭제하는 기능을 제공해주는 `Job` 입니다. 그리고 `ItemStreamFluxReaderProcessorWriter`, `ItemStreamIterableReaderProcessorWriter`, `ItemStreamIteratorReaderProcessorWriter`, `ItemStreamSimpleReaderProcessorWriter` 는 `ItemStreamReader`, `ItemProcessor`, `ItemStreamWriter`를 단일 class로 구현할 수 있게 합니다.
8 |
9 | - [Kotlin DSL](./configuration/kotlin-dsl/README.md)
10 | - [ClearRunIdIncrementer](./job/clear-run-id-incrementer.md)
11 | - [DeleteMetadataJob](./job/delete-metadata-job.md)
12 | - [ItemStreamFluxReaderProcessorWriter](./step/item-stream-flux-reader-processor-writer.md)
13 | - [ItemStreamIterableReaderProcessorWriter](./step/item-stream-iterable-reader-processor-writer.md)
14 | - [ItemStreamIteratorReaderProcessorWriter](./step/item-stream-iterator-reader-processor-writer.md)
15 | - [ItemStreamSimpleReaderProcessorWriter](./step/item-stream-simple-reader-processor-writer.md)
16 |
17 | ## 예제 코드
18 |
19 | [sample](../../spring-batch-plus-sample/)에 여러 케이스별로 샘플 코드를 모아놓았습니다.
20 |
--------------------------------------------------------------------------------
/doc/ko/configuration/kotlin-dsl/flow/README.md:
--------------------------------------------------------------------------------
1 | # Flow
2 |
3 | - [Flow를 생성하기](#flow를-생성하기)
4 |
5 | `Flow`는 `Job`의 흐름을 정의합니다. `Flow`는 [Job Flow 설정](../job/README.md#job-flow-설정)처럼 `Job`을 정의할 때 생성할 수 있지만 직접 다른 객체로 생성할 수 있습니다. `Flow`를 다른 객체로 생성하는것 이외에는 `Job`와 동작이 동일하므로 순차 수행, 분기 수행 등 상세한 사용법은 [Job Flow 설정](../job/README.md#job-flow-설정)을 참고바랍니다.
6 |
7 | ## Flow를 생성하기
8 |
9 | `BatchDsl`을 사용하여 `Flow`를 생성할 수 있습니다.
10 |
11 | ```kotlin
12 | @Configuration
13 | open class TestJobConfig(
14 | private val batch: BatchDsl,
15 | private val transactionManager: PlatformTransactionManager,
16 | ) {
17 |
18 | @Bean
19 | open fun testJob(): Job = batch {
20 | job("testJob") {
21 | flow(testFlow())
22 | }
23 | }
24 |
25 | @Bean
26 | open fun testFlow(): Flow = batch {
27 | flow("testFlow") {
28 | step(testStep()) {
29 | on("COMPLETED") {
30 | stop()
31 | }
32 | on("*") {
33 | fail()
34 | }
35 | }
36 | }
37 | }
38 |
39 | @Bean
40 | open fun testStep(): Step = batch {
41 | step("testStep") {
42 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
43 | }
44 | }
45 | }
46 | ```
--------------------------------------------------------------------------------
/doc/ko/configuration/kotlin-dsl/job/README.md:
--------------------------------------------------------------------------------
1 | # Job
2 |
3 | - [Job 생성 방법](#job-생성-방법)
4 | - [Job Flow 설정](#job-flow-설정)
5 | - [Job 설정 방법](#job-설정-방법)
6 |
7 | Spring Batch 는 `Job` 단위로 수행됩니다. 한 `Job`은 한개 또는 여러개의 `Step`으로 구성되어 있습니다. `Step`은 순차적으로 수행될 수도 있지만 특정 조건에 따라 분기해서 수행될 수도 있습니다. Spring Batch Plus에서는 이 `Flow` 기능을 보다 편리하게 선언적으로 작성할 수 있는 기능을 제공합니다.
8 |
9 | ## Job 생성 방법
10 |
11 | `BatchDsl`을 활용하여 `Job`을 생성할 수 있습니다.
12 |
13 | ```kotlin
14 | @Configuration
15 | open class TestJobConfig(
16 | private val batch: BatchDsl,
17 | private val transactionManager: PlatformTransactionManager,
18 | ) {
19 |
20 | @Bean
21 | open fun testJob(): Job = batch {
22 | job("testJob") {
23 | step("testStep") {
24 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
25 | }
26 | step("testStep2") {
27 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
28 | }
29 | }
30 | }
31 | }
32 | ```
33 |
34 | ## Job Flow 설정
35 |
36 | `Step`들은 순차적으로 수행할 수 있고 조건에 따라 분기하여 수행하거나, 여러 Thread에서 병렬로 수행할 수도 있습니다. `Job`의 `Flow`를 작성할 때 `Step` 뿐만 아니라 다른 `Flow`, `JobExecutionDecider`도 사용할 수 있습니다. 자세한 설정 방법은 다음을 참고하시길 바랍니다.
37 |
38 | - [Step 사용](./job-flow-step.md)
39 | - [다른 Flow 사용](./job-flow-flow.md)
40 | - [JobExecutionDecider 사용](./job-flow-decider.md)
41 | - [Flow에서 Transition 하는 방법](./job-flow-transition.md)
42 | - [Flow 병렬처리](./job-split.md)
43 |
44 | ## Job 설정 방법
45 |
46 | Spring Batch에서는 `Job`에 대한 listener, incrementer 등을 설정할 수 있는 기능을 제공합니다. Spring Batch Plus에서도 동일하게 Kotlin DSL로 해당 설정들을 할 수 있는 기능을 제공합니다. 자세한 설정 방법은 다음을 참고하시길 바랍니다.
47 |
48 | - [Job Configuration](./job-configuration.md)
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | kotlin.code.style=official
2 | group=com.navercorp.spring
3 | version=1.2.1-SNAPSHOT
4 | org.gradle.daemon=true
5 | org.gradle.parallel=true
6 | org.gradle.caching=true
7 | org.gradle.configureondemand=true
8 | org.gradle.jvmargs=-Xmx2g
9 |
--------------------------------------------------------------------------------
/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | spring-boot = "3.4.0"
3 | spring-batch = "5.2.0"
4 | # spring-jdbc version should follow minor version described in 'spring-framework.version'
5 | # https://github.com/spring-projects/spring-batch/blob/main/pom.xml
6 | spring-jdbc = "6.2.0"
7 | slf4j = "1.7.36"
8 | reactor-core = "3.5.0"
9 | findbugs-jsr305 = "3.0.2"
10 |
11 | # test-only
12 | junit = "5.11.+"
13 | assertj = "3.27.+"
14 | mockito = "5.15.+"
15 | mockk = "1.13.+"
16 | h2 = "2.3.+"
17 | log4j = "2.24.+"
18 |
19 | [libraries]
20 | spring-boot-autoconfigure = { module = "org.springframework.boot:spring-boot-autoconfigure", version.ref = "spring-boot" }
21 | spring-batch-core = { module = "org.springframework.batch:spring-batch-core", version.ref = "spring-batch" }
22 | spring-jdbc = { module = "org.springframework:spring-jdbc", version.ref = "spring-jdbc" }
23 | slf4j = { module = "org.slf4j:slf4j-api", version.ref = "slf4j" }
24 | reactor-core = { module = "io.projectreactor:reactor-core", version.ref = "reactor-core" }
25 | findbugs-jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "findbugs-jsr305" }
26 |
27 | # test-only
28 | junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" }
29 | assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
30 | mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
31 | mockk = { module = "io.mockk:mockk", version.ref = "mockk" }
32 | spring-boot-test = { module = "org.springframework.boot:spring-boot-test", version.ref = "spring-boot" }
33 | spring-batch-test = { module = "org.springframework.batch:spring-batch-test", version.ref = "spring-batch" }
34 | h2 = { module = "com.h2database:h2", version.ref = "h2" }
35 | log4j = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" }
36 |
37 | [bundles]
38 | test-java = ["junit", "assertj", "mockito"]
39 | test-kotlin = ["junit", "assertj", "mockk"]
40 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/naver/spring-batch-plus/9750aaeb2ef8d29d99a516e454cb5b9413cdd052/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | dependencyResolutionManagement {
2 | repositories {
3 | mavenCentral()
4 | mavenLocal()
5 | maven("https://repo.spring.io/milestone/")
6 | }
7 | }
8 |
9 | rootProject.name = "spring-batch-plus"
10 |
11 | include(
12 | "spring-batch-plus",
13 | "spring-batch-plus-kotlin",
14 | "spring-boot-autoconfigure-batch-plus",
15 | "spring-boot-autoconfigure-batch-plus-kotlin",
16 | "spring-boot-starter-batch-plus",
17 | "spring-boot-starter-batch-plus-kotlin",
18 |
19 | // sample projects
20 | "spring-batch-plus-sample:clear-run-id-incrementer-sample",
21 | "spring-batch-plus-sample:clear-run-id-incrementer-kotlin-sample",
22 | "spring-batch-plus-sample:delete-meta-data-job-sample",
23 | "spring-batch-plus-sample:delete-meta-data-job-kotlin-sample",
24 | "spring-batch-plus-sample:kotlin-dsl-sample",
25 | "spring-batch-plus-sample:single-class-reader-processor-writer-sample",
26 | "spring-batch-plus-sample:single-class-reader-processor-writer-kotlin-sample",
27 | )
28 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/README.md:
--------------------------------------------------------------------------------
1 | # Spring Batch Plus Kotlin Module
2 |
3 | - Provides kotlin based features which are good to use with Spring Batch.
4 | - Provides kotlin extension for `spring-batch-plus` module.
5 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.java-library-conventions")
3 | id("spring.batch.plus.kotlin-conventions")
4 | id("spring.batch.plus.maven-publish-conventions")
5 | }
6 |
7 | dependencies {
8 | api(project(":spring-batch-plus"))
9 |
10 | compileOnly(libs.spring.batch.core)
11 | implementation(libs.slf4j)
12 |
13 | testImplementation(libs.bundles.test.kotlin)
14 | testImplementation(libs.spring.batch.core)
15 | testImplementation(libs.spring.jdbc)
16 | testImplementation(libs.reactor.core)
17 | testRuntimeOnly(libs.h2)
18 | testRuntimeOnly(libs.log4j)
19 | }
20 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/integrationTest/resources/log4j2-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/main/kotlin/com/navercorp/spring/batch/plus/kotlin/configuration/FlowJobBuilderDsl.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.kotlin.configuration
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.support.BatchDslMarker
22 | import com.navercorp.spring.batch.plus.kotlin.configuration.support.DslContext
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.job.builder.FlowJobBuilder
25 |
26 | /**
27 | * A dsl for [FlowJobBuilder][org.springframework.batch.core.job.builder.FlowJobBuilder].
28 | */
29 | @BatchDslMarker
30 | internal class FlowJobBuilderDsl internal constructor(
31 | @Suppress("unused")
32 | private val dslContext: DslContext,
33 | private val delegate: ConcreteFlowBuilderDsl,
34 | ) : FlowBuilderDsl by delegate {
35 |
36 | internal fun build(): Job = this.delegate.build()
37 | .build()
38 | }
39 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/main/kotlin/com/navercorp/spring/batch/plus/kotlin/configuration/step/FlowStepBuilderDsl.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.kotlin.configuration.step
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.support.BatchDslMarker
22 | import com.navercorp.spring.batch.plus.kotlin.configuration.support.DslContext
23 | import com.navercorp.spring.batch.plus.kotlin.configuration.support.LazyConfigurer
24 | import org.springframework.batch.core.Step
25 | import org.springframework.batch.core.step.builder.FlowStepBuilder
26 |
27 | /**
28 | * A dsl for [FlowStepBuilder][org.springframework.batch.core.step.builder.FlowStepBuilder].
29 | *
30 | * @since 0.1.0
31 | */
32 | @BatchDslMarker
33 | class FlowStepBuilderDsl internal constructor(
34 | @Suppress("unused")
35 | private val dslContext: DslContext,
36 | private val flowStepBuilder: FlowStepBuilder,
37 | ) {
38 | private val lazyConfigurer = LazyConfigurer()
39 |
40 | internal fun build(): Step {
41 | return this.flowStepBuilder.apply(this.lazyConfigurer)
42 | .build()
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/main/kotlin/com/navercorp/spring/batch/plus/kotlin/configuration/support/BatchDslMarker.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.kotlin.configuration.support
20 |
21 | @DslMarker
22 | internal annotation class BatchDslMarker
23 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/main/kotlin/com/navercorp/spring/batch/plus/kotlin/configuration/support/DslContext.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.kotlin.configuration.support
20 |
21 | import org.springframework.batch.core.repository.JobRepository
22 | import org.springframework.beans.factory.BeanFactory
23 |
24 | internal data class DslContext(
25 | val beanFactory: BeanFactory,
26 | val jobRepository: JobRepository,
27 | )
28 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/main/kotlin/com/navercorp/spring/batch/plus/kotlin/configuration/support/LazyConfigurer.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.kotlin.configuration.support
20 |
21 | internal fun interface Configurer : (T) -> Unit
22 |
23 | /**
24 | * A class to configure builder lazily.
25 | */
26 | internal class LazyConfigurer : Configurer {
27 | private val configurers = mutableListOf>()
28 |
29 | fun add(configurer: Configurer) {
30 | configurers.add(configurer)
31 | }
32 |
33 | override fun invoke(target: T) {
34 | configurers.forEach {
35 | target.apply(it)
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/test/kotlin/com/navercorp/spring/batch/plus/kotlin/configuration/step/FlowStepBuilderDslTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.kotlin.configuration.step
20 |
21 | import io.mockk.every
22 | import io.mockk.mockk
23 | import org.assertj.core.api.Assertions.assertThat
24 | import org.junit.jupiter.api.Test
25 | import org.springframework.batch.core.Step
26 | import org.springframework.batch.core.step.builder.FlowStepBuilder
27 |
28 | internal class FlowStepBuilderDslTest {
29 |
30 | @Test
31 | fun testBuild() {
32 | // given
33 | val mockStep = mockk()
34 | val flowStepBuilder = mockk(relaxed = true) {
35 | every { build() } returns mockStep
36 | }
37 |
38 | // when
39 | val actual = FlowStepBuilderDsl(mockk(), flowStepBuilder).build()
40 |
41 | // then
42 | assertThat(actual).isEqualTo(mockStep)
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-kotlin/src/test/resources/log4j2-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/clear-run-id-incrementer-kotlin-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | id("org.jetbrains.kotlin.jvm")
9 | id("org.jlleitschuh.gradle.ktlint")
10 | id("io.spring.dependency-management") version "1.1.6"
11 | }
12 |
13 | repositories {
14 | mavenCentral()
15 | mavenLocal()
16 | }
17 |
18 | kotlin {
19 | jvmToolchain(17)
20 | }
21 |
22 | tasks.withType {
23 | kotlinOptions {
24 | freeCompilerArgs = listOf("-Xjsr305=strict") // enable jsr305 null-safety in kotlin
25 | jvmTarget = "17"
26 | }
27 | }
28 |
29 | tasks.named("test") {
30 | useJUnitPlatform()
31 | maxParallelForks = Runtime.getRuntime().availableProcessors()
32 | }
33 |
34 | dependencyManagement {
35 | imports {
36 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
37 | }
38 | }
39 |
40 | dependencies {
41 | implementation("org.springframework.boot:spring-boot-starter-batch")
42 | implementation(project(":spring-boot-starter-batch-plus-kotlin"))
43 | runtimeOnly("com.h2database:h2:2.1.214")
44 |
45 | testImplementation("org.springframework.boot:spring-boot-starter-test")
46 | }
47 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/clear-run-id-incrementer-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/clear/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.clear
20 |
21 | import com.navercorp.spring.batch.plus.job.ClearRunIdIncrementer
22 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | incrementer(ClearRunIdIncrementer.create())
39 | step("testStep") {
40 | tasklet(
41 | { _, _ -> RepeatStatus.FINISHED },
42 | transactionManager,
43 | )
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/clear-run-id-incrementer-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/clearwithid/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.clearwithid
20 |
21 | import com.navercorp.spring.batch.plus.job.ClearRunIdIncrementer
22 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | incrementer(ClearRunIdIncrementer.create("testId"))
39 | step("testStep") {
40 | tasklet(
41 | { _, _ -> RepeatStatus.FINISHED },
42 | transactionManager,
43 | )
44 | }
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/clear-run-id-incrementer-kotlin-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/clear-run-id-incrementer-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | java
9 | id("io.spring.dependency-management") version "1.1.6"
10 | }
11 |
12 | repositories {
13 | mavenCentral()
14 | mavenLocal()
15 | }
16 |
17 | java {
18 | toolchain {
19 | languageVersion.set(JavaLanguageVersion.of(17))
20 | }
21 | }
22 |
23 | tasks.named("test") {
24 | useJUnitPlatform()
25 | maxParallelForks = Runtime.getRuntime().availableProcessors()
26 | }
27 |
28 | dependencyManagement {
29 | imports {
30 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation("org.springframework.boot:spring-boot-starter-batch")
36 | implementation(project(":spring-boot-starter-batch-plus"))
37 | runtimeOnly("com.h2database:h2:2.1.214")
38 |
39 | testImplementation("org.springframework.boot:spring-boot-starter-test")
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/clear-run-id-incrementer-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | id("org.jetbrains.kotlin.jvm")
9 | id("org.jlleitschuh.gradle.ktlint")
10 | id("io.spring.dependency-management") version "1.1.6"
11 | }
12 |
13 | repositories {
14 | mavenCentral()
15 | mavenLocal()
16 | }
17 |
18 | kotlin {
19 | jvmToolchain(17)
20 | }
21 |
22 | tasks.withType {
23 | kotlinOptions {
24 | freeCompilerArgs = listOf("-Xjsr305=strict") // enable jsr305 null-safety in kotlin
25 | jvmTarget = "17"
26 | }
27 | }
28 |
29 | tasks.named("test") {
30 | useJUnitPlatform()
31 | maxParallelForks = Runtime.getRuntime().availableProcessors()
32 | }
33 |
34 | dependencyManagement {
35 | imports {
36 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
37 | }
38 | }
39 |
40 | dependencies {
41 | implementation("org.springframework.boot:spring-boot-starter-batch")
42 | implementation(project(":spring-boot-starter-batch-plus-kotlin"))
43 | runtimeOnly("com.h2database:h2:2.1.214")
44 |
45 | testImplementation("org.springframework.boot:spring-boot-starter-test")
46 | }
47 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/customdryrun/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.customdryrun
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .ignoreFailedDrops(true)
37 | .generateUniqueName(true)
38 | .build()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/dryrun/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.dryrun
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .ignoreFailedDrops(true)
37 | .generateUniqueName(true)
38 | .build()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/formatter/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.formatter
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .ignoreFailedDrops(true)
37 | .generateUniqueName(true)
38 | .build()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/jobname/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.jobname
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .ignoreFailedDrops(true)
37 | .generateUniqueName(true)
38 | .build()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/parametername/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.parametername
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .ignoreFailedDrops(true)
37 | .generateUniqueName(true)
38 | .build()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/plain/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.plain
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .ignoreFailedDrops(true)
37 | .generateUniqueName(true)
38 | .build()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/prefix/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.prefix
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import javax.sql.DataSource
27 |
28 | @Configuration
29 | open class JdbcConfig {
30 |
31 | @BatchDataSource
32 | @Bean
33 | open fun dataSource(): DataSource {
34 | return EmbeddedDatabaseBuilder()
35 | .setType(EmbeddedDatabaseType.H2)
36 | .addScript("classpath:sql/schema-h2-custom.sql")
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build()
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/deletemedadata/prefixfromvariable/JdbcConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemedadata.prefixfromvariable
20 |
21 | import org.springframework.boot.autoconfigure.batch.BatchDataSource
22 | import org.springframework.context.annotation.Bean
23 | import org.springframework.context.annotation.Configuration
24 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder
25 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType
26 | import java.util.UUID
27 | import javax.sql.DataSource
28 |
29 | @Configuration
30 | open class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | open fun dataSource(): DataSource {
35 | return EmbeddedDatabaseBuilder()
36 | .setName(UUID.randomUUID().toString())
37 | .setType(EmbeddedDatabaseType.H2)
38 | .addScript("classpath:sql/schema-h2-custom.sql")
39 | .ignoreFailedDrops(true)
40 | .generateUniqueName(true)
41 | .build()
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-kotlin-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | java
9 | id("io.spring.dependency-management") version "1.1.6"
10 | }
11 |
12 | repositories {
13 | mavenCentral()
14 | mavenLocal()
15 | }
16 |
17 | java {
18 | toolchain {
19 | languageVersion.set(JavaLanguageVersion.of(17))
20 | }
21 | }
22 |
23 | tasks.named("test") {
24 | useJUnitPlatform()
25 | maxParallelForks = Runtime.getRuntime().availableProcessors()
26 | }
27 |
28 | dependencyManagement {
29 | imports {
30 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation("org.springframework.boot:spring-boot-starter-batch")
36 | implementation(project(":spring-boot-starter-batch-plus"))
37 | runtimeOnly("com.h2database:h2:2.1.214")
38 |
39 | testImplementation("org.springframework.boot:spring-boot-starter-test")
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/customdryrun/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.customdryrun;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/dryrun/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.dryrun;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/formatter/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.formatter;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/jobname/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.jobname;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/parametername/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.parametername;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/plain/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.plain;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .ignoreFailedDrops(true)
38 | .generateUniqueName(true)
39 | .build();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/prefix/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.prefix;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .addScript("classpath:sql/schema-h2-custom.sql")
38 | .ignoreFailedDrops(true)
39 | .generateUniqueName(true)
40 | .build();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/java/com/navercorp/spring/batch/plus/sample/deletemetadata/prefixfromvariable/JdbcConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.deletemetadata.prefixfromvariable;
20 |
21 | import javax.sql.DataSource;
22 |
23 | import org.springframework.boot.autoconfigure.batch.BatchDataSource;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
27 | import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
28 |
29 | @Configuration
30 | public class JdbcConfig {
31 |
32 | @BatchDataSource
33 | @Bean
34 | public DataSource dataSource() {
35 | return new EmbeddedDatabaseBuilder()
36 | .setType(EmbeddedDatabaseType.H2)
37 | .addScript("classpath:sql/schema-h2-custom.sql")
38 | .ignoreFailedDrops(true)
39 | .generateUniqueName(true)
40 | .build();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/delete-meta-data-job-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | id("org.jetbrains.kotlin.jvm")
9 | id("org.jlleitschuh.gradle.ktlint")
10 | id("io.spring.dependency-management") version "1.1.6"
11 | }
12 |
13 | repositories {
14 | mavenCentral()
15 | mavenLocal()
16 | }
17 |
18 | kotlin {
19 | jvmToolchain(17)
20 | }
21 |
22 | tasks.withType {
23 | kotlinOptions {
24 | freeCompilerArgs = listOf("-Xjsr305=strict") // enable jsr305 null-safety in kotlin
25 | jvmTarget = "17"
26 | }
27 | }
28 |
29 | tasks.named("test") {
30 | useJUnitPlatform()
31 | maxParallelForks = Runtime.getRuntime().availableProcessors()
32 | }
33 |
34 | dependencyManagement {
35 | imports {
36 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
37 | }
38 | }
39 |
40 | dependencies {
41 | implementation("org.springframework.boot:spring-boot-starter-batch")
42 | implementation(project(":spring-boot-starter-batch-plus-kotlin"))
43 | runtimeOnly("com.h2database:h2:2.1.214")
44 |
45 | testImplementation("org.springframework.boot:spring-boot-starter-test")
46 | }
47 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/comparison/after/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.comparison.after
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/comparison/before/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.comparison.before
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/flow/creation/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.flow.creation
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.STOPPED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/configuration/listenerobject/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.configuration.listenerobject
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/configuration/meterregistry/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.configuration.meterregistry
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/configuration/meterregistry/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.configuration.meterregistry
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import io.micrometer.core.instrument.simple.SimpleMeterRegistry
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | meterRegistry(SimpleMeterRegistry())
39 | step("testStep") {
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/configuration/observationconvention/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.configuration.observationconvention
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.core.observability.DefaultBatchJobObservationConvention
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | observationConvention(DefaultBatchJobObservationConvention())
39 | step("testStep") {
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/configuration/observationregistry/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.configuration.observationregistry
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import io.micrometer.observation.ObservationRegistry
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | observationRegistry(ObservationRegistry.create())
39 | step("testStep") {
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/creation/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.creation
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/creation/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.creation
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.repeat.RepeatStatus
24 | import org.springframework.context.annotation.Bean
25 | import org.springframework.context.annotation.Configuration
26 | import org.springframework.transaction.PlatformTransactionManager
27 |
28 | @Configuration
29 | open class TestJobConfig(
30 | private val batch: BatchDsl,
31 | private val transactionManager: PlatformTransactionManager,
32 | ) {
33 |
34 | @Bean
35 | open fun testJob(): Job = batch {
36 | job("testJob") {
37 | step("testStep") {
38 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
39 | }
40 | step("testStep2") {
41 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
42 | }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/decider/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.decider.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/decider/bean/TestDecider.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.decider.bean
20 |
21 | import org.springframework.batch.core.JobExecution
22 | import org.springframework.batch.core.StepExecution
23 | import org.springframework.batch.core.job.flow.FlowExecutionStatus
24 | import org.springframework.batch.core.job.flow.JobExecutionDecider
25 | import org.springframework.stereotype.Component
26 |
27 | @Component
28 | class TestDecider : JobExecutionDecider {
29 | override fun decide(jobExecution: JobExecution, stepExecution: StepExecution?): FlowExecutionStatus {
30 | return FlowExecutionStatus.FAILED
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/decider/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.decider.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/flow/plain/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.flow.plain.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/flow/plain/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.flow.plain.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/flow/plain/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.flow.plain.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/flow/transition/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.flow.transition.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/flow/transition/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.flow.transition.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/flow/transition/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.flow.transition.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/comparison/after/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.comparison.after
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/comparison/before/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.comparison.before
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/plain/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.plain.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/plain/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.plain.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/plain/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.plain.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/transition/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.transition.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/transition/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.transition.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/step/transition/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.step.transition.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/finish/end/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.finish.end
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/finish/fail/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.finish.fail
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.FAILED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/finish/stop/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.finish.stop
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.STOPPED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/flow/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.flow.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/flow/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.flow.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/step/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.step.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/flow/transition/step/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.flow.transition.step.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/split/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.split.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/split/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.split.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/job/split/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.job.split.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/configuration/meterregistry/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.configuration.meterregistry
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import io.micrometer.core.instrument.simple.SimpleMeterRegistry
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | step("testStep") {
39 | meterRegistry(SimpleMeterRegistry())
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/configuration/observationconvention/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.configuration.observationconvention
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.core.observability.DefaultBatchStepObservationConvention
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | step("testStep") {
39 | observationConvention(DefaultBatchStepObservationConvention())
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/configuration/observationregistry/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.configuration.observationregistry
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import io.micrometer.observation.ObservationRegistry
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | step("testStep") {
39 | observationRegistry(ObservationRegistry.create())
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/creation/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.creation
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/flowstep/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.flowstep.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/flowstep/init/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.flowstep.init
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/flowstep/init/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.flowstep.init
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.repeat.RepeatStatus
24 | import org.springframework.context.annotation.Bean
25 | import org.springframework.context.annotation.Configuration
26 | import org.springframework.transaction.PlatformTransactionManager
27 |
28 | @Configuration
29 | open class TestJobConfig(
30 | private val batch: BatchDsl,
31 | private val transactionManager: PlatformTransactionManager,
32 | ) {
33 |
34 | @Bean
35 | open fun testJob(): Job = batch {
36 | job("testJob") {
37 | step("testStep") {
38 | flow("anotherFlow") {
39 | step("anotherFlowStep") {
40 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
41 | }
42 | }
43 | }
44 | }
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/flowstep/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.flowstep.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/jobstep/bean/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.jobstep.bean
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean("testJob")
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/jobstep/bean/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.jobstep.bean
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.repeat.RepeatStatus
24 | import org.springframework.context.annotation.Bean
25 | import org.springframework.context.annotation.Configuration
26 | import org.springframework.transaction.PlatformTransactionManager
27 |
28 | @Configuration
29 | open class TestJobConfig(
30 | private val batch: BatchDsl,
31 | private val transactionManager: PlatformTransactionManager,
32 | ) {
33 |
34 | @Bean
35 | open fun testJob(): Job = batch {
36 | job("testJob") {
37 | step("testStep") {
38 | jobBean("anotherJob")
39 | }
40 | }
41 | }
42 |
43 | @Bean
44 | open fun anotherJob() = batch {
45 | job("anotherJob") {
46 | step("anotherJobStep") {
47 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/jobstep/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.jobstep.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean("testJob")
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/jobstep/variable/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.jobstep.variable
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.repeat.RepeatStatus
24 | import org.springframework.context.annotation.Bean
25 | import org.springframework.context.annotation.Configuration
26 | import org.springframework.transaction.PlatformTransactionManager
27 |
28 | @Configuration
29 | open class TestJobConfig(
30 | private val batch: BatchDsl,
31 | private val transactionManager: PlatformTransactionManager,
32 | ) {
33 |
34 | @Bean
35 | open fun testJob(): Job = batch {
36 | job("testJob") {
37 | step("testStep") {
38 | job(anotherJob())
39 | }
40 | }
41 | }
42 |
43 | @Bean
44 | open fun anotherJob() = batch {
45 | job("anotherJob") {
46 | step("anotherJobStep") {
47 | tasklet({ _, _ -> RepeatStatus.FINISHED }, transactionManager)
48 | }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/taskletstep/config/stream/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.taskletstep.config.stream
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/taskletstep/variable/SampleApplicationTest.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.taskletstep.variable
20 |
21 | import org.junit.jupiter.api.Test
22 | import org.springframework.batch.core.BatchStatus
23 | import org.springframework.batch.core.Job
24 | import org.springframework.batch.core.JobParametersBuilder
25 | import org.springframework.batch.core.launch.JobLauncher
26 | import org.springframework.beans.factory.getBean
27 | import org.springframework.boot.autoconfigure.SpringBootApplication
28 | import org.springframework.boot.runApplication
29 |
30 | @SpringBootApplication
31 | open class SampleApplicationTest {
32 | @Test
33 | fun run() {
34 | val applicationContext = runApplication()
35 | val jobLauncher = applicationContext.getBean()
36 | val job = applicationContext.getBean()
37 |
38 | val jobParameters = JobParametersBuilder()
39 | .toJobParameters()
40 | val jobExecution = jobLauncher.run(job, jobParameters)
41 |
42 | assert(BatchStatus.COMPLETED == jobExecution.status)
43 | println(jobExecution)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/step/taskletstep/variable/TestJobConfig.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.step.taskletstep.variable
20 |
21 | import com.navercorp.spring.batch.plus.kotlin.configuration.BatchDsl
22 | import org.springframework.batch.core.Job
23 | import org.springframework.batch.core.step.tasklet.Tasklet
24 | import org.springframework.batch.repeat.RepeatStatus
25 | import org.springframework.context.annotation.Bean
26 | import org.springframework.context.annotation.Configuration
27 | import org.springframework.transaction.PlatformTransactionManager
28 |
29 | @Configuration
30 | open class TestJobConfig(
31 | private val batch: BatchDsl,
32 | private val transactionManager: PlatformTransactionManager,
33 | ) {
34 |
35 | @Bean
36 | open fun testJob(): Job = batch {
37 | job("testJob") {
38 | step("testStep") {
39 | tasklet(testTasklet(), transactionManager)
40 | }
41 | }
42 | }
43 |
44 | @Bean
45 | open fun testTasklet(): Tasklet = Tasklet { _, _ ->
46 | println("run testTasklet")
47 | RepeatStatus.FINISHED
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/kotlin-dsl-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-kotlin-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | id("org.jetbrains.kotlin.jvm")
9 | id("org.jlleitschuh.gradle.ktlint")
10 | id("io.spring.dependency-management") version "1.1.6"
11 | }
12 |
13 | repositories {
14 | mavenCentral()
15 | mavenLocal()
16 | }
17 |
18 | kotlin {
19 | jvmToolchain(17)
20 | }
21 |
22 | tasks.withType {
23 | kotlinOptions {
24 | freeCompilerArgs = listOf("-Xjsr305=strict") // enable jsr305 null-safety in kotlin
25 | jvmTarget = "17"
26 | }
27 | }
28 |
29 | tasks.named("test") {
30 | useJUnitPlatform()
31 | maxParallelForks = Runtime.getRuntime().availableProcessors()
32 | }
33 |
34 | dependencyManagement {
35 | imports {
36 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
37 | }
38 | }
39 |
40 | dependencies {
41 | implementation("org.springframework.boot:spring-boot-starter-batch")
42 | implementation(project(":spring-boot-starter-batch-plus-kotlin"))
43 | implementation("io.projectreactor:reactor-core:3.5.0")
44 | runtimeOnly("com.h2database:h2:2.1.214")
45 |
46 | testImplementation("org.springframework.boot:spring-boot-starter-test")
47 | }
48 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/simple/readerprocessor/SampleTasklet.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.simple.readerprocessor
20 |
21 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamSimpleReaderProcessor
22 | import org.springframework.batch.core.configuration.annotation.StepScope
23 | import org.springframework.beans.factory.annotation.Value
24 | import org.springframework.stereotype.Component
25 |
26 | @Component
27 | @StepScope
28 | open class SampleTasklet(
29 | @Value("#{jobParameters['totalCount']}") private var totalCount: Long,
30 | ) : ItemStreamSimpleReaderProcessor {
31 | private var count = 0
32 |
33 | override fun read(): Int? {
34 | return if (count < totalCount) {
35 | count++
36 | } else {
37 | null
38 | }
39 | }
40 |
41 | override fun process(item: Int): String? {
42 | return "'$item'"
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/simple/readerprocessorwriter/SampleTasklet.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.simple.readerprocessorwriter
20 |
21 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamSimpleReaderProcessorWriter
22 | import org.springframework.batch.core.configuration.annotation.StepScope
23 | import org.springframework.batch.item.Chunk
24 | import org.springframework.beans.factory.annotation.Value
25 | import org.springframework.stereotype.Component
26 |
27 | @Component
28 | @StepScope
29 | open class SampleTasklet(
30 | @Value("#{jobParameters['totalCount']}") private var totalCount: Long,
31 | ) : ItemStreamSimpleReaderProcessorWriter {
32 | private var count = 0
33 |
34 | override fun read(): Int? {
35 | return if (count < totalCount) {
36 | count++
37 | } else {
38 | null
39 | }
40 | }
41 |
42 | override fun process(item: Int): String? {
43 | return "'$item'"
44 | }
45 |
46 | override fun write(chunk: Chunk) {
47 | println(chunk.items)
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-kotlin-sample/src/test/kotlin/com/navercorp/spring/batch/plus/sample/simple/readerwriter/SampleTasklet.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.simple.readerwriter
20 |
21 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamSimpleReaderWriter
22 | import org.springframework.batch.core.configuration.annotation.StepScope
23 | import org.springframework.batch.item.Chunk
24 | import org.springframework.beans.factory.annotation.Value
25 | import org.springframework.stereotype.Component
26 |
27 | @Component
28 | @StepScope
29 | open class SampleTasklet(
30 | @Value("#{jobParameters['totalCount']}") private var totalCount: Long,
31 | ) : ItemStreamSimpleReaderWriter {
32 | private var count = 0
33 |
34 | override fun read(): Int? {
35 | return if (count < totalCount) {
36 | count++
37 | } else {
38 | null
39 | }
40 | }
41 |
42 | override fun write(chunk: Chunk) {
43 | println(chunk.items)
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-kotlin-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-sample/build.gradle.kts:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | gradlePluginPortal() // give accees to gradle community plugins
4 | }
5 | }
6 |
7 | plugins {
8 | java
9 | id("io.spring.dependency-management") version "1.1.6"
10 | }
11 |
12 | repositories {
13 | mavenCentral()
14 | mavenLocal()
15 | }
16 |
17 | java {
18 | toolchain {
19 | languageVersion.set(JavaLanguageVersion.of(17))
20 | }
21 | }
22 |
23 | tasks.named("test") {
24 | useJUnitPlatform()
25 | maxParallelForks = Runtime.getRuntime().availableProcessors()
26 | }
27 |
28 | dependencyManagement {
29 | imports {
30 | mavenBom("org.springframework.boot:spring-boot-dependencies:3.4.0")
31 | }
32 | }
33 |
34 | dependencies {
35 | implementation("org.springframework.boot:spring-boot-starter-batch")
36 | implementation(project(":spring-boot-starter-batch-plus"))
37 | implementation("io.projectreactor:reactor-core:3.5.0")
38 | runtimeOnly("com.h2database:h2:2.1.214")
39 |
40 | testImplementation("org.springframework.boot:spring-boot-starter-test")
41 | }
42 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-sample/src/test/java/com/navercorp/spring/batch/plus/sample/simple/readerprocessor/SampleTasklet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.simple.readerprocessor;
20 |
21 | import org.springframework.batch.core.configuration.annotation.StepScope;
22 | import org.springframework.beans.factory.annotation.Value;
23 | import org.springframework.lang.NonNull;
24 | import org.springframework.stereotype.Component;
25 |
26 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamSimpleReaderProcessor;
27 |
28 | @Component
29 | @StepScope
30 | class SampleTasklet implements ItemStreamSimpleReaderProcessor {
31 |
32 | @Value("#{jobParameters['totalCount']}")
33 | private long totalCount;
34 |
35 | private int count = 0;
36 |
37 | @Override
38 | public Integer read() {
39 | if (count < totalCount) {
40 | return count++;
41 | } else {
42 | return null;
43 | }
44 | }
45 |
46 | @Override
47 | public String process(@NonNull Integer item) {
48 | return "'" + item.toString() + "'";
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-sample/src/test/java/com/navercorp/spring/batch/plus/sample/simple/readerwriter/SampleTasklet.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.sample.simple.readerwriter;
20 |
21 | import org.springframework.batch.core.configuration.annotation.StepScope;
22 | import org.springframework.batch.item.Chunk;
23 | import org.springframework.beans.factory.annotation.Value;
24 | import org.springframework.lang.NonNull;
25 | import org.springframework.stereotype.Component;
26 |
27 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamSimpleReaderWriter;
28 |
29 | @Component
30 | @StepScope
31 | class SampleTasklet implements ItemStreamSimpleReaderWriter {
32 |
33 | @Value("#{jobParameters['totalCount']}")
34 | private long totalCount;
35 |
36 | private int count = 0;
37 |
38 | @Override
39 | public Integer read() {
40 | if (count < totalCount) {
41 | return count++;
42 | } else {
43 | return null;
44 | }
45 | }
46 |
47 | @Override
48 | public void write(@NonNull Chunk extends Integer> chunk) {
49 | System.out.println(chunk.getItems());
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/spring-batch-plus-sample/single-class-reader-processor-writer-sample/src/test/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | profiles:
3 | active: local
4 | h2:
5 | console:
6 | enabled: true
7 | path: /h2-console # enable h2 console
8 | batch:
9 | job:
10 | enabled: false
11 | jdbc:
12 | initialize-schema: embedded
13 | platform: h2
14 |
15 | logging:
16 | level:
17 | root: WARN
18 |
--------------------------------------------------------------------------------
/spring-batch-plus/README.md:
--------------------------------------------------------------------------------
1 | # Spring Batch Plus Module
2 |
3 | - Provides java based features which are good to use with Spring Batch.
4 |
--------------------------------------------------------------------------------
/spring-batch-plus/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.java-library-conventions")
3 | id("spring.batch.plus.maven-publish-conventions")
4 | }
5 |
6 | dependencies {
7 | compileOnly(libs.findbugs.jsr305)
8 | compileOnly(libs.spring.batch.core)
9 | compileOnly(libs.spring.jdbc)
10 | compileOnly(libs.reactor.core)
11 | implementation(libs.slf4j)
12 |
13 | testImplementation(libs.bundles.test.java)
14 | testImplementation(libs.spring.batch.core)
15 | testImplementation(libs.spring.batch.test)
16 | testImplementation(libs.reactor.core)
17 | testRuntimeOnly(libs.h2)
18 | testRuntimeOnly(libs.log4j)
19 | }
20 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/integrationTest/resources/log4j2-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/item/adapter/ItemProcessorDelegate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.item.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.lang.NonNull;
23 | import org.springframework.lang.Nullable;
24 |
25 | /**
26 | * A delegate for {@link ItemProcessor}.
27 | *
28 | * @since 0.1.0
29 | * @deprecated use {@link com.navercorp.spring.batch.plus.step.adapter.ItemProcessorDelegate} instead.
30 | */
31 | @Deprecated
32 | public interface ItemProcessorDelegate {
33 |
34 | /**
35 | * A delegate method for {@link ItemProcessor#process(Object)}.
36 | *
37 | * @param item an item to process
38 | * @return processed item
39 | */
40 | @Nullable
41 | O process(@NonNull I item);
42 | }
43 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/item/adapter/ItemStreamReaderProcessorWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.item.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 | import org.springframework.batch.item.ItemStreamWriter;
24 |
25 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamFluxReaderProcessorWriter;
26 |
27 | /**
28 | * A simple adapter for stream reader, processor, writer. It can represent
29 | * {@link ItemStreamReader}, {@link ItemProcessor}, {@link ItemStreamWriter} in a single class.
30 | *
31 | * @since 0.1.0
32 | * @deprecated use {@link ItemStreamFluxReaderProcessorWriter} instead.
33 | */
34 | @Deprecated
35 | public interface ItemStreamReaderProcessorWriter
36 | extends ItemStreamReaderDelegate, ItemProcessorDelegate, ItemStreamWriterDelegate {
37 | }
38 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/item/adapter/ItemStreamReaderWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.item.adapter;
20 |
21 | import org.springframework.batch.item.ItemStreamReader;
22 | import org.springframework.batch.item.ItemStreamWriter;
23 |
24 | import com.navercorp.spring.batch.plus.step.adapter.ItemStreamFluxReaderWriter;
25 |
26 | /**
27 | * A simple adapter for stream reader, writer. It can represent
28 | * {@link ItemStreamReader}, {@link ItemStreamWriter} in a single class.
29 | *
30 | * @since 0.1.0
31 | * @deprecated use {@link ItemStreamFluxReaderWriter} instead.
32 | */
33 | @Deprecated
34 | public interface ItemStreamReaderWriter extends ItemStreamReaderDelegate, ItemStreamWriterDelegate {
35 | }
36 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/item/adapter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | /**
20 | * An extensions for spring batch item adapter concerns.
21 | */
22 | package com.navercorp.spring.batch.plus.item.adapter;
23 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/job/metadata/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | /**
20 | * The job to delete old Spring Batch metadata
21 | */
22 | package com.navercorp.spring.batch.plus.job.metadata;
23 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/job/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | /**
20 | * An extensions for spring batch job concerns.
21 | */
22 | package com.navercorp.spring.batch.plus.job;
23 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemProcessorDelegate.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.lang.NonNull;
23 | import org.springframework.lang.Nullable;
24 |
25 | /**
26 | * A delegate for {@link ItemProcessor}.
27 | *
28 | * @since 1.1.0
29 | */
30 | public interface ItemProcessorDelegate {
31 |
32 | /**
33 | * A delegate method for {@link ItemProcessor#process(Object)}.
34 | *
35 | * @param item an item to process
36 | * @return processed item
37 | */
38 | @Nullable
39 | O process(@NonNull I item);
40 | }
41 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamFluxReaderProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 |
24 | import reactor.core.publisher.Flux;
25 |
26 | /**
27 | * A {@link Flux} based adapter for stream reader, processor. It can represent
28 | * {@link ItemStreamReader}, {@link ItemProcessor} in a single class.
29 | *
30 | * @since 1.2.0
31 | */
32 | public interface ItemStreamFluxReaderProcessor
33 | extends ItemStreamFluxReaderDelegate, ItemProcessorDelegate {
34 | }
35 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamFluxReaderProcessorWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 | import org.springframework.batch.item.ItemStreamWriter;
24 |
25 | import reactor.core.publisher.Flux;
26 |
27 | /**
28 | * A {@link Flux} based adapter for stream reader, processor, writer. It can represent
29 | * {@link ItemStreamReader}, {@link ItemProcessor}, {@link ItemStreamWriter} in a single class.
30 | *
31 | * @since 1.1.0
32 | */
33 | public interface ItemStreamFluxReaderProcessorWriter
34 | extends ItemStreamFluxReaderDelegate, ItemProcessorDelegate, ItemStreamWriterDelegate {
35 | }
36 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamFluxReaderWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemStreamReader;
22 | import org.springframework.batch.item.ItemStreamWriter;
23 |
24 | import reactor.core.publisher.Flux;
25 |
26 | /**
27 | * A {@link Flux} based adapter for stream reader, writer. It can represent
28 | * {@link ItemStreamReader}, {@link ItemStreamWriter} in a single class.
29 | *
30 | * @since 1.1.0
31 | */
32 | public interface ItemStreamFluxReaderWriter extends ItemStreamFluxReaderDelegate, ItemStreamWriterDelegate {
33 | }
34 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamIterableReaderProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 |
24 | /**
25 | * An {@link Iterable} based adapter for stream reader, processor. It can represent
26 | * {@link ItemStreamReader}, {@link ItemProcessor} in a single class.
27 | *
28 | * @since 1.2.0
29 | */
30 | public interface ItemStreamIterableReaderProcessor
31 | extends ItemStreamIterableReaderDelegate, ItemProcessorDelegate {
32 | }
33 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamIterableReaderProcessorWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 | import org.springframework.batch.item.ItemStreamWriter;
24 |
25 | /**
26 | * An {@link Iterable} based adapter for stream reader, processor, writer. It can represent
27 | * {@link ItemStreamReader}, {@link ItemProcessor}, {@link ItemStreamWriter} in a single class.
28 | *
29 | * @since 1.1.0
30 | */
31 | public interface ItemStreamIterableReaderProcessorWriter
32 | extends ItemStreamIterableReaderDelegate, ItemProcessorDelegate, ItemStreamWriterDelegate {
33 | }
34 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamIterableReaderWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemStreamReader;
22 | import org.springframework.batch.item.ItemStreamWriter;
23 |
24 | /**
25 | * An {@link Iterable} based adapter for stream reader, writer. It can represent
26 | * {@link ItemStreamReader}, {@link ItemStreamWriter} in a single class.
27 | *
28 | * @since 1.1.0
29 | */
30 | public interface ItemStreamIterableReaderWriter
31 | extends ItemStreamIterableReaderDelegate, ItemStreamWriterDelegate {
32 | }
33 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamIteratorReaderProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import java.util.Iterator;
22 |
23 | import org.springframework.batch.item.ItemProcessor;
24 | import org.springframework.batch.item.ItemStreamReader;
25 |
26 | /**
27 | * An {@link Iterator} based adapter for stream reader, processor. It can represent
28 | * {@link ItemStreamReader}, {@link ItemProcessor} in a single class.
29 | *
30 | * @since 1.2.0
31 | */
32 | public interface ItemStreamIteratorReaderProcessor
33 | extends ItemStreamIteratorReaderDelegate, ItemProcessorDelegate {
34 | }
35 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamIteratorReaderProcessorWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import java.util.Iterator;
22 |
23 | import org.springframework.batch.item.ItemProcessor;
24 | import org.springframework.batch.item.ItemStreamReader;
25 | import org.springframework.batch.item.ItemStreamWriter;
26 |
27 | /**
28 | * An {@link Iterator} based adapter for stream reader, processor, writer. It can represent
29 | * {@link ItemStreamReader}, {@link ItemProcessor}, {@link ItemStreamWriter} in a single class.
30 | *
31 | * @since 1.1.0
32 | */
33 | public interface ItemStreamIteratorReaderProcessorWriter
34 | extends ItemStreamIteratorReaderDelegate, ItemProcessorDelegate, ItemStreamWriterDelegate {
35 | }
36 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamIteratorReaderWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import java.util.Iterator;
22 |
23 | import org.springframework.batch.item.ItemStreamReader;
24 | import org.springframework.batch.item.ItemStreamWriter;
25 |
26 | /**
27 | * An {@link Iterator} based adapter for stream reader, writer. It can represent
28 | * {@link ItemStreamReader}, {@link ItemStreamWriter} in a single class.
29 | *
30 | * @since 1.1.0
31 | */
32 | public interface ItemStreamIteratorReaderWriter
33 | extends ItemStreamIteratorReaderDelegate, ItemStreamWriterDelegate {
34 | }
35 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamSimpleReaderProcessor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 |
24 | /**
25 | * An item ({@link I}) based adapter for stream reader, processor. It can represent
26 | * {@link ItemStreamReader}, {@link ItemProcessor} in a single class.
27 | *
28 | * @since 1.2.0
29 | */
30 | public interface ItemStreamSimpleReaderProcessor
31 | extends ItemStreamSimpleReaderDelegate, ItemProcessorDelegate {
32 | }
33 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamSimpleReaderProcessorWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemProcessor;
22 | import org.springframework.batch.item.ItemStreamReader;
23 | import org.springframework.batch.item.ItemStreamWriter;
24 |
25 | /**
26 | * An item ({@link I}) based adapter for stream reader, processor, writer. It can represent
27 | * {@link ItemStreamReader}, {@link ItemProcessor}, {@link ItemStreamWriter} in a single class.
28 | *
29 | * @since 1.1.0
30 | */
31 | public interface ItemStreamSimpleReaderProcessorWriter
32 | extends ItemStreamSimpleReaderDelegate, ItemProcessorDelegate, ItemStreamWriterDelegate {
33 | }
34 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/ItemStreamSimpleReaderWriter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.navercorp.spring.batch.plus.step.adapter;
20 |
21 | import org.springframework.batch.item.ItemStreamReader;
22 | import org.springframework.batch.item.ItemStreamWriter;
23 |
24 | /**
25 | * An item ({@link T}) based adapter for stream reader, writer. It can represent
26 | * {@link ItemStreamReader}, {@link ItemStreamWriter} in a single class.
27 | *
28 | * @since 1.1.0
29 | */
30 | public interface ItemStreamSimpleReaderWriter
31 | extends ItemStreamSimpleReaderDelegate, ItemStreamWriterDelegate {
32 | }
33 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/main/java/com/navercorp/spring/batch/plus/step/adapter/package-info.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Spring Batch Plus
3 | *
4 | * Copyright 2022-present NAVER Corp.
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | /**
20 | * An extensions for spring batch step adapter concerns.
21 | */
22 | package com.navercorp.spring.batch.plus.step.adapter;
23 |
--------------------------------------------------------------------------------
/spring-batch-plus/src/test/resources/log4j2-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/spring-boot-autoconfigure-batch-plus-kotlin/README.md:
--------------------------------------------------------------------------------
1 | # Spring Boot AutoConfigure Batch Plus Kotlin Module
2 |
3 | - Provides Spring Boot Auto Configuration features for kotlin.
4 |
--------------------------------------------------------------------------------
/spring-boot-autoconfigure-batch-plus-kotlin/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.java-library-conventions")
3 | id("spring.batch.plus.kotlin-conventions")
4 | id("spring.batch.plus.maven-publish-conventions")
5 | }
6 |
7 | dependencies {
8 | compileOnly(project(":spring-batch-plus-kotlin"))
9 |
10 | compileOnly(libs.spring.boot.autoconfigure)
11 | compileOnly(libs.spring.batch.core)
12 |
13 | testImplementation(project(":spring-batch-plus-kotlin"))
14 | testImplementation(libs.bundles.test.kotlin)
15 | testImplementation(libs.spring.boot.autoconfigure)
16 | testImplementation(libs.spring.boot.test)
17 | testImplementation(libs.spring.batch.core)
18 | testImplementation(libs.spring.jdbc)
19 |
20 | testRuntimeOnly(libs.h2)
21 | }
22 |
--------------------------------------------------------------------------------
/spring-boot-autoconfigure-batch-plus-kotlin/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports:
--------------------------------------------------------------------------------
1 | com.navercorp.spring.boot.autoconfigure.batch.plus.kotlin.BatchPlusAutoConfiguration
2 |
--------------------------------------------------------------------------------
/spring-boot-autoconfigure-batch-plus/README.md:
--------------------------------------------------------------------------------
1 | # Spring Boot AutoConfigure Batch Plus Module
2 |
3 | - Provides Spring Boot Auto Configuration features for java.
4 |
--------------------------------------------------------------------------------
/spring-boot-autoconfigure-batch-plus/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.java-library-conventions")
3 | }
4 |
--------------------------------------------------------------------------------
/spring-boot-starter-batch-plus-kotlin/README.md:
--------------------------------------------------------------------------------
1 | # Spring Boot Starter Batch Plus Kotlin Module
2 |
3 | - Provides Spring Batch Plus related dependencies for kotlin except for Spring Batch itself.
4 |
--------------------------------------------------------------------------------
/spring-boot-starter-batch-plus-kotlin/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.java-library-conventions")
3 | id("spring.batch.plus.kotlin-conventions")
4 | id("spring.batch.plus.maven-publish-conventions")
5 | }
6 |
7 | dependencies {
8 | api(project(":spring-boot-autoconfigure-batch-plus-kotlin"))
9 | api(project(":spring-batch-plus-kotlin"))
10 | }
11 |
--------------------------------------------------------------------------------
/spring-boot-starter-batch-plus/README.md:
--------------------------------------------------------------------------------
1 | # Spring Boot Starter Batch Plus Module
2 |
3 | - Provides Spring Batch Plus related dependencies for java except for Spring Batch itself.
4 |
--------------------------------------------------------------------------------
/spring-boot-starter-batch-plus/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("spring.batch.plus.java-library-conventions")
3 | id("spring.batch.plus.maven-publish-conventions")
4 | }
5 |
6 | dependencies {
7 | api(project(":spring-batch-plus"))
8 | }
9 |
--------------------------------------------------------------------------------