Commit Graph

1194 Commits

Author SHA1 Message Date
Mahmoud Ben Hassine
a031637994 Add integration tests for all supported databases
Resolves #3092
2021-07-06 14:45:14 +02:00
Taeik Lim
4af4b05e33 Fix NPE in JobParameters.toProperties on null parameter value
Issue #834
2021-05-18 15:55:04 +02:00
Mark Bonnekessel
a43d3a5ab7 Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder
Override SimpleStepBuilder.faultTolerant() in FaultTolerantStepBuilder
to prevent creation of a new FaultTolerantStepBuilder when calling
faultTolerant() on an existing FaultTolerantStepBuilder. Otherwise
configuration, like chunkListeners, are lost.

Issue #3840
2021-05-11 19:09:49 +02:00
Parikshit Dutta
58e82a56e7 Update SimpleStepBuilder to assign ItemProcessor lambda at construction
Issue #3749
2021-05-11 16:14:29 +02:00
Mahmoud Ben Hassine
7f0824b9da Fix job execution validation in SimpleJobRepository
Before this commit, the logic that validates if a job
instance is complete or not was based only on the size
of previous parameters, without checking if they are
identifying or not.

This commit introduces a change that uses only
identifying job parameters to identify a job instance
and validate its previous executions.

Issue #1221
2021-05-05 16:20:28 +02:00
Mahmoud Ben Hassine
c4b001b732 Remove usage of deprecated APIs from testcontainers 2021-05-04 12:21:58 +02:00
Mahmoud Ben Hassine
b8a6a51488 Rename MySQLJdbcJobRepositoryTests to MySQLJdbcJobRepositoryIntegrationTests
Since this is a Docker based test, it should be part
of the integration test suite executed by
maven-failsafe-plugin during the `verify` phase.
2021-05-04 12:04:19 +02:00
Mahmoud Ben Hassine
5fbbad9888 Disable SSL usage in MySQL test container
By default, testcontainers does not use SSL. This commit
disable SSL usage in the datasource configuration to
prevent `SSLHandshakeException`s.
2021-05-04 11:21:33 +02:00
Mahmoud Ben Hassine
1d23d66e27 Add java.sql.Timestamp to trusted classes in Jackson serializer
Resolves #3855
2021-03-01 13:39:35 +01:00
Mahmoud Ben Hassine
602656a241 Polish contribution 58b2a7a2
* Update year in license headers
* Refactor test
2021-03-01 11:25:42 +01:00
Jagger
58b2a7a26b Add Arrays$ArrayList to trusted classes in Jackson serializer
Issue #3830
2021-03-01 11:24:19 +01:00
Mahmoud Ben Hassine
fc113be4a7 Temporarily ignore intermittently failing tests
This commit temporarily ignores tests that are failing
intermittently on Windows. A link to the corresponding
issue has been added to each test.

FTR, I tried to ignore those tests only on Windows by
using `Assume.assumeFalse(SystemUtils.IS_OS_WINDOWS);`
where `SystemUtils` is from `org.apache.commons.lang3`
but this assumption does not seem to work as expected.
2021-02-18 18:09:40 +01:00
Mahmoud Ben Hassine
d0493906a8 Replace usage of "build" directory with "target" 2021-01-29 11:45:34 +01:00
Mahmoud Ben Hassine
236ee88dcf Merge spring-batch-core-tests in spring-batch-core 2020-12-04 16:03:58 +01:00
Mahmoud Ben Hassine
f8f5cf2fb4 Fix ignored tests 2020-12-03 17:35:23 +01:00
Mahmoud Ben Hassine
ac9a0d2718 Remove ignored test suites
Signed-off-by: Mahmoud Ben Hassine <mbenhassine@vmware.com>
2020-12-03 15:38:44 +01:00
Henning Poettker
b6c3fb6d8c Fix NullPointerException when creating job executions for job instances without executions 2020-11-26 16:27:42 +01:00
Mahmoud Ben Hassine
98fba4a03b Fix PartitionParserTests
Some tests in PartitionParserTests were
failing intermittently due to the usage
of non-synchronized shared state between
concurrent threads.

