You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ben Walding <be...@walding.com> on 2004/07/12 15:26:19 UTC

Re: Reactor: tests failing (working dir set to master proj dir no t child proj dir)

Maczka Michal wrote:

>  
>
>>-----Original Message-----
>>From: Omair-Inam Abdul-Matin [mailto:oiinamul@cs.uwaterloo.ca]
>>Sent: Saturday, July 10, 2004 5:39 AM
>>To: users@maven.apache.org
>>Subject: Reactor: tests failing (working dir set to master 
>>proj dir not
>>child proj dir)
>>
>>
>>I'm using JUnit to run some regression tests that need to read in 
>>configuration and data files.  For this it is necessary that 
>>the working 
>>directory be the same as the project directory.  Recently the project 
>>was subdivided into a master project and child subprojects.  
>>Now when I 
>>try to run unit tests by invoking the master build target, the tests 
>>fail because apparently the working directory is the directory of the 
>>master project not the current child project.  I believe this 
>>topic has 
>>been brought up in a previous post but I was not able to find the 
>>solution to the problem.
>>
>>Can someone please nudge me in the correction direction?
>>
>>Omair
>>
>>
>>    
>>
>
>You may also conider using classloader for loading your configuration files:
>
>  
>
Another option is to check the basedir property -> 
System.getProperty("basedir") which is the base of the current project.

I personally prefer the classloader approach, but it's worth knowing 
about both methods.

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