tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcin Kwapisz" <>
Subject RE: Rollback transactions in unit testing
Date Tue, 30 Sep 2008 18:41:03 GMT
[Marcin Kwapisz] 
I do not understand why you want to rollback committed transaction, especially in unit test.
Even, I do not know how to do it in JEE application. 
Maybe our way will suit you:

1. set drop and create strategy in persistence.xml (property name depends on JPA provider,
we have separate file for unit testing)
2. Start OpenEJB (for example: perform ejb lookup) -> database should be empty now
3. Create initial set of data in tables
4. Run test
5. Shutdown OpenEJB

Now, you can repeat steps 2-5 for another tests

Marcin Kwapisz
Division of Computer Networks
Technical Univeristy of Lodz, Poland

View raw message