You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@batchee.apache.org by Mark Struberg <st...@yahoo.de> on 2016/01/17 18:00:05 UTC

how to best test tx integration problems?

hi!

referring to BATCHEE-88. 
What I like to do is to create a chunk with a Reader returning Integer 1..3 and a Writer which stores it.
But all that with a TransactionManagerAdapter which I can control to blow up with various exceptions ;)
E.g. simulating what happens if the commit goes boom with a javax.transaction.TransactionRolledbackException or javax.transaction.TransactionRequiredException.
Or the same with rollback. 

We need to make sure retryable-exception-classes and skippable-exception-classes work fine if the Tx blow up. 
I fear this is not the case right now.

So how to accomplish this the best way?
Introduce a new module ‚integration-tests’ with n sub-modules for each use case?
Or rather use the maven-invoker-plugin?

Or is it easily possible to tweak the ServicesManager and swap out a single Service? Don’t think this will work easily when the JBatch runtime is alredy loaded…

Any thoughts?

LieGrue,
strub

Re: how to best test tx integration problems?

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Not sure we even impl/tested it but passing services to batch properties is
an option I d like we support to allow execution to control spi instead of
relying on static config.

Think it would be enough.

That said for internal tests using ServiceManagers directly is enough
normally. A bit like in our test module.
Le 17 janv. 2016 18:00, "Mark Struberg" <st...@yahoo.de> a écrit :

> hi!
>
> referring to BATCHEE-88.
> What I like to do is to create a chunk with a Reader returning Integer
> 1..3 and a Writer which stores it.
> But all that with a TransactionManagerAdapter which I can control to blow
> up with various exceptions ;)
> E.g. simulating what happens if the commit goes boom with a
> javax.transaction.TransactionRolledbackException or
> javax.transaction.TransactionRequiredException.
> Or the same with rollback.
>
> We need to make sure retryable-exception-classes and
> skippable-exception-classes work fine if the Tx blow up.
> I fear this is not the case right now.
>
> So how to accomplish this the best way?
> Introduce a new module ‚integration-tests’ with n sub-modules for each use
> case?
> Or rather use the maven-invoker-plugin?
>
> Or is it easily possible to tweak the ServicesManager and swap out a
> single Service? Don’t think this will work easily when the JBatch runtime
> is alredy loaded…
>
> Any thoughts?
>
> LieGrue,
> strub