openejb-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gegas <andreas.lc.eriks...@gmail.com>
Subject Re: No Maven2 Best Practices?
Date Thu, 08 May 2008 20:11:16 GMT



Gegas wrote:
> 
> 
> 
> David Blevins wrote:
>> 
>> 
>> On May 8, 2008, at 10:22 AM, Gegas wrote:
>> 
>>>
>>> Hello,
>>>
>>> I really like embedded stuff. I got very excited when I heard  
>>> OpenEJB 3 was
>>> released!
>>>
>>> But, the thing is that I cannot get my unit tests with OpenEJB3 to  
>>> follow
>>> Maven2 best practices.
>>>
>>> The OpenEJB3 requires a ejb-jar.xml to exist in src/main/resources  
>>> to locate
>>> my EJB's and if I'm using entity beans a persistence.xml must exist  
>>> in the
>>> same directory.
>>>
>>> What about the src/test/resources directory which is supposed to be  
>>> used by
>>> testing?
>>>
>>> And what about package and deplotyment for production. If my test
>>> ejb-jar.xml and persistence.xml must be in src/main/resources then how
>>> should I manage the "real" configuration files (those that should  
>>> reside in
>>> src/main/resources).
>>> When I package my ejb-jar it will contain configuration files used for
>>> testing... bad...
>>>
>>> Any thoughts on how to handle this issue?
>> 
>> Hi Andreas,
>> 
>> The intention was that the ejb-jar.xml and persistence.xml we test  
>> would be the one you use in production.  Obviously then it's perfectly  
>> in line with Maven2 best practices.
>> 
>> I had never thought of having a seperate ejb-jar.xml just for testing  
>> purposes, but it's certainly an interesting idea.  Can you elaborate  
>> on what you would do differently in the "test" ejb-jar.xml versus the  
>> "production" ejb-jar.xml?  Some sort of example would be good too.
>> 
>> -David
>> 
>> 
>> 
>> 
>> 
> 
> It's especially the persistence.xml that's my concern.
> 
> 1. The src/main/resources/persistence.xml is mapped to my production data
> source
> 2. The src/test/resources/persistence.xml is mapped to a in-memory
> database (HSQLDB)
> 
> 
> The production ejb-jar.xml might contain security constraints etc. not in
> focus when testing etc.
> 
> What do yoy think? Is it possible to have different persistence.xml?
> 
> Kind regards, Andreas
> 
> 
> 

I'm stupid... of course the persistence.xml in src/main/resources is good
enough for both production and test!!!

Sorry for my stupid mistake :-(

But(!), I still think it would be interesting to be able to split test from
production using the "Maven" best practices.

Kind regards, Andreas
-- 
View this message in context: http://www.nabble.com/No-Maven2-Best-Practices--tp17129308p17135473.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


Mime
View raw message