Commit Graph

1313 Commits

Author SHA1 Message Date
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
329457e672 Remove irrelevant test
The test `testCompareNewWithOldAfterCopy` does
not work on linux/unix unless a `Thread.sleep`
is added before the file copying (see cbcf28c3).

This test does not work on windows neither,
because it is based on apache commons
`FileUtils.copyFile` which does not honor
`preserveFileDate=false` on windows.

The following test works on linux/unix
but not on windows:

```
@Test
public void testLastModifiedAfterCopy() throws IOException {
    File existing = new FileSystemResource(FILE_PATH).getFile();
    File temp = new File("target/temp.txt");
    assertFalse(temp.exists());
    FileUtils.copyFile(existing, temp, false);
    assertTrue(temp.lastModified() > existing.lastModified());
}
```

On windows, even though `preserveFileDate=false`,
the last modification date of the copy is equal
(ie preserved) to the one of the original file,
which is not the case on linux/unix. Trying to
use an alternative like `java.nio.file.Files#copy`
does not work since it only offers the ability
to either copy file attributes or replace the
existing file (which is not the idea of this test).

This test does not add any value and should have
been removed since a long time (see TODO in 12d6613).
2021-02-05 16:28:13 +01:00
Mahmoud Ben Hassine
2cc807de62 Fix tests failing on Windows
Before this commit, tests in this change set
were failing on MS Windows due to the file
comparison method which was based on file
content hash comparison. With this method,
differences between OS line endings
(LF vs CRLF) in generated json files produce
different hashes.

This commit uses a logical json comparison
based on the jsonassert library.
2021-02-04 16:01:22 +01:00
Mahmoud Ben Hassine
ee282ab97f Fix assumption in ScriptItemProcessorTests.testItemBinding
This test fails on Java 15 because the Javascript engine
has been removed in Java 15 (JEP 372).

This commit updates the test to assume that the JavaScript
engine is provided to the JVM through a factory (similar
to other tests).
2021-02-02 13:49:12 +01:00
Mahmoud Ben Hassine
fa26246d80 Fix Javadoc errors 2021-02-02 13:43:24 +01:00
Mahmoud Ben Hassine
d0493906a8 Replace usage of "build" directory with "target" 2021-01-29 11:45:34 +01:00
Mahmoud Ben Hassine
91cd55ecaa Update configuration to run unit/integration tests separately
This commit updates the configuration to run unit tests
with maven-surefire-plugin and integration tests with
maven-failsafe-plugin. JSR-352 TCK tests are considered
as integration tests and are executed with other integration
tests (no need for a separate profile to run them).

Some unit tests were failing when integration tests were
skipped.. Those tests have been temporarily ignored.
2021-01-29 11:45:32 +01:00
Mahmoud Ben Hassine
8cfec33ef0 Re-organize documentation resources
This commit also adds scaling diagrams [1]
to Figures.ppt. Those diagrams were not under
source control.

[1]: https://docs.spring.io/spring-batch/docs/current/reference/html/spring-batch-integration.html#externalizing-batch-process-execution
2021-01-29 11:45:31 +01:00
Mahmoud Ben Hassine
bf612650ea Merge spring-batch-infrastructure-tests in spring-batch-infrastructure 2020-12-04 14:13:33 +01:00
Mahmoud Ben Hassine
12926b46c9 Remove ignored test
Based on the commit message of df1783a7, this
test has no added value.
2020-12-03 16:01:04 +01:00
Mahmoud Ben Hassine
c8e5e507f4 Polish contribution feb46fd3f7
* Update year in license header
* Use "this" keyword where appropriate
2020-11-27 23:19:24 +01:00
Aditya Sathe
feb46fd3f7 Make kafkaTemplate protected in KafkaItemWriter
Issue #3802
2020-11-27 23:14:05 +01:00
Antoine Kapps
cbdb251441 Fix incorrect behaviour of RepositoryItemReader#jumpToItem() on restart
* Corrects unit tests with expected behavior.
* Creates integration tests highlighting Hibernate lazy-loading failure if the reader has requested the page on open().

