You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Valentin Jacquemin <ja...@gmail.com> on 2009/10/22 16:34:37 UTC

Loading hbm files under default hierarchy from test hierarchy

Hi all,
I am building a project architecture and facing an issue with classloading.
Here is my situation:

I have a dbunit test which is testing my business layer which uses
hibernate. I have 2 hibernate.cfg.xml files, one for the application and one
for tests which basically are the same except the db connection settings. My
issue is that my mappings files (*.hbm.xml files) reside in the application
structure and when launching the test lifecycle the classloader doesn't find
them. By the way, if I put my hbm.xml files under test/resources (and thus
adapt my hibernate config which I don't want) it works perfectly. But my
goal is to let those hbm.xml files under the application structure without
touching/copying them for testing purposes.

Can you help me?

Valentin Jacquemin

Re: Loading hbm files under default hierarchy from test hierarchy

Posted by Paul Benedict <pb...@apache.org>.
Are you running your unit tests in Maven? (You can get different
results in Eclipse.) If so, what version of Maven?

On Thu, Oct 22, 2009 at 9:34 AM, Valentin Jacquemin
<ja...@gmail.com> wrote:
> Hi all,
> I am building a project architecture and facing an issue with classloading.
> Here is my situation:
>
> I have a dbunit test which is testing my business layer which uses
> hibernate. I have 2 hibernate.cfg.xml files, one for the application and one
> for tests which basically are the same except the db connection settings. My
> issue is that my mappings files (*.hbm.xml files) reside in the application
> structure and when launching the test lifecycle the classloader doesn't find
> them. By the way, if I put my hbm.xml files under test/resources (and thus
> adapt my hibernate config which I don't want) it works perfectly. But my
> goal is to let those hbm.xml files under the application structure without
> touching/copying them for testing purposes.
>
> Can you help me?
>
> Valentin Jacquemin
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org