Commit Graph

5270 Commits

Author SHA1 Message Date
David J. M. Karlsen
4283291cc8 use VARCHAR( n char) instead of VARCHAR(n) so semantics are used and not number of bytes. This is better when using multibyte charsets like UTF8 2018-10-29 10:04:10 -05:00
Mahmoud Ben Hassine
ebf156d529 Make JobParametersBuilder#getNextJobParameters consistent with CommandLineJobRunner and JobOperator
Before this commit, JobParametersBuilder#getNextJobParameters was checking
for restartability conditions. This is not only already done by the
JobLauncher, but also makes it inconsistent with the behaviour of
CommandLineJobRunner when used with "-next" option and
JobOperator#startNextInstance, which is starting the next instance in
sequence based on the incrementer without dealing with restartability.

This commit fixes the JobParametersBuilder#getNextJobParameters to behave
like the CommandLineJobRunner and JobOperator in regards to starting
the next instance.

Resolves BATCH-2711
2018-10-26 11:44:22 -05:00
Dimitrios Liapis
f8f8a02a4d Explicitly considering Start Time not being null for running Job Executions
This is to exclude from capturing erroneous Job Executions. An example is
whenever a TaskRejectedException is thrown after submitting to the
taskExecutor in SimpleJobLauncher#run(), the JobExecution is left without
a Start or End Time. Also related tests are fixed.

