Is there a good way to unit test BMT in EJB 3.x, outside the container. I believe that it would make sense to test transactions right when we are coding it. IMHO it is important to test what we code right from the first possible stage. So, if there is a nice way which is simple and does not take too much time to execute, to test BMT, then it would be really welcome.
At present, I am using an in-memory DB to test my JPAQL in EJB outside the container. I use unitils-DBUnit to inject test data in my DB. So, as the test bed is set, in special scenarios where I need to test the BMT, what should I do?
P.S : I have taken a look into tools like Bitronix, but I am really not sure if it would help my case. I need some tool that is really performance intensive and light so that it does not frustrate the developers – this is unit testing. Kindly give me your inputs on this too. According to you, would such a tool be good for my purpose. If yes, do you also have any examples that I can refer to?
Thanks a lot
For unit testing transactions, there should be a complete transaction manager which is standalone and takes very less time to execute. It should not force deployment of any beans or jars.
Bitronix is working fine and satisfies my purpose. It takes less than a second to execute the tests. So, I do not have to mock my transactions anymore and I can be sure that the transactions work as I expect them to work before my code moves to the Integration testing phase. I have also seen positive responses about Atomikos, but I never tried it. May be I can update this thread when I evaluate Atomikos too.