RE: Referencing Files from a Unit Test

2006-06-07 Thread Jason Chaffee
} -Original Message From: Lyndon Washington [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 07, 2006 8:43 PM To: Maven Users List Subject: Re: Referencing Files from a Unit Test Wendy, What I have noticed is that if I go into the sub projects

Re: Referencing Files from a Unit Test

2006-06-07 Thread Wendy Smoak
On 6/7/06, Lyndon Washington <[EMAIL PROTECTED]> wrote: What I have noticed is that if I go into the sub projects directory and run 'mvn test', the relative paths that are in the tests resolve perfectly. When I run the 'mvn test' from the parent project path, then the relative paths cannot be fo

Re: Referencing Files from a Unit Test

2006-06-07 Thread Lyndon Washington
Wendy, What I have noticed is that if I go into the sub projects directory and run 'mvn test', the relative paths that are in the tests resolve perfectly. When I run the 'mvn test' from the parent project path, then the relative paths cannot be found. Will the use of the "basedir" property resol

Re: Referencing Files from a Unit Test

2006-06-07 Thread Jimisola Laursen
+ filename); String absoluteFilename = url.getFile(); Regards, Jimisola -- View this message in context: http://www.nabble.com/Referencing-Files-from-a-Unit-Test-t1737229.html#a4760075 Sent from the Maven - Users forum at

Re: Referencing Files from a Unit Test

2006-06-06 Thread John Casey
FWIW, I have a trick that I use in my unit tests to retrieve java.io.Filereferences to resources like that...the nice thing is that it works both in the IDE and from a Maven build. private File getFile( String resourceName ) { ClassLoader cloader = Thread.currentThread().getContextClassLoader(

Re: Referencing Files from a Unit Test

2006-06-06 Thread Lyndon Washington
Hi Wendy, Thanks for the information. I will try this out since it appears to be what I was looking for. Cheers, -Lyndon- On 6/5/06, Wendy Smoak <[EMAIL PROTECTED]> wrote: On 6/5/06, Lyndon Washington <[EMAIL PROTECTED]> wrote: > I have a unit test that was setup in the old ANT build to loa

Re: Referencing Files from a Unit Test

2006-06-06 Thread Lyndon Washington
looking for: this.getClass().getClassLoader().getResourceAsStream(... http://marc.theaimsgroup.com/?l=turbine-maven-user&m=114917325827653&w=2 - Original Message - From: "Lyndon Washington" <[EMAIL PROTECTED]> To: Sent: Monday, June 05, 2006 8:24 PM Subject:

Re: Referencing Files from a Unit Test

2006-06-05 Thread Wendy Smoak
On 6/5/06, Lyndon Washington <[EMAIL PROTECTED]> wrote: I have a unit test that was setup in the old ANT build to load resources using a relative path. I have put the resource that is being retrieved in the projects 'test/resources/conf' folder. How would I reference the file, where previously

Re: Referencing Files from a Unit Test

2006-06-05 Thread Kieran Brady
Monday, June 05, 2006 8:24 PM Subject: Referencing Files from a Unit Test Hi, I have a unit test that was setup in the old ANT build to load resources using a relative path. I have put the resource that is being retrieved in the projects 'test/resources/conf' folder. How would I refere

Referencing Files from a Unit Test

2006-06-05 Thread Lyndon Washington
Hi, I have a unit test that was setup in the old ANT build to load resources using a relative path. I have put the resource that is being retrieved in the projects 'test/resources/conf' folder. How would I reference the file, where previously I used 'conf/foo.xml'? I guess I was assuming that