There is no such concept of job Id. A job has a name but not an Id.
A job instance however has an Id. The goal of the getter suggested in
BATCH-2769 is to access the JobInstance Id.
This commit renames the newly added StepContext#getJobId to
StepContext#getJobInstanceId which is more explicit.
Resolves BATCH-2769
Castor support will be removed in SF v5.2. This commit removes
CastorMarshallingTests and CastorUnmarshallingTests as they do not
compile with SF v5.2.0.BUILD-SNAPSHOT.
Resolves BATCH-2787
This commit fixes the following warnings:
```
$ ./gradlew clean --warning-mode all
> Configure project :
The Task.leftShift(Closure) method has been deprecated.
This is scheduled to be removed in Gradle 5.0.
Please use Task.doLast(Action) instead.
at build_1u4zf89udullsb7m3yccjzfxt$_run_closure3.doCall(/spring-batch/build.gradle:187)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
Creating a custom task named 'wrapper' has been deprecated.
This is scheduled to be removed in Gradle 5.0.
You can configure the existing task using the 'wrapper { }' syntax or
create your custom task under a different name.
at build_1u4zf89udullsb7m3yccjzfxt.run(/spring-batch/build.gradle:921)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
BUILD SUCCESSFUL in 3s
10 actionable tasks: 1 executed, 9 up-to-date
```
It also fixes the following warning about annotation processing:
```
Detecting annotation processors on the compile classpath has been deprecated.
Gradle 5.0 will ignore annotation processors on the compile classpath.
If you did not intend to use annotation processors,
you can use the '-proc:none' compiler argument to ignore them.
```
References:
* Spring Boot issue #6421
* https://discuss.gradle.org/t/regarding-the-annotation-processors-on-compile-classpath-warning-in-gradle-4-6
Tests modified in this change set fail randomly due to shared
mutable state between multiple threads.
This commit ensures that the shared state is correctly
synchronised between threads or re-initialized before each test run.
The command `ping 1.1.1.1 -n 1 -w 5000` sends only one packet to the
remote address and might finish before the configured timeout of 10ms
which makes some tests to fail. Moreover, pinging 1.1.1.1 requires the
host (which can be the CI build server) to have internet connection.
This command can also fail if there is no internet connection which
makes some tests (expecting the command to succeed) to fail too.
This commit uses the command `ping 127.0.0.1` which does not require
an internet connection and which will, by default [1], send 4 packets
and wait for a timeout of 4 seconds for each request. This should take
more time than the configured timeout of 10ms.
Resolves BATCH-2722
[1]: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ping
The `testMultipleSimultaneousInstances` test uses a SimpleAsyncTaskExecutor.
This means when a job is submitted, a new thread will be created to run
the job. However, there could be a small time interval between
JobOperator.startNextInstance(job) and
JobOperator.findRunningExecutions(job) where the job execution is created
but not started yet. When this happens, the test fails as
`findRunningExecutions` does not return the just created
(but not started yet) execution.
This commit adds a `Thread.sleep` between these two invocations in order
to give a chance to the background thread (to be created and) to execute
the job.