Commit Graph

286 Commits

Author SHA1 Message Date
Marvin Deng
bbf35b79f7 Make the meaning of running status consistent
- A running status is STARTING, STARTED, or STOPPING.
- Update related tests.

 Resolves #1483
2022-11-17 15:40:29 +01:00
Mahmoud Ben Hassine
930bb0243c Implement default methods in SimpleJobRepository
Resolves #4229
2022-11-16 16:11:33 +01:00
Mahmoud Ben Hassine
05bbd3f7ea Remove dependency autowiring in test utilities
Issue #4233
2022-11-16 14:21:17 +01:00
Spring Builds
e273ec151e [artifactory-release] Next development version 2022-11-09 14:34:37 +00:00
Spring Builds
420a7baa75 [artifactory-release] Release version 5.0.0-RC2 2022-11-09 14:34:34 +00:00
Mahmoud Ben Hassine
1527593a36 Refine contribution #4218
* Update Javadoc of SpringBatchTest about job autowiring
* Apply Spring code style conventions
2022-11-08 13:45:13 +01:00
Henning Poettker
3bb7ce532b Improve @SpringBatchTest to autowire the job under test in JobLauncherTestUtils if it is unique
Issue #4218
2022-11-08 13:16:36 +01:00
Mahmoud Ben Hassine
d889f84735 Remove the static configuration of Micrometer's observation registry
Resolves #4222
2022-11-08 07:48:45 +01:00
Spring Builds
24283a8a1f [artifactory-release] Next development version 2022-10-19 23:57:21 +00:00
Spring Builds
adde7d764e [artifactory-release] Release version 5.0.0-RC1 2022-10-19 23:57:18 +00:00
Mahmoud Ben Hassine
866fe37eb0 Exclude Jackson from transitive dependencies 2022-10-19 11:28:54 +02:00
Spring Builds
58c760b3ef [artifactory-release] Next development version 2022-10-13 10:34:01 +00:00
Spring Builds
87f3644667 [artifactory-release] Release version 5.0.0-M8 2022-10-13 10:33:58 +00:00
Mahmoud Ben Hassine
bef2588207 Deprecate DataSourceInitializer 2022-10-12 18:49:31 +02:00
Mahmoud Ben Hassine
1a65c00b8d Change type of timestamp fields in JobExecution/StepExecution to LocalDateTime
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
2022-10-11 22:09:16 +02:00
Spring Builds
58ce4fecac [artifactory-release] Next development version 2022-10-05 04:16:28 +00:00
Spring Builds
771c14f00d [artifactory-release] Release version 5.0.0-M7 2022-10-05 04:16:25 +00:00
Mahmoud Ben Hassine
2660f2bb27 Add support to use any type as a job parameter
This commit also changes the way job parameters
are parsed and persisted.

NB: This commit should ideally have been split
into two change sets. But the changes are tightly
related that is was not possible to separate them.

Related to:

