Hi Keiran,

That works if my tests took Streams, but I was looking for a less intrusive
way of retrieving java.io.File(s), much like my existing tests in my ANT
build does today.

Thanks again.

-Lyndon-

On 6/5/06, Kieran Brady <[EMAIL PROTECTED]> wrote:

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-

Reply via email to