This commit includes tests for the copy constructor
of AbstractTaskletStepBuilder and for the faultTolerant
method, specifically after taskExecutor has been set.
Before this commit, the destroy method of a job-scoped
bean was not called after a test method.
This commit changes the listener to respect the
DisposableBean contract for job-scoped beans (and make it
consistent with the calls to the JobSynchronizationManager
in AbstractJob, ie calling register/release).
FTR, I did not find a clean way to test this with an
assertion (which should be made after the test method),
but a log message in the destroy method shows that the
method is now called as expected.
Resolves#1288
Before this commit, SimpleJobRepository#deleteJobExecution
did not delete associated step executions as specified in the
contract of the method.
This commit fixes the implementation to delete the entire
object graph as specified.
Resolves#4249
Before this commit, the parsing of job parameters in
JobOperator#start and MetaDataInstanceFactory#createJobExecution
was accepting the comma separated key=value pairs format,
which is incompatible with the new job parameters format
introduced in v5.
This commit updates the contract as well as the implementation
of those APIs to be compatible with v5.
Resolves#4253Resolves#4301
Consistently use Assert.state in the afterPropertiesSet()
methods to throw IllegalStateException instead of
IllegalArgumentException when some properties are missing
and/or invalid.
Resolves#2244
This commit changes the type of fields `startTime`, `endTime`,
`createTime` and `lastUpdated` in `JobExecution` and `StepExecution`
from `java.util.Date` to `java.time.LocalDateTime`.
Resolves#1014
Before this commit, the user had to manually set the job repository and transaction
manager on `JobBuilder` and `StepBuilder` instances with a chained call to
`.repository(jobRepository)` and `.transactionManager(transactionManager)`.
This is error prone and can lead to runtime errors if these properties are not set.
This commit introduces new APIs to guide the user to set these properties at
builder creation time.
Resolves#4192
This commit deprecates JobBuilderFactory and StepBuilderFactory
in favor of the respective builders they create.
It also removes the exposure of such utilities as beans in the
application context when using `@EnableBatchProcessing`.
Resolves https://github.com/spring-projects/spring-batch/issues/4188
Before this commit, the transaction manager was configurable
at the StepBuilder level, which is inconsistent with the XML
config style in addition to be not needed for most step types.
This commit moves the configuration of the transaction manager
from the StepBuilder down to the AbstractTaskletStepBuilder,
which is the level where the transaction manager is needed.
Resolves#4130
The side effect is a breaking change in that it will now
throw IllegalStateException instead of the Compare and
AssertExceptions provided by JUnit.
Resolves#4111
Before this commit, the `JobRepositoryTestUtils` was
tied to the JDBC implementation of the `JobRepository`
as it was requiring a datasource. This makes it unusable
with implementations that do not rely on a datasource
to store batch meta-data (A MongoDB job repository for
instance where no datasource is used).
This commit decouples the `JobRepositoryTestUtils` from
the implementation details of the `JobRepository` by making
it working against the `JobRepository` interface.
This commit also introduces the necessary methods in the
`JobRepository` interface as well as various DAOs to
implement the utilities without having to deal with the
details of the underlying repository implementation.
Resolves#4070
Before this commit, trying to register a `JobRepositoryTestUtils` bean
in a test context that contains multiple datasources fails at startup,
because a datasource is autowired in `JobRepositoryTestUtils` while
multiple are defined.
This commit removes the autowiring of the datasource in JobRepositoryTestUtils.
Resolves#4178
Before this commit, registering the JobLauncherTestUtils
as a bean in the test context (either manually or via
`@SpringBatchTest`) was failing when multiple jobs are
defined in the test context.
This commit removes the autowiring of the job under test
in JobLauncherTestUtils.
Resolves#1237
This commit replaces the usage of List with Chunk
where appropriate. Summary of changes:
- The Chunk class was moved from the `org.springframework.batch.core.step.item` package to the `org.springframework.batch.item` package
- The signature of the method `ItemWriter#write(List)` was changed to `ItemWriter#write(Chunk)`
- All implementations of `ItemWriter` were updated to use the Chunk API instead of List
- All methods in the `ItemWriteListener` interface were updated to use the Chunk API instead of List
- All implementations of `ItemWriteListener` were updated to use the Chunk API instead of List
- The constructor of `ChunkRequest` was changed to accept a Chunk instead of a Collection of items
- The return type of `ChunkRequest#getItems()` was changed from List to Chunk
Resolves#3954
This commits changes the type of the transaction manager
from `DataSourceTransactionManager` to `JdbcTransactionManager`
in the default configuration of `@EnableBatchProcessing`.
The `JdbcTransactionManager` adds common JDBC exception translation
which is beneficial for Spring Batch to improve exception handling
and error reporting.
Resolves#4126