I think this is what you're 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: <users@maven.apache.org>
Sent: 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 reference the file,
where previously I used 'conf/foo.xml'?

I guess I was assuming that there would be a system propery that I could
use.  Another snippet of info is that this project is part of a large pom
heirarchy, so the test could be run from the parent or from the actual
project location.

Thanks for any help someone can provide.

Cheers,
-Lyndon-

--

-----------------------------------------
Lyndon Washington
-----------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to