-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Multiple Path problem with NUnit
PostPosted: Tue Jul 21, 2009 4:32 pm 
Newbie

Joined: Tue Jul 21, 2009 4:14 pm
Posts: 1
Hi, I'm trying to give NHibernate a try with a little demo app, but I'm running into a slight problem with NUnit.

I have an app split into 3 assemblies, each with a corresponding test assembly. One of these assemblies uses NHibernate, and has a hibernate.cfg.xml with the basic config info in. The app runs fine, and if I run each test project individually, they work a treat. The problem happens when I try to put all of my test assemblies in an NUnit project and run them together - all of the tests in the one that uses NHibernate now get an error like this:

ContactsDataAccess.Tests.NHibernateHelper_Fixtures.NHibernateHelper_OpenSession_CreatesSession:
NHibernate.Cfg.HibernateConfigException : An exception occurred during configuration of persistence layer.
----> System.IO.DirectoryNotFoundException : Could not find a part of the path 'E:\Programming\NHibernate\ContactsPrototype1\ContactsDomain.Tests\bin\Debug;ContactsClient.Tests\bin\Debug;ContactsDataAccess.Tests\bin\Debug\hibernate.cfg.xml'.

Notice that the path it's looking for kind of has each of the three assembly paths in there. Anyone seen this before or know how to get round it?

I'm using .Net 3.5, NUnit 2.4.8 via the NUnit test runner, and I think NHibernate 2.1.0.Beta1.

Thanks,
Grant


Top
 Profile  
 
 Post subject: Re: Multiple Path problem with NUnit
PostPosted: Mon Aug 17, 2009 11:56 am 
Newbie

Joined: Mon Aug 17, 2009 9:59 am
Posts: 1
I had a similar issue when not specifying the hibernate.cfg.xml

To fix it, this non-working block:
Code:
var cfg = new Configuration();
            cfg.Configure();


was changed to:
Code:
var cfg = new Configuration();
            cfg.Configure("hibernate.cfg.xml");


That worked for me, and I was able to continue.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.