Issue #1074
2020-11-20 13:17:43 +01:00
lucap
7d45f2c567 Use isQuoteCharacter instead of direct char comparison in DelimitedLineTokenizer
Issue #682
2020-11-19 16:48:03 +01:00
Mahmoud Ben Hassine
5826111b85 Fix KafkaItemReaderTests
Tests in this class fail intermittently because
they send messages to Kafka in an asynchronous
way and assert on the results immediately without
waiting for the send operation to complete.

This commit updates the tests to wait for
send results before asserting on them
(similar to a140a9f5).
2020-11-18 16:50:10 +01:00
Parikshit Dutta
1ce4da5cce Fix for setting name of StaxEventItemReader at build 2020-09-25 10:17:47 +02:00
Parikshit Dutta
c2625b1f87 Add support to build StaxEventItemReader when no Resource is provided
Resolves #3736
2020-09-21 14:22:32 +02:00
Mahmoud Ben Hassine
4000d1d579 Polish contribution 2020-09-21 13:16:38 +02:00
Santiago Molano
c78e2b518b Add support to build JsonItemReader when no Resource is provided
Resolves #3731
2020-09-21 13:16:37 +02:00
Mahmoud Ben Hassine
41854008e8 Add JpaCursorItemReader implementation
Issue #901
2020-09-16 15:52:28 -05:00
Mahmoud Ben Hassine
264243b73c Deprecate org.springframework.batch.item.xml.StaxUtils
This commit deprecates org.springframework.batch.item.xml.StaxUtils
in favor of org.springframework.util.xml.StaxUtils.

Resolves #3779
2020-09-16 10:08:28 +02:00
Mahmoud Ben Hassine
9449551d9f Deprecate Alignment enum
Resolves #3778
2020-09-15 20:59:25 +02:00
Mahmoud Ben Hassine
08d7f56eea Deprecate AbstractNeo4jItemReader
Resolves #3777
2020-09-15 20:39:40 +02:00
Mahmoud Ben Hassine
f6a8d10595 Deprecate MultiResourceItemReader#getCurrentResource
Resolves #3776
2020-09-15 17:00:08 +02:00
Michael Minella
7e485a1b2b Polish 2020-09-14 10:01:13 -05:00
Mahmoud Ben Hassine
615a4aee2c Add initial support for Java 14 records mapping
Issue #3693
2020-09-10 10:23:07 +02:00
Mahmoud Ben Hassine
65d31bff1d Polish d65203e2d3
* Minor formatting update
* Use a regexp to discard xml header in tests
2020-09-09 21:09:50 +02:00
Parikshit Dutta
d65203e2d3 Add support for 'standalone' attribute in StaxEventItemWriter
Issue #758
2020-09-09 21:09:10 +02:00
Mahmoud Ben Hassine
ce22cddbbc Add partitionOffsets setter in KafkaItemReaderBuilder
Resolves #3761
2020-08-14 21:39:27 +02:00
Mahmoud Ben Hassine
15a393b8ef Add ability to start reading from a custom offset in KafkaItemReader
Issue #737
2020-08-10 12:18:49 +02:00
Mahmoud Ben Hassine
9dde586442 Open FlatFileItemReader#isComment for extension
Resolves #1134
2020-07-24 16:18:02 +02:00
Mahmoud Ben Hassine
67317e66d0 Open StaxEventItemReader#isFragmentRootElementName for extension
Resolves #1020
2020-07-24 15:14:33 +02:00
Mahmoud Ben Hassine
bbfe1a9a76 Polish 6c5cb2b13d
* Move class Item as inner class of surrounding test
* Update mongodb sample for item deletion use case
2020-07-17 19:30:16 +02:00
Parikshit Dutta
6c5cb2b13d Use BulkOperations API for Remove Operations in MongoItemWriter
Issue #3737
2020-07-17 19:29:52 +02:00
Mahmoud Ben Hassine
e7ea16c9bc Add connection parameter to AbstractCursorItemReader#cleanupOnClose
This change makes it possible to (re)use the same connection used in
the openCursor method to clean up resources when the reader is closed.