* https://github.com/spring-projects/spring-batch/issues/3960
* https://github.com/spring-projects/spring-batch/issues/2122
* https://github.com/spring-projects/spring-batch/issues/1035
* https://github.com/spring-projects/spring-batch/issues/1983
2022-10-04 20:35:50 +02:00
Spring Builds
83ef59ac5e [artifactory-release] Next development version 2022-09-21 18:35:32 +00:00
Spring Builds
ba7cad4ad8 [artifactory-release] Release version 5.0.0-M6 2022-09-21 18:35:29 +00:00
Mahmoud Ben Hassine
f39f07075a Improve Step/Job builder APIs to guide users to set mandatory properties
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
2022-09-17 22:31:12 +02:00
Mahmoud Ben Hassine
6e443cb1b1 Deprecate Job/Step builder factories
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
2022-09-13 16:56:01 +02:00
Tadaya Tsuyukubo
1ff720545f Adapt SampleTestRunner change in micrometer tracing
Accommodate the breaking change in `SampleTestRunner` introduced by
https://github.com/micrometer-metrics/tracing/pull/57
2022-09-09 15:38:30 +02:00
Mahmoud Ben Hassine
7c8fb172a7 Move the transaction manager configuration to AbstractTaskletStepBuilder
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
2022-09-08 11:35:14 +02:00
Mahmoud Ben Hassine
4d548d9a49 Exclude junit-jupiter from micrometer test dependencies 2022-09-07 17:05:06 +02:00
Spring Builds
878578f829 [artifactory-release] Next development version 2022-08-24 17:14:59 +00:00
Spring Builds
7fc0af6785 [artifactory-release] Release version 5.0.0-M5 2022-08-24 17:14:56 +00:00
Mahmoud Ben Hassine
4d0ed63dd7 Deprecate AssertFile
Resolves #4181
2022-08-24 15:17:34 +02:00
Glenn Renfro
8ca9802da4 Remove the JUnit dependency in AssertFile
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
2022-08-24 10:29:45 +02:00
Mahmoud Ben Hassine
c425137eec Remove datasource dependency in JobRepositoryTestUtils
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
2022-08-23 21:33:06 +02:00
Mahmoud Ben Hassine
f104baa417 Remove datasource autowiring in JobRepositoryTestUtils
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
2022-08-21 13:36:37 +02:00
Mahmoud Ben Hassine
c506a49988 Remove job autowiring in JobLauncherTestUtils
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
2022-08-20 12:39:02 +02:00
Mahmoud Ben Hassine
e67c0069f1 Use the Chunk API consistently
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
2022-08-19 13:40:09 +02:00
Henning Poettker
6117c044fb Migrate Spring Batch Test to JUnit Jupiter 2022-08-02 17:07:43 +02:00
Spring Builds
08adb4550a [artifactory-release] Next development version 2022-07-21 03:17:06 +00:00
Spring Builds
d46aeef01d [artifactory-release] Release version 5.0.0-M4 2022-07-21 03:17:03 +00:00
Marvin Deng
c0791039dc Rename SimpleJobLauncher to TaskExecutorJobLauncher
Resolves #4123
2022-07-19 13:34:23 +02:00
Mahmoud Ben Hassine
565ddcdf96 Change transaction manager type in default batch configuration
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
2022-07-16 17:52:43 +02:00
Mahmoud Ben Hassine
c4ad90b9b1 Apply spring-javaformat style for consistency with other projects
Resolves #4118
2022-05-25 23:06:48 +02:00
Spring Builds
b9bc4c1488 [artifactory-release] Next development version 2022-05-19 01:22:57 +00:00
Spring Builds
a99f1c8645 [artifactory-release] Release version 5.0.0-M3 2022-05-19 01:22:54 +00:00
Starchenko Ilya
ad92d2a6c9 Fix Javadoc of SpringBatchTest annotation
fix double @-symbol in javadoc

Issue #4102
2022-04-27 15:14:20 +02:00
Danilo Piazzalunga
200724dd0f Make JUnit 4 an optional dependency in spring-batch-test
Resolves #4033
2022-04-01 16:28:32 +02:00
Moritz Halbritter
404e0a3dbd Update to Micrometer 2.0.0-SNAPSHOT
See gh-4079
2022-03-25 09:37:18 +01:00
Spring Builds
437f4797f8 [artifactory-release] Next development version 2022-03-23 11:57:35 +00:00
Spring Builds
273ddeed90 [artifactory-release] Release version 5.0.0-M2 2022-03-23 11:57:32 +00:00
Mahmoud Ben Hassine
ae6c0b9809 Refine contribution #4065
* Fix tests
* Update Javadocs
* Update year in license headers
* Move observability APIs to a separate package
2022-03-16 17:03:14 +01:00
Marcin Grzejszczak
e917d75d20 Add Observation API
Issue #4065
2022-03-16 16:14:50 +01:00
Spring Builds
75b1492039 [artifactory-release] Next development version 2022-01-19 12:13:24 +00:00
Spring Builds
a06a866410 [artifactory-release] Release version 5.0.0-M1 2022-01-19 12:13:21 +00:00