This commit updates the test code to use
`AtomicInteger` instead of `int` for the
state shared between concurrent threads.
2020-11-18 16:50:11 +01:00
Mahmoud Ben Hassine
cf2642223d Fix OptimisticLockingFailureTests#testAsyncStopOfStartingJob
This test was failing intermittently due to an incorrect
way of waiting for a job execution to finish, which is:

```
while(jobExecution.isRunning()) {
   // wait for async launched job to complete execution
}
```

`JobExecution#isRunning()` is based on the status
of the job execution in memory which might not be
persisted yet. Here is an excerpt from the Javadoc:

```
Test if this JobExecution indicates that it is
running. It should be noted that this does not
necessarily mean that it has been persisted as
such yet.
```

That's why in the case where `isRunning` returns
false and the JobExecution is not persisted yet
(which is still in a running status in db),
the second attempt of re-running the job fails
with a `JobExecutionAlreadyRunningException`.

This commit fixes the loop by continuously
checking the status of the Job execution
in the job repository until it reaches one
of the end statuses.

Issue #1121
2020-11-18 16:50:10 +01:00
Mahmoud Ben Hassine
1090731302 Fix flaky tests
JsrSplitParsingTests#test and DecisionStepTests#testDecisionAfterSplit
were failing intermittently with:

```
org.springframework.batch.core.JobExecutionException: Flow execution ended unexpectedly
    at org.springframework.batch.core.jsr.job.flow.JsrFlowJob.doExecute(JsrFlowJob.java:88) ~[main/:?]
    at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:320) [main/:?]
    at org.springframework.batch.core.jsr.launch.JsrJobOperator$2.run(JsrJobOperator.java:674) [main/:?]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_232]
Caused by: org.springframework.batch.core.job.flow.FlowExecutionException: Ended flow=flow1.step1 at state=flow1.step1.flow1.step1 with exception
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:178) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
Caused by: org.springframework.dao.ConcurrencyFailureException: PreparedStatementCallback; SQL [INSERT INTO BATCH_STEP_EXECUTION_CONTEXT (SHORT_CONTEXT, SERIALIZED_CONTEXT, STEP_EXECUTION_ID) VALUES(?, ?, ?)]; transaction rollback: serialization failure; nested exception is java.sql.SQLTransactionRollbackException: transaction rollback: serialization failure
    at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:73) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1541) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:667) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:236) ~[main/:?]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.saveExecutionContext(JdbcExecutionContextDao.java:189) ~[main/:?]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.add(SimpleJobRepository.java:177) ~[main/:?]
    at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:371) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:134) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.0.jar:5.3.0]
    at com.sun.proxy.$Proxy41.add(Unknown Source) ~[?:?]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68) ~[main/:?]
    at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
Caused by: java.sql.SQLTransactionRollbackException: transaction rollback: serialization failure
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:965) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:236) ~[main/:?]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.saveExecutionContext(JdbcExecutionContextDao.java:189) ~[main/:?]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.add(SimpleJobRepository.java:177) ~[main/:?]
    at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:371) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:134) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.0.jar:5.3.0]
    at com.sun.proxy.$Proxy41.add(Unknown Source) ~[?:?]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68) ~[main/:?]
    at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
Caused by: org.hsqldb.HsqlException: transaction rollback: serialization failure
    at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.Session.handleAbortTransaction(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.Session.executeCompiledStatement(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.Session.execute(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.fetchResult(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.hsqldb.jdbc.JDBCPreparedStatement.executeUpdate(Unknown Source) ~[hsqldb-2.5.1.jar:2.5.1]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:136) ~[commons-dbcp2-2.8.0.jar:2.8.0]
    at org.springframework.jdbc.core.JdbcTemplate.lambda$update$2(JdbcTemplate.java:965) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:960) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:1015) ~[spring-jdbc-5.3.0.jar:5.3.0]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.persistSerializedContext(JdbcExecutionContextDao.java:236) ~[main/:?]
    at org.springframework.batch.core.repository.dao.JdbcExecutionContextDao.saveExecutionContext(JdbcExecutionContextDao.java:189) ~[main/:?]
    at org.springframework.batch.core.repository.support.SimpleJobRepository.add(SimpleJobRepository.java:177) ~[main/:?]
    at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_232]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_232]
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:371) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:134) ~[spring-tx-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.0.jar:5.3.0]
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:215) ~[spring-aop-5.3.0.jar:5.3.0]
    at com.sun.proxy.$Proxy41.add(Unknown Source) ~[?:?]
    at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:68) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:68) ~[main/:?]
    at org.springframework.batch.core.jsr.job.flow.support.state.JsrStepState.handle(JsrStepState.java:53) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:169) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:94) ~[main/:?]
    at org.springframework.batch.core.job.flow.support.state.SplitState$1.call(SplitState.java:91) ~[main/:?]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_232]
    ... 1 more
```

