It's not so much that I want to read a file (although, eventually, a
file gets read), but my test is testing a method that takes a File
object as a parameter.  And this file is located on a relative path to
the where the script is run.

-----Original Message-----
From: KC Baltz [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 25, 2002 3:02 PM
To: Ant Users List
Subject: Re: ant-Junit question


Why do your tests need to know the current directory?  If it's because
you 
want to read in a file, try using Class.getResource() to read it from a 
location on the classpath.

K.C.

At 12:19 PM 1/25/02, you wrote:
>I have a build.xml file that includes junit targets.  These targets
>produce tests that succeed when the build.xml file is run
>from the the directory in which build.xml is located.  However, when I
>run the same build.xml through an ant task from another
>build.xml in another directory, the tests fail.  The tests fail because
>they think the current directory is the directory from which ant was
>initially launched.  How can I modify my <ant> task in the calling file
>to let it know that the current directory should be that of the
launched
>file?
>
>-----------------------------------------------------------------
>Steve Cohen
>Sr. Software Engineer
>Ignite Sports, Inc.
>4410 N. Ravenswood
>Chicago IL 60640
>(773)-293-4342
>[EMAIL PROTECTED]

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


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

Reply via email to