Commit Graph

4883 Commits

Author SHA1 Message Date
snekse
858e10383d Removing references to AbstractJobTests which has been deprecated in favor of JobLauncherTestUtils 2014-12-30 17:13:15 -06:00
Andy Wilkinson
3e5e871163 Make use of current working dir explicit for compatibility with H2 1.4
H2 1.4 requires that file paths that are relative to the current
working directory declare this explicitly, i.e. the path
file:/some-dir must now be file:./some-dir.

This commit updates DatabaseTypeIntegrationTests to meet the
above-described requirement, thereby allowing the tests to pass when
run against H2 1.4.x.
2014-12-30 16:50:57 -06:00
Michael Minella
92e551e05d Add ability to override JSR-352 baseContext.xml
While existing functionality provided the ability to override the
components provided in the baseContext.xml (as required for JSR-352
functionality) at a job by job level, this commit allows a user to
specify a base context for all of the JSR-352 based jobs within a JVM.
To set the location of the custom base context, a JVM property
JSR-352-BASE-CONTEXT should be set.

BATCH-2290
2014-12-30 16:16:02 -06:00
Michael Minella
066c59a390 Add job repository polling option to MessageChannelPartitionHandler
When using remote partitioning, each slave worker persists it's current
status in the same job repsository that the master uses.  Because of
this, there is no hard need for the master to wait for each worker to
send a formal response once it's work is complete.  Instead, the master
(at the cost of polling a db periodically) can determine if the workers
are done by looking up each partition's status in the job repository.
This commit removes the requirement for a reply channel and implements
the polling of the job repository to determine if the workers are done.

BATCH-2332
2014-12-23 16:29:41 -06:00
Michael Minella
c10469367f Fixed manual wiring of JsrJobOperator
While the JSR-352 provides only one way to access the JobOperator
(BatchRuntime.getJobOperator()), it is useful for testing and embedding
to be able to wire your own JsrJobOperator instance.  This commit
addresses previous issues with using the constructor that provided that
functionality.

Note: This is a breaking change in that there is a new parameter on the
non-default constructor (adding a PlatformTransactionManager reference).
Users using the JsrJobOperator through the BatchRuntime as previously
mentioned should not be impacted.  Since this is the *only* method
perscribed by the JSR to consume that class, it is not expected to have
a large impact.

This fix partially addresses BATCH-2290.
2014-12-22 16:57:16 -06:00
Michael Minella
34fc9a0660 Changed repository references from http to https 2014-11-20 09:45:15 -06:00
Michael Minella
f39fc4b524 Add reflection check for Spring 4.1 in Mail Writer tests
As part of the Spring Framework 4.1 updates, the send methods on both
MailSender#send and JavaMailSender#send were converted from taking an
array to vargs.  This commit adds a reflection check to determine which
version of Spring it's being built against and uses the apropriate
mocking checks in these tests based on that check.
2014-11-10 12:57:36 -06:00
Michael Minella
7683700662 Filter out duplicate ApplicationContextAwareProcessors in parent/child
contexts scenarios

AbstractApplicationContextFactory, when configuring a child context,
copies all of the BeanPostProcessors from the parent to the child.
Normally this is a good thing.  However, in the case of teh
ApplicationContextAwareProcessor, the child context ends up with two
instances, one for the parent context and one for the child context.
This brings two issues to light:
  1. Unknown which context is being injected - On beans implementing
ApplicationContextAware, it can't be determined which context (the
parent or the child) will be injected since both BPPs will be called in
an indeterimant order.
 2. Errors occur with ApplicationObjectSupport - If the child context
contains a bean that extends ApplicationObjectSupport, when the second
ApplicationContextAwareProcessor is called, the bean will throw an
exception since it is only allowed to be initialized with one
application context.

This fix adds additional logic to remove the
ApplicationContextAwareProcessor from the parent context before adding
all the BPPs to the child.

This fix addresses BATCH-2319.
2014-11-05 16:34:51 -06:00
Michael Minella
a066647149 Change prefetch on jms tests to 0 and add @DirtiesContext to tests
With the upgrade to ActiveMQ 5.9.0 as part of Spring IO, ActiveMQ's
prefetch behavior changed.  With each call to
JmsTemplate#receiveAndConvert, the template creates a new consumer.  In
these tests, the first call created a consumer which prefetched all the
test messages on the queue, leaving them unavailable for the second
consumer the JmsTemplate created.  By setting prefetch to 0, the
messages are now available for the subsequent
JmsTemplate#receiveAndConvert calls.  This addresses BATCH-2248.
2014-10-27 17:16:49 -05:00
Michael Minella
090e6f2039 BATCH-2248: Fixes for Ldif reader tests 2014-10-17 11:40:38 -05:00
Chris Schaefer
8b26504db1 BATCH-2242: Stopping a job in STARTING state throws OptimisticLockingFailureException 2014-10-17 11:40:38 -05:00
Michael Minella
b8238908df Updated sequence initalization insert to be idempotent
BATCH-2159 provides a tweak to the insert statement used for
initializing the sequence tables used in the job repository database so
that they don't error if run multiple times as well as don't insert
multiple rows.
2014-10-17 11:12:12 -05:00
Michael Minella
2ae6388c12 Fixes the RepositoryItemReader ignoring explicitly set currentItemCount
If the user explicitly sets the currentItemCount value on a
RepositoryItemReader, prior to this commit, it is ignored.  this commit
addresses this by moving the current counter up to the correct value
when that value is set.  This fix addresses BATCH-2274.