This failure is due to a concurrency issue when executing
the split flow with the default SimpleAsyncTaskExecutor.

Several attempts have been made to fix this issue with no success:

* use `@DirtiesContext` annotation
* use a separate db for each test
* use `READ_COMMITTED` isolation level in the job repository
* downgrade hsqldb from v2.5.1 to v2.4.1 (since v2.5.1 has
introduced several changes in the MVCC mode)

The issue seems to be related to how the in-memory database
is shared between tests *and* how the test context is cached
(ie the combination of both).

This commit moves these tests to a separate test class which
seem to fix the issue.
2020-11-18 16:50:10 +01:00
Mahmoud Ben Hassine
287eace69f Remove unused code in DecisionStepTests 2020-11-17 11:28:02 +01:00
Mahmoud Ben Hassine
f2c1296e7f Fix ClassCastException in RunIdIncrementer
Before this commit, the RunIdIncrementer was failing
with a ClassCastException if the run.id parameter is
not passed as a Long.

This commit makes the RunIdIncrementer more liberal
in what it accepts by trying to parse the parameter
to a Long.

Resolves #3799
2020-11-09 11:54:22 +01:00
Mahmoud Ben Hassine
791cfd5e8a Polish 0c500794f6
This commit adds a test case for building a flow
job with a job-scoped step.

Issue #857
2020-10-27 14:40:39 +01:00
Mahmoud Ben Hassine
a0bcd7ce45 Add ability to amend trusted classes in Jackson2ExecutionContextStringSerializer
This commit adds the ability to specify additional trusted
classes without having to provide a custom object mapper.

Issue #3765
2020-10-16 11:36:18 +02:00
Mahmoud Ben Hassine
744d1834fe Add support for annotation based listeners in JobBuilder
Resolves #817
2020-08-21 10:31:03 +02:00
Mahmoud Ben Hassine
a333c16459 Add JobParametersIncrementer implementation based on a DataFieldMaxValueIncrementer
Issue #1521
2020-08-11 21:13:20 +02:00
Mahmoud Ben Hassine
9a79b4572d Update Jackson2ExecutionContextStringSerializer 2020-06-10 20:11:08 +02:00
Baris Cubukcuoglu
b50c665f04 Add method StepExecutionDao.countStepExecutions to eliminate for-loop in SimpleJobRepository.getStepExecutionCount
Resolves #3657
2020-04-24 07:08:46 +02:00
Mahmoud Ben Hassine
6cca32fde0 Fix metrics collection in FaultTolerantChunkProcessor
Before this commit, metrics were not collected in a fault-tolerant step.
This commit updates the FaultTolerantChunkProcessor to collect metrics.

For the record, chunk scanning is not covered for two reasons:

1. When scanning a chunk, there is a single item in each write operation,
so it would be incorrect to report a metric called "chunk.write" for a
single item. We could argue that it is a singleton chunk, but still..
If we want to time scanned (aka individual) items, we need a more fine
grained timer called "scanned.item.write" for example.

2. The end result can be confusing and might distort the overall metrics
view in case of errors (because of the noisy metrics of additional transactions
for individual items).

As a reminder, the goal of the "chunk.write" metric is to give an overview
of the write operation time of the whole chunk and not to time each item
individually (this could be done using an `ItemWriteListener` if needed).

Resolves #3664
2020-03-31 16:37:12 +02:00
Michael Minella
8e8f9c8101 Added comparitor for state transitions when using java config
Spring Batch orders the transitions as it goes from state to state based
on specificity.  The XML configuration has always had this
functionality.  However, when creating the JSR-352 implementation, the
mechanism for which this occured was refactored.  That occured at about
the same time as the java builders were introduced.  Because of this
crossing of paths, the java configuration option for defining jobs has
never correctly sorted the transitions.  This PR applys the sorting
algorithm to the java configuration, making XML and java configuration
behave the same.