Resolves #1696
2020-07-17 10:40:58 +02:00
Mahmoud Ben Hassine
2952e9a039 Add encoding parameter in StaxEventItemReader
Resolves #807
2020-07-15 11:54:55 +02:00
MinJun Kweon
a88b074c8d Add getChunkSize in SimpleCompletionPolicy
resolved #3738
2020-07-13 10:39:47 +02:00
Mahmoud Ben Hassine
4e0d6a982b Polish 3b58fecfe4
* Add query creation test in JpaNamedQueryProviderTests
* Make JpaPagingItemReaderNamedQueryIntegrationTests consistent
  with JpaPagingItemReaderNativeQueryIntegrationTests
2020-06-26 13:51:35 +02:00
Parikshit Dutta
3b58fecfe4 Add support for Named Query in JpaPagingItemReader
Issue #1667
2020-06-26 13:49:33 +02:00
Mahmoud Ben Hassine
d257fcee01 Polish 629497d5bb
* Fix tests in MongoItemWriterBuilderTests
* Minor code refactoring in MongoItemWriter
2020-06-25 13:09:50 +02:00
Parikshit Dutta
629497d5bb Implemented BulkOperations API in MongoItemWriter 2020-06-25 11:56:30 +02:00
Ankur Trapasiya
bbabe0263a Add connectionAutoCommit property in JdbcCursorItemReaderBuilder
Issue #3717
2020-06-02 21:13:28 +02:00
Drummond Dawson
8a6a2bd19a Add beanRowMapper to JdbcPagingItemReaderBuilder
Sets the rowMapper of the JdbcPagingItemReader as
a BeanPropertyRowMapper.

Issue #819
2020-06-02 17:12:45 +02:00
Mahmoud Ben Hassine
e3bc7ded37 Make RepositoryItemWriter use CrudRepository#saveAll by default
Before this commit, the `RepositoryItemWriter` did not use
`CrudRepository#saveAll` by default and one must override
`doWrite` and call it manually, which is not convenient.

This commit makes the writer use `CrudRepository#saveAll`
by default while keeping the possibility to use another
method if desired through the `methodName` parameter.

Resolves #3720
2020-05-29 23:00:11 +02:00
Mahmoud Ben Hassine
91aa17b22f Polish f37fae670b
* Update year in license header
* Update Javadoc formatting
2020-05-20 14:38:12 +02:00
Matthew Ouyang
f37fae670b Add documentation for how an ItemProcessor.process can never receive a null item. 2020-05-20 14:36:24 +02:00
Mahmoud Ben Hassine
9fbd3daa54 Polish 117b7d5f2d
* Update year in license headers
* Add/Amend Javadocs
* Update assertion message to be consistent between the writer and its builder
2020-05-14 10:10:00 +02:00
Dimitrios Liapis
117b7d5f2d Introduce SynchronizedItemStreamWriter
Issue #842
2020-05-14 00:19:10 +02:00
Philippe Marschall
10fd3716f0 Improve TransactionAwareBufferedWriter
TransactionAwareBufferedWriter offers a number of optimization
potentials. First it creates an unnecessary local, temporary char[]
in write(char[], int, int). Second it does not overwrite any of the
#write(String) methods leading to unnecessary intermediate copies.

 * avoid local, temporary char[] in #write(char[], int, int)
 * overwrite #write(String) methods to avoid copies

Together these two changes should help to reduce allocation rate.

Issue: #1166
2020-05-07 16:19:17 +02:00
Parikshit Dutta
56fbc270e2 Removed redundant logical checks from MongoItemReaderBuilder and MongoItemReader
to prevent false alarm for not providing the limit for query or pagesize for the reader

Issue #3673
2020-04-23 12:21:19 +02:00