This commit also addresses a number of compiler warnings around javadoc.
2014-10-16 17:20:48 -05:00
Michael Minella
f865eb0135 Add explicit call to afterPropertiesSet to a Flow when using Java config
When using java config, the call to SimpleFlow#afterPropertiesSet is not
called in all cases as noted in BATCH-2291.  This commit updates the
builder to explicitly make the call, and updates the SimpleFlow to be
idempotent for calls to afterPropertiesSet.
2014-10-15 14:36:13 -05:00
Michael Minella
8b22a6e98d Ignoring tests that I had unignored 2014-09-24 09:34:10 -05:00
Michael Minella
00abd5e262 Update javadoc to remove javadoc warnings 2014-09-23 14:28:43 -05:00
Michael Minella
5b056e8126 Handle scenario where scanned item is filtered out
BATCH-2302 documents a scenario where an item throws an exception in a
fault tollerant step in the write, then in the process, throws an
exception as well.  This leads to an infinite loop.  To address this,
prior to attempting to write items during scanning we need to validate
that the there are items to be written (we were not which was causing a
NoSuchElementException when we did inputs.next().

This commit also removes an eronous System.out left in the
CoreNamespaceUtils.
2014-09-23 14:12:48 -05:00
Michael Minella
aee9dc2f6f Update stopped flag to volitile in SystemCommandTasklet
The SystemCommandTasklet checks a flag to determine if another thread
has requested that it be stopped.  Since this flag will be set via
another thread than the executing thread, it needs to be declared
volitile so that it's state is propigated across threads correctly.  The
documentation for StoppableTasklet has also been upadted to call out
that scenario.

This commit addresses Jira BATCH-2271
2014-09-22 15:39:17 -05:00
Michael Minella
1857743712 Fixed configuration of sort keys in JdbcPagingItemReader
The JdbcPagingItemReader allows the configuration of multiple sort keys.
If a user configures one of those columns with a table alias, it causes
issues.  This update strips the aliases off of the sort keys.
2014-09-22 14:58:28 -05:00
Michael Minella
19af4133eb Update DefaultBatchConfigurer to conform to @PostConstruct contracts
Prior to this commit the initialize method (which is annotated with
@PostConstruct) was throwing a checked exception wich goes against the
@PostConstruct contract.  We now wrap any checked exceptions in a
BatchConfigurationException and throw that.

This commit fixes (again) BATCH-2276
2014-09-22 14:19:59 -05:00
Michael Minella
a2f2df0b17 Conditionally add custom scopes when using XML configuration
When using a combination of Java configuration and the XML namespace
configuration, prior to this commit, we would add the batch custom
scopes twice which lead to issues.  This commit gives priority to the
custom scopes provided by the java configuration.  If you've used
@EnableBatchProcessing and have configured batch components using the
batch namespace, the custom scopes that come with the java config will
take precidence.

This commit addresses Jira BATCH-2266
2014-09-22 13:48:28 -05:00
Michael Minella
fc2431332b Added test to DelimitedLineTokenizer based on StackOverflow Question
A question was asked on StackOverflow
(http://stackoverflow.com/questions/25914945/spring-batch-delimitedlinetokenizer-with-line-breaks-newline-in-csv)
in which a row wasn't being parsed as expected.  We didn't have a test
for that specific scenario so this commit adds one.
2014-09-18 10:41:35 -05:00
Adam Richeimer
44fc2b1069 Change ClassifierCompositeItemWriter to honor item order
The ClassifierCompositeItemWriter loops through the items passed to the
write method twice.  The first time to classifier each item.  The second
tiem to perform the actual writes (this prevents the unnecessicary IO if
an error occurs during classification).  A HashMap was previously used
to hold the classified items (key to the writer : item) however this
causes the items to be written out of order.  This update changes it to
a LinkedHashMap to honor the order the items come in.
2014-09-16 11:17:28 -05:00
Michael Minella
04b339b8f4 Add BeanCreationException to list of standard failure exceptions
Without this change, when passing an invalid job parameter to a bean
that is created internally by Spring Batch will cause a
BeanCreationException that is essentially ignored.  Due to it being
ignored, an infinite loop occurs in processing.
2014-09-16 11:01:30 -05:00
Seo Kyung-Seok
1e54018df3 Deleting an unnecessary import class in ExecutionContext.
"import org.springframework.util.Assert;"
2014-09-15 15:55:15 -05:00
Chris Schaefer
47eba434d8 BATCH-1863: The batch namespace can not be used with allowBeanDefinitionOverriding=false 2014-09-15 15:05:26 -05:00
Michael Minella
2fec70d25e Add null check to AsyncItemWriter
The AsyncItemWriter is used in conjunction with the AsyncItemProcessor
to unwrap the Futures that are returned by that processor.
Traditionally when an ItemProcessor returns null, it's considered having
been filtered out and should not be passed to the ItemWriter.  In this
case, the AsyncItemWriter was not checking for nulls so they were being
passed to the delegate ItemWriter.  Most of the OOTB ItemWriters do not
perform a null check prior to doing the write so they were throwing NPEs
when using this paradigm.
2014-09-11 11:53:17 -05:00
Chris Schaefer
4f32f623f0 BATCH-2241 & BATCH-2243 - add namespace support for remote chunking 2014-09-03 01:10:47 -04:00
Michael Minella
deb4c6fb5b BATCH-2283: Updated MessageChannelPartitionHandler to return null when no partitions are specified 2014-08-06 14:52:02 -05:00
Chris Schaefer
587680ba56 XD-1027: Create script-based batch ItemProcessor 2014-07-18 11:55:17 -05:00
Michael Minella
8f8600c14d BATCH-2253: Added automatic registraiton of Job Scope to java config and
added support for a @JobScope annotation.
2014-07-18 11:55:17 -05:00
Michael Minella
752fe55e88 BATCH-2257: Added process skip count and filter count to the aggregate 2014-07-18 11:55:17 -05:00
Michael Minella
881de9ac16 BATCH-2251: Removed unused property from provided properties files 2014-07-18 11:55:17 -05:00
Chris Schaefer
0f5a7af1a3 Final attempt at fixing test failure on build machine. Works as expected in a cloned plan 2014-07-18 11:55:17 -05:00
Chris Schaefer
1f8cc9a557 Re-ignore.. apparently not the appropriate fix.. 2014-07-18 11:55:17 -05:00
Chris Schaefer
3b36c132d5 Remove @Ignore from test, fix build system issue 2014-07-18 11:55:17 -05:00
Chris Schaefer
cfe2bfb60d Temporarily ignore test until build issue is fixed 2014-07-18 11:55:17 -05:00
Michael Minella
751e7162a5 BATCH-2250: Added @FixMethodOrder(MethodSorters.JVM) to override new default method sorting by JUnit 4.11 2014-07-18 11:55:17 -05:00
Chris Schaefer
1ff1e6c7d0 BATCH-2242: Stopping a job in STARTING state throws OptimisticLockingFailureException 2014-07-18 11:55:17 -05:00
Michael Minella
6b6118263b BATCH-2247: Added creation of a JobExplorer by default to address the inability to create a Map based JobExplorer using java config 2014-07-18 11:55:16 -05:00
Chris Schaefer
6dc5e825e2 Add out dir to ignore 2014-06-10 01:48:19 -04:00
Gunnar Hillert
b3188e89b7 BATCH-2245 Cannot import Project into IntelliJ 2014-05-30 09:51:44 -05:00
Michael Minella
e3e16f864b XD-1390: Updated SimpleJobRepository to return StepExecutions from previous run so UNKNOWN check will apply 2014-05-27 11:06:18 -05:00
Michael Minella
88f73791fb XD-1622: Add tasklet and step type to Step's ExecutionContext for XD usage 2014-05-23 15:47:23 -05:00
Michael Minella
f407b76d89 Updated project version to 3.1.0.BUILD-SNAPSHOT 2014-05-23 10:10:35 -05:00
Spring Buildmaster
5cdb397ca4 [artifactory-release] Next development version 2014-05-22 10:58:06 -07:00
Michael Minella
9f63df5703 Updated Spring Integration version to 4.0.1 2014-05-22 12:14:05 -05:00
Michael Minella
ca8087dfc6 BATCH-2206: Added option to set collection for MongoItemReader 2014-05-22 11:31:41 -05:00
Michael Minella
f5d5edc52d BATCH-2235: Updated ExitStatus#isRunning logic to use correct strings 2014-05-22 11:31:41 -05:00
Michael Minella
936d966712 Added tests to address more situations as well as cleaned up logic a bit 2014-05-22 11:31:41 -05:00