Resolves #3638
2020-02-07 16:27:12 +01:00
Mahmoud Ben Hassine
5b46c919ea Deprecate ListPreparedStatementSetter in favor of ArgumentPreparedStatementSetter
ListPreparedStatementSetter is almost a duplicate of
ArgumentPreparedStatementSetter except that it accepts a List of
arguments instead of an array of arguments.

Resolves BATCH-2796
2019-09-27 11:05:33 +02:00
Mahmoud Ben Hassine
2306141826 Polish a7092a21e4 2019-09-17 17:06:44 +02:00
mikeldpl
a7092a21e4 Added @Nullable annotation to overriding methods.
Resolves BATCH-2839
2019-09-17 16:50:44 +02:00
Mahmoud Ben Hassine
62a8f441ab Improve the performance of step partitioning
This commit improves the performance of splitting a step execution.
It moves the logic of finding the last step execution of a job instance
to the database (instead of doing it in memory).

Resolves BATCH-2716
2019-09-05 13:47:53 -05:00
Michael Minella
117e52bde5 Updates 2019-08-02 22:02:10 -05:00
Michael Minella
4fa15dd53d Still working on the DecisionStepTests#testDecisionAfterSplit 2019-08-02 21:57:50 -05:00
Michael Minella
4287f5a2ce Updated to address DecisionStepTests#testDecisionAfterSplit occasional failure 2019-08-02 21:28:49 -05:00
Michael Minella
4b9554fcce Polish 2019-08-02 14:33:45 -05:00
Mahmoud Ben Hassine
872845cae8 Improve the lookup for running job executions in CommandLineJobRunner
Before this commit, getting the running job executions loaded
all job executions from the database and filtered them in-memory.

This commit uses `JobExplorer#findRunningJobExecutions` which issues
a query that does the filtering on the database side. This change
considerably improves the performance of stopping a job.

Resolves BATCH-2422
2019-07-26 10:24:20 -05:00
Mahmoud Ben Hassine
7c1fbede1b Add new methods to get the last job instance/execution in JobInstance/JobExecution DAOs
Before this commit, getting the last job instance/execution required to
load all job instances/executions from the database and filter them
on the client side in memory.

This commit introduces new methods that use database queries to get
the last job instance/execution without the need to load all job
instances/executions. This change improves memory consumption as well as
the performance of starting the next instance of a job.

Resolves BATCH-1784
2019-07-25 10:56:19 -05:00
Mahmoud Ben Hassine
56bd4d651d Update Spring Framework version to 5.2.0.M2 2019-05-13 22:40:23 +02:00
Spring Operator
d8fc58338d URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/ with 2 occurrences migrated to:
  https://www.apache.org/licenses/ ([https](https://www.apache.org/licenses/) result 200).
* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 1796 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-22 10:08:19 +01:00
Spring Operator
758e6f30de URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* [ ] http://erik.eae.net/archives/2007/07/27/18.54.15/ (200) with 1 occurrences could not be migrated:
   ([https](https://erik.eae.net/archives/2007/07/27/18.54.15/) result SSLHandshakeException).
* [ ] http://gregfranko.com/jquery.tocify.js/ (200) with 1 occurrences could not be migrated:
   ([https](https://gregfranko.com/jquery.tocify.js/) result SSLHandshakeException).
* [ ] http://javascript.nwbox.com/IEContentLoaded/ (200) with 1 occurrences could not be migrated:
   ([https](https://javascript.nwbox.com/IEContentLoaded/) result SSLHandshakeException).
* [ ] http://jeremyworboys.com/writing/toggle-buttons-without-javascript (200) with 1 occurrences could not be migrated:
   ([https](https://jeremyworboys.com/writing/toggle-buttons-without-javascript) result SSLHandshakeException).
* [ ] http://nicolasgallagher.com/micro-clearfix-hack/ (200) with 1 occurrences could not be migrated:
   ([https](https://nicolasgallagher.com/micro-clearfix-hack/) result SSLHandshakeException).
* [ ] http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html (200) with 1 occurrences could not be migrated:
   ([https](https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html) result SSLException).
* [ ] http://blindsignals.com/index.php/2009/07/jquery-delay/ (301) with 1 occurrences could not be migrated:
   ([https](https://blindsignals.com/index.php/2009/07/jquery-delay/) result SSLHandshakeException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://jsperf.com/getall-vs-sizzle/2 (301) with 1 occurrences migrated to:
  https://jsperf.com/getall-vs-sizzle/2 ([https](https://jsperf.com/getall-vs-sizzle/2) result ReadTimeoutException).
* [ ] http://wiki.ecmascript.org/doku.php?id=harmony:egal (ConnectTimeoutException) with 1 occurrences migrated to:
  https://wiki.ecmascript.org/doku.php?id=harmony:egal ([https](https://wiki.ecmascript.org/doku.php?id=harmony:egal) result ConnectTimeoutException).
* [ ] http://www.w3.org/Addressing/URL (ReadTimeoutException) with 1 occurrences migrated to:
  https://www.w3.org/Addressing/URL ([https](https://www.w3.org/Addressing/URL) result SSLException).
* [ ] http://api.example.com (UnknownHostException) with 1 occurrences migrated to:
  https://api.example.com ([https](https://api.example.com) result UnknownHostException).
* [ ] http://jira.codehaus.org/browse/WSTX-165 (UnknownHostException) with 1 occurrences migrated to:
  https://jira.codehaus.org/browse/WSTX-165 ([https](https://jira.codehaus.org/browse/WSTX-165) result UnknownHostException).
* [ ] http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ (301) with 1 occurrences migrated to:
  https://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ ([https](https://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/) result 404).
* [ ] http://help.github.com/send-pull-requests (404) with 1 occurrences migrated to:
  https://help.github.com/send-pull-requests ([https](https://help.github.com/send-pull-requests) result 404).
* [ ] http://json.org/json2.js (404) with 1 occurrences migrated to:
  https://json.org/json2.js ([https](https://json.org/json2.js) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://backbonejs.org with 1 occurrences migrated to:
  https://backbonejs.org ([https](https://backbonejs.org) result 200).
* [ ] http://bugs.jquery.com/ticket/12282 with 1 occurrences migrated to:
  https://bugs.jquery.com/ticket/12282 ([https](https://bugs.jquery.com/ticket/12282) result 200).
* [ ] http://bugs.jquery.com/ticket/12359 with 1 occurrences migrated to:
  https://bugs.jquery.com/ticket/12359 ([https](https://bugs.jquery.com/ticket/12359) result 200).
* [ ] http://bugs.jquery.com/ticket/13378 with 1 occurrences migrated to:
  https://bugs.jquery.com/ticket/13378 ([https](https://bugs.jquery.com/ticket/13378) result 200).
* [ ] http://db.apache.org/derby/papers/versionupgrade.html with 1 occurrences migrated to:
  https://db.apache.org/derby/papers/versionupgrade.html ([https](https://db.apache.org/derby/papers/versionupgrade.html) result 200).
* [ ] http://diveintohtml5.info/history.html with 1 occurrences migrated to:
  https://diveintohtml5.info/history.html ([https](https://diveintohtml5.info/history.html) result 200).
* [ ] http://docs.oracle.com/javase/tutorial/java/generics/capture.html with 2 occurrences migrated to:
  https://docs.oracle.com/javase/tutorial/java/generics/capture.html ([https](https://docs.oracle.com/javase/tutorial/java/generics/capture.html) result 200).
* [ ] http://github.com/spring-projects/spring-batch with 1 occurrences migrated to:
  https://github.com/spring-projects/spring-batch ([https](https://github.com/spring-projects/spring-batch) result 200).
* [ ] http://jira.spring.io/browse/BATCH-1681 with 1 occurrences migrated to:
  https://jira.spring.io/browse/BATCH-1681 ([https](https://jira.spring.io/browse/BATCH-1681) result 200).
* [ ] http://jira.spring.io/browse/BATCH-761 with 1 occurrences migrated to:
  https://jira.spring.io/browse/BATCH-761 ([https](https://jira.spring.io/browse/BATCH-761) result 200).
* [ ] http://jquery.com/ with 1 occurrences migrated to:
  https://jquery.com/ ([https](https://jquery.com/) result 200).
* [ ] http://projects.spring.io/spring-batch/ with 2 occurrences migrated to:
  https://projects.spring.io/spring-batch/ ([https](https://projects.spring.io/spring-batch/) result 200).
* [ ] http://projects.spring.io/spring-batch/faq.html with 1 occurrences migrated to:
  https://projects.spring.io/spring-batch/faq.html ([https](https://projects.spring.io/spring-batch/faq.html) result 200).
* [ ] http://projects.spring.io/spring-integration/ with 1 occurrences migrated to:
  https://projects.spring.io/spring-integration/ ([https](https://projects.spring.io/spring-integration/) result 200).
* [ ] http://sizzlejs.com/ with 2 occurrences migrated to:
  https://sizzlejs.com/ ([https](https://sizzlejs.com/) result 200).
* [ ] http://spring.io/guides/gs/batch-processing/ with 1 occurrences migrated to:
  https://spring.io/guides/gs/batch-processing/ ([https](https://spring.io/guides/gs/batch-processing/) result 200).
* [ ] http://spring.io/projects with 1 occurrences migrated to:
  https://spring.io/projects ([https](https://spring.io/projects) result 200).
* [ ] http://spring.io/tools with 1 occurrences migrated to:
  https://spring.io/tools ([https](https://spring.io/tools) result 200).
* [ ] http://spring.io/tools/sts/ with 1 occurrences migrated to:
  https://spring.io/tools/sts/ ([https](https://spring.io/tools/sts/) result 200).
* [ ] http://stackoverflow.com/a/20002493/2910265 with 1 occurrences migrated to:
  https://stackoverflow.com/a/20002493/2910265 ([https](https://stackoverflow.com/a/20002493/2910265) result 200).
* [ ] http://stackoverflow.com/questions/134882/undoing-a-git-rebase with 1 occurrences migrated to:
  https://stackoverflow.com/questions/134882/undoing-a-git-rebase ([https](https://stackoverflow.com/questions/134882/undoing-a-git-rebase) result 200).
* [ ] http://underscorejs.org with 1 occurrences migrated to:
  https://underscorejs.org ([https](https://underscorejs.org) result 200).
* [ ] http://unlicense.org with 1 occurrences migrated to:
  https://unlicense.org ([https](https://unlicense.org) result 200).
* [ ] http://www.apache.org with 1 occurrences migrated to:
  https://www.apache.org ([https](https://www.apache.org) result 200).
* [ ] http://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd (301) with 1 occurrences migrated to:
  https://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/jobXML_1_0.xsd ([https](https://xmlns.jcp.org/xml/ns/javaee/jobXML_1_0.xsd) result 200).
* [ ] http://www.ow2.org/ with 1 occurrences migrated to:
  https://www.ow2.org/ ([https](https://www.ow2.org/) result 200).
* [ ] http://www.springframework.org/schema/beans/spring-beans.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans.xsd ([https](https://www.springframework.org/schema/beans/spring-beans.xsd) result 200).
* [ ] http://www.springframework.org/schema/integration/spring-integration.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/integration/spring-integration.xsd ([https](https://www.springframework.org/schema/integration/spring-integration.xsd) result 200).
* [ ] http://www.w3.org/TR/2011/REC-css3-selectors-20110929/ with 2 occurrences migrated to:
  https://www.w3.org/TR/2011/REC-css3-selectors-20110929/ ([https](https://www.w3.org/TR/2011/REC-css3-selectors-20110929/) result 200).
* [ ] http://www.w3.org/TR/CSS21/syndata.html with 2 occurrences migrated to:
  https://www.w3.org/TR/CSS21/syndata.html ([https](https://www.w3.org/TR/CSS21/syndata.html) result 200).
* [ ] http://www.w3.org/TR/selectors/ with 4 occurrences migrated to:
  https://www.w3.org/TR/selectors/ ([https](https://www.w3.org/TR/selectors/) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://dev.w3.org/csswg/cssom/ with 1 occurrences migrated to:
  https://dev.w3.org/csswg/cssom/ ([https](https://dev.w3.org/csswg/cssom/) result 301).
* [ ] http://docs.python.org/library/functions.html with 1 occurrences migrated to:
  https://docs.python.org/library/functions.html ([https](https://docs.python.org/library/functions.html) result 301).
* [ ] http://docs.spring.io/spring-batch/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/ ([https](https://docs.spring.io/spring-batch/) result 301).
* [ ] http://docs.spring.io/spring-batch/apidocs/org/springframework/batch/core/launch/JobOperator.html with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/apidocs/org/springframework/batch/core/launch/JobOperator.html ([https](https://docs.spring.io/spring-batch/apidocs/org/springframework/batch/core/launch/JobOperator.html) result 301).
* [ ] http://docs.spring.io/spring-batch/apidocs/org/springframework/batch/test/MetaDataInstanceFactory.html with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/apidocs/org/springframework/batch/test/MetaDataInstanceFactory.html ([https](https://docs.spring.io/spring-batch/apidocs/org/springframework/batch/test/MetaDataInstanceFactory.html) result 301).
* [ ] http://docs.spring.io/spring-batch/reference/html/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/reference/html/ ([https](https://docs.spring.io/spring-batch/reference/html/) result 301).
* [ ] http://docs.spring.io/spring-batch/reference/html/scalability.html with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/reference/html/scalability.html ([https](https://docs.spring.io/spring-batch/reference/html/scalability.html) result 301).
* [ ] http://docs.spring.io/spring-batch/trunk/reference/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/trunk/reference/ ([https](https://docs.spring.io/spring-batch/trunk/reference/) result 301).
* [ ] http://docs.spring.io/spring-batch/trunk/reference/html/index.html with 1 occurrences migrated to:
  https://docs.spring.io/spring-batch/trunk/reference/html/index.html ([https](https://docs.spring.io/spring-batch/trunk/reference/html/index.html) result 301).
* [ ] http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/interceptor/TransactionAttributeEditor.html with 1 occurrences migrated to:
  https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/interceptor/TransactionAttributeEditor.html ([https](https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/transaction/interceptor/TransactionAttributeEditor.html) result 301).
* [ ] http://forum.spring.io/forum/spring-projects/batch with 2 occurrences migrated to:
  https://forum.spring.io/forum/spring-projects/batch ([https](https://forum.spring.io/forum/spring-projects/batch) result 301).
* [ ] http://help.github.com/fork-a-repo/ with 2 occurrences migrated to:
  https://help.github.com/fork-a-repo/ ([https](https://help.github.com/fork-a-repo/) result 301).
* [ ] http://help.github.com/forking/ with 1 occurrences migrated to:
  https://help.github.com/forking/ ([https](https://help.github.com/forking/) result 301).
* [ ] http://help.github.com/send-pull-requests/ with 2 occurrences migrated to:
  https://help.github.com/send-pull-requests/ ([https](https://help.github.com/send-pull-requests/) result 301).
* [ ] http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_ with 1 occurrences migrated to:
  https://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_ ([https](https://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_) result 301).
* [ ] http://jquery.org/license with 2 occurrences migrated to:
  https://jquery.org/license ([https](https://jquery.org/license) result 301).
* [ ] http://springframework.org/batch/sample/io/oxm/domain with 3 occurrences migrated to:
  https://springframework.org/batch/sample/io/oxm/domain ([https](https://springframework.org/batch/sample/io/oxm/domain) result 301).
* [ ] http://www.eaipatterns.com/toc.html (302) with 1 occurrences migrated to:
  https://www.enterpriseintegrationpatterns.com/toc.html ([https](https://www.eaipatterns.com/toc.html) result 301).
* [ ] http://www.spring.io with 1 occurrences migrated to:
  https://www.spring.io ([https](https://www.spring.io) result 301).
* [ ] http://www.spring.io/ with 2 occurrences migrated to:
  https://www.spring.io/ ([https](https://www.spring.io/) result 301).
* [ ] http://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd ([https](https://www.springframework.org/schema/batch-integration/spring-batch-integration.xsd) result 301).
* [ ] http://www.springframework.org/schema/batch/spring-batch.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/batch/spring-batch.xsd ([https](https://www.springframework.org/schema/batch/spring-batch.xsd) result 301).
* [ ] http://www.springframework.org/schema/beans/spring-beans-2.5.xsd with 3 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-2.5.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-2.5.xsd) result 301).
* [ ] http://www.springframework.org/schema/beans/spring-beans-3.1.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.1.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.1.xsd) result 301).
* [ ] http://www.springframework.org/schema/beans/spring-beans-3.2.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/beans/spring-beans-3.2.xsd ([https](https://www.springframework.org/schema/beans/spring-beans-3.2.xsd) result 301).
* [ ] http://www.springframework.org/schema/tool/spring-tool-2.5.xsd with 1 occurrences migrated to:
  https://www.springframework.org/schema/tool/spring-tool-2.5.xsd ([https](https://www.springframework.org/schema/tool/spring-tool-2.5.xsd) result 301).
* [ ] http://www.springframework.org/schema/tool/spring-tool-3.1.xsd with 2 occurrences migrated to:
  https://www.springframework.org/schema/tool/spring-tool-3.1.xsd ([https](https://www.springframework.org/schema/tool/spring-tool-3.1.xsd) result 301).
* [ ] http://www.springframework.org/test with 34 occurrences migrated to:
  https://www.springframework.org/test ([https](https://www.springframework.org/test) result 301).
* [ ] http://www.w3.org/TR/css3-selectors/ with 2 occurrences migrated to:
  https://www.w3.org/TR/css3-selectors/ ([https](https://www.w3.org/TR/css3-selectors/) result 301).
* [ ] http://www.w3.org/TR/css3-syntax/ with 1 occurrences migrated to:
  https://www.w3.org/TR/css3-syntax/ ([https](https://www.w3.org/TR/css3-syntax/) result 301).
* [ ] http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx with 2 occurrences migrated to:
  https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx ([https](https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx) result 302).
* [ ] http://sourceforge.net/projects/cglib/files/cglib3/3.0/cglib-3.0.jar/download with 1 occurrences migrated to:
  https://sourceforge.net/projects/cglib/files/cglib3/3.0/cglib-3.0.jar/download ([https](https://sourceforge.net/projects/cglib/files/cglib3/3.0/cglib-3.0.jar/download) result 302).
* [ ] http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context with 1 occurrences migrated to:
  https://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context ([https](https://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context) result 302).
* [ ] http://www.springsource.org/download with 1 occurrences migrated to:
  https://www.springsource.org/download ([https](https://www.springsource.org/download) result 302).

# Ignored
These URLs were intentionally ignored.

* http://test with 2 occurrences
* http://www.springframework.org/schema/batch with 15 occurrences
* http://www.springframework.org/schema/batch-integration with 8 occurrences
* http://www.springframework.org/schema/batch/test with 2 occurrences
* http://www.springframework.org/schema/beans with 26 occurrences
* http://www.springframework.org/schema/integration with 6 occurrences
* http://www.springframework.org/schema/tool with 15 occurrences
* http://www.w3.org/1999/XSL/Format with 4 occurrences
* http://www.w3.org/1999/XSL/Transform with 3 occurrences
* http://www.w3.org/2001/XMLSchema with 10 occurrences
* http://www.w3.org/2001/XMLSchema-instance with 12 occurrences
* http://xmlns.jcp.org/xml/ns/javaee with 8 occurrences
2019-03-21 18:45:33 +01:00
Mahmoud Ben Hassine
ce9a359626 Rename StepContext#getJobId to StepContext#getJobInstanceId
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
2019-02-04 12:59:20 +01:00
Mahmoud Ben Hassine
eba7265a95 Fix tests failing randomly
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.
2019-01-28 10:31:43 +01:00
Mahmoud Ben Hassine
c9f72cd2c1 Minor polish 2019-01-25 17:38:28 +01:00
Mahmoud Ben Hassine
1bfabeb33c Fix tests failing on windows
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
2019-01-25 17:37:18 +01:00
Mahmoud Ben Hassine
7ca11f2f99 Add assertion that a serializer was set in the JdbcExecutionContextDao
Resolves BATCH-2779
2019-01-09 16:11:47 -06:00
Mahmoud Ben Hassine
a5748136d2 Fix typos 2019-01-03 23:00:19 +01:00
Mahmoud Ben Hassine
76c34c7f72 fix build warnings 2018-11-29 15:17:01 +01:00