tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jack Cox <j...@captechventures.com>
Subject Transactions controlled by Unit Tests
Date Tue, 12 Feb 2008 14:22:16 GMT

Is there a way in the 'out-of-container' testing paradigm with openejb for
the unit test method to control the demarcation of transactions?  

Here's the use case:
1) The unit test is doing entity bean testing, calling various methods on
the entity facade to test CRUD operations.
2) The unit test needs to demarcate transactions so that it can insert,
delete, then attempt to retrieve deleted entities.  Of course the last
retrieval should fail because the entity is deleted.  
3) But, JPA has the interesting behavior that deleted entities continue to
be accessible within the deleting transaction.
4) Therefore, the unit test needs to demarcate a transaction around the
delete so that the entity is really removed prior to the last retrieval
test.

So, how can one demarcate transactions within a junit test case?

Thanks,

Jack

-- 
View this message in context: http://www.nabble.com/Transactions-controlled-by-Unit-Tests-tp15434029p15434029.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message