tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JimOR <>
Subject Re: Enhancer annoyance
Date Wed, 14 May 2008 15:32:16 GMT

David Blevins wrote:
> One way to verify would be to split your test case into two classes;  
> the TestCase subclass which would do nothing more than setup OpenEJB  
> via the InitialContext and have a test method that delegated to your  
> second class which actually did test.  The idea being the second class  
> which references the entity classes wouldn't get loaded until after  
> the first class has run and setup the dynamic enhancer.
> Let us know if that's the case as we can probably document this kind  
> of OpenJPA specific testing technique.  
> -David

I had the same thought initially and refactored my test classes to extend an
abstract parent with a @BeforeClass annotation that sets my InitialContext. 
Then I setup lazy bean instantiation in a parent @Before method, and moved
all @Entity references inside methods annotated with @Test.

Perhaps the parent test class level @Stateful bean references (which
reference @Entities) are the culprit?  

View this message in context:
Sent from the OpenEJB User mailing list archive at

View raw message