Resolves BATCH-2675
2018-10-25 11:36:21 +02:00
Mahmoud Ben Hassine
76f8cad29a Fix incorrect @Nullable on ItemReadListener#afterRead implementations
Resolves BATCH-2763
2018-10-24 15:37:54 +02:00
Mahmoud Ben Hassine
b3579ffcd2 Polish 50625f5054
* Fix incorrect links
* Remove a dead link
* Update outdated links
2018-10-10 10:20:13 +02:00
Ganapathi Vara Prasad
50625f5054 Updating link and title syntax 2018-10-09 14:00:29 -05:00
Drummond Dawson
af71337ee3 BATCH-2723: Fix incorrect JdbcPagingItemReader java config example 2018-10-09 13:13:35 -05:00
Yanming Zhou
fd2cfa356c Change start-limit to match example
playerSummarization is not started in Run 3.
2018-10-03 09:48:29 +02:00
Mahmoud Ben Hassine
249fa2673e Fix typos 2018-10-02 22:40:56 +02:00
Stefano Cordio
df2e778fbd Minor refactoring
* Remove unneeded exception declarations
* Collapse catch blocks
* Replace string concatenation with builder append
2018-10-02 22:04:59 +02:00
Drummond Dawson
dca16fb5bd Simplify project.hasProperty('alltests') ternary operator 2018-10-02 21:13:41 +02:00
Drummond Dawson
0845520070 BATCH-2701: Remove unnecessary apache commons-collections in test module 2018-10-02 15:53:03 +02:00
Drummond Dawson
0e0bf1d699 BATCH-2702: testCompile hamcrest in test module 2018-10-02 14:42:37 +02:00
Spring Buildmaster
4c019e3c0f [artifactory-release] Next development version 2018-09-21 23:16:20 +00:00
Spring Buildmaster
dba1657f42 [artifactory-release] Release version 4.1.0.RC1 2018-09-21 23:16:14 +00:00
Mahmoud Ben Hassine
35676a3234 Add JAXB API to the test class path
This is required to be able to test against Java 11. In Java 11, JAXB is
removed from the JDK (See http://openjdk.java.net/jeps/320). This commit
fixes errors of type:

```
StaxEventItemWriterTests.java:22: error: package javax.xml.bind.annotation
does not exist: import javax.xml.bind.annotation.XmlRootElement;
```

Two important points (from JEP 320) to note about this commit:

* `Another risk of removing the Java EE modules is that applications
 which already migrated from JDK 6, 7, or 8, to JDK 9, will not start if
 they use the command line flag --add-modules java.se.ee,
 --add-modules java.xml.bind, etc.` This commit removes the need to add
 the flag `--add-modules java.xml.bind`. This removal does not impact
 building on Java 9 since JAXB is in the class path now.

 * `The Reference Implementations (RIs) of JAX-WS and JAXB are a good
 starting point because they are complete replacements for the
 java.xml.ws and java.xml.bind modules in JDK 9. The RIs are available
 as Maven artifacts: (note that they must be deployed on the class path)`
 This commit adds JAXB to the test class path where needed.

Issue: BATCH-2757
2018-09-21 14:47:13 -05:00
Michael Minella
b26aafe042 Updated example to be more realistic 2018-09-21 14:36:42 -05:00
Mahmoud Ben Hassine
80d0015bb7 Update docs with new features of v4.1.0.M3 2018-09-21 14:23:20 -05:00
Mahmoud Ben Hassine
57c4acdf22 Fix Javadoc generation issues on Java 9
1. The first issue is:

```
> Task :api
DefaultBatchConfigurer.java:18: error: cannot find symbol
import javax.annotation.PostConstruct;
                       ^
  symbol:   class PostConstruct
  location: package javax.annotation
DataSourceConfiguration.java:18: error: cannot find symbol
import javax.annotation.PostConstruct;
                       ^
  symbol:   class PostConstruct
  location: package javax.annotation
DefaultBatchConfigurer.java:94: error: cannot find symbol
        @PostConstruct
         ^
  symbol:   class PostConstruct
  location: class DefaultBatchConfigurer
DataSourceConfiguration.java:46: error: cannot find symbol
        @PostConstruct
         ^
  symbol:   class PostConstruct
  location: class DataSourceConfiguration
4 errors
```

This issue is fixed by adding the `javax.annotation-api` dependency

2. The second issue is:

```
javadoc: error - An internal exception has occurred.
(com.sun.tools.javac.code.ClassFinder$BadClassFile: bad class file:
/org/springframework/batch/core/configuration/support/
GenericApplicationContextFactory$ResourceAnnotationApplicationContext$1.class

class file contains malformed variable arity method:
GenericApplicationContextFactory$ResourceAnnotationApplicationContext$1
Please remove or make sure it appears in the correct subdirectory of the classpath.)
```

The workaround to this issue is to use a named inner class instead of
an anonymous one.

Upgrade jacoco to version 0.8.2

Fix failing tests on Java 9

* `javax.xml.bind` is no longer contained in the default class path in
Java SE 9. This commit adds the module `java.xml.bind` to the JVM args
for tests

* JsrBeanDefinitionDocumentReaderTests are failing because
`ClassLoader.class.getResourceAsStream` has a different behaviour on Java 9.
According to `https://stackoverflow.com/a/45173837/5019386`, it's best to
use the resource-lookup methods in Class rather than those in ClassLoader.

* DefaultJobParametersExtractorJobParametersTests#testGetAllJobParameters
is failing because jobParameters.toString() returns "{foo=bar, spam=bucket}"
on Java 9 and "{spam=bucket, foo=bar}" on Java 8. The fix asserts that
jobParameters contains the expected key/value pairs without relying on the
toString method

JIRA: BATCH-2751
2018-09-21 13:48:15 -05:00
Michael Minella
8df674c4d8 Updated Spring Integration and Spring Framework versions 2018-09-21 13:31:50 -05:00
Mahmoud Ben Hassine
a591008eba Upgrade dependencies for Boot 2.1 2018-09-18 18:45:07 +02:00
Evgenii Strepetov
7a3248cabf Fix JsonFileItemWriter for multiple write's
Resolves BATCH-2749
2018-09-12 08:59:32 -05:00
Mahmoud Ben Hassine
c8a0a7d407 Upgrade gradle to version 4.10
Needed to upgrade SonarQube plugin version to latest because of
https://github.com/gradle/gradle/issues/1667

Resolves BATCH-2725
2018-09-05 16:16:39 +02:00
Mahmoud Ben Hassine
9b8a6d1d1a Fix javadoc of StaxEventItemReader#setStrict in regards to default value
The Javadoc of StaxEventItemReader#setStrict says that the default value
of the parameter is false while it is true.

Resolves BATCH-2749
2018-09-04 21:45:13 +02:00
Spring Buildmaster
d5981bfa0b [artifactory-release] Next development version 2018-08-31 22:48:05 +00:00
Spring Buildmaster
54a6641cdd [artifactory-release] Release version 4.1.0.M3 2018-08-31 22:47:57 +00:00
Mahmoud Ben Hassine
7ce3408988 Add documentation about how to provide a custom BatchConfigurer
Resolves BATCH-2724
2018-08-31 16:52:10 -05:00
Mahmoud Ben Hassine
a68d70043a Allow the transaction manager to be overridden in DefaultBatchConfigurer
Before this commit, it was not possible to override the transaction
manager by subclassing DefaultBatchConfigurer and overriding the
getTransactionManager method.

This commit uses the getTransactionManager method in the initialize method
in order to take into account the transaction manager provided by the user.

Resolves BATCH-2294
2018-08-31 16:33:43 -05:00
Mahmoud Ben Hassine
e83ed1db11 Add convenience methods in FlatFileItemWriterBuilder to generate delimited files
Resolves BATCH-2696
2018-08-31 15:51:44 -05:00
Mahmoud Ben Hassine
70d0e3c510 Add JSR-305 annotations to public APIs
(Partially) Resolves BATCH-2688
2018-08-31 15:11:50 -05:00
Mahmoud Ben Hassine
295def2b89 Polish e29f77e01e 2018-08-31 20:29:01 +02:00
Kui Liu
e29f77e01e BATCH-2715: Change the method name "getStartable" to "isStartable".
The method is named as "getStartable". "getStartable" is prone to obtain something. "isStartable" is a query asking whether the stepExecution is startable, which describes what the method is doning. So, "isStartable" should be more intuitive.
2018-08-31 20:08:01 +02:00
Mahmoud Ben Hassine
8af965cac5 Update javadoc 2018-08-31 19:47:49 +02:00
Mahmoud Ben Hassine
adc90b220d Fix typo in method name HibernatePagingItemReaderBuilder#useSatelessSession
Resolves BATCH-2745
2018-08-31 10:50:50 -05:00
Mahmoud Ben Hassine
80d1a24f52 Allow whitespace characters as delimiters in FlatFileItemReader
Resolves BATCH-2738
2018-08-31 10:32:59 -05:00
Mahmoud Ben Hassine
909231c577 Polish 305b4b8b03 2018-08-13 10:34:44 +02:00
Drummond Dawson
305b4b8b03 BATCH-2698: Remove commons io from test module
Prefer Files.lines over common io's readLines
2018-08-13 09:53:08 +02:00
Mahmoud Ben Hassine
523c8083ab Polish 2018-08-13 00:50:12 +02:00
Jerry Zhao
a8032196bf reuse existing methods whenever applicable
remove unnecessary unboxing
2018-08-13 00:00:34 +02:00
Michael Minella
4b1a78323e Updated to fix test and build file 2018-07-26 11:25:46 -05:00
Mahmoud Ben Hassine
cb03c1c7ed Add JSR-305 annotations to public APIs
(Partially) Resolves BATCH-2688
2018-07-26 10:02:01 -05:00
Michael Minella
3a2fc7d2ee Removed incorrect @Nullable annotations 2018-07-25 10:53:37 -05:00
Michael Minella
148a93e7b4 Added dependencies to supress compile time warnings for JSR-305 annotations 2018-07-24 17:18:55 -05:00
Mahmoud Ben Hassine
276acd1960 code review changes 2018-07-23 16:07:37 -05:00
Mahmoud Ben Hassine
24b8d72a7a Add JSR-305 annotations to public APIs
(Partially) Resolves BATCH-2688
2018-07-23 16:07:34 -05:00
Michael Minella
89a3b0453a Added JSR-305 dependency to prevent test compile warnings 2018-07-23 15:24:13 -05:00
Mahmoud Ben Hassine
96a0fc825e Add JSR-305 annotations to public APIs
(Partially) Resolves BATCH-2688
2018-07-19 22:58:24 +02:00
Spring Buildmaster
f282be1458 [artifactory-release] Next development version 2018-07-13 19:21:59 +00:00
Spring Buildmaster
b987d2c05b [artifactory-release] Release version 4.1.0.M2 2018-07-13 19:21:52 +00:00
Mahmoud Ben Hassine
d72cd67cad Make the outputChannel and messagingTemplate mutually exclusive
This commit changes the remote chunking and partitioning master step
builders to either accept an output channel or a messaging template
but not both.

See BATCH-2687
2018-07-12 17:31:15 +02:00