Well, this just keeps getting stranger all the time. The ant script is invoked with dir set to the directory in which the "called" build.xml is located. junit is invoked within this "called" script with fork set to "yes". No dir is defined for junit, which, I would think would cause it default to using basedir which should be the directory specified by the "dir" attribute in the ant call. And yet, it doesn't work that way. It acts as though the current directory is the current directory of the "calling" build.xml.
-----Original Message----- From: Diane Holt [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 3:43 PM To: Ant Users List Subject: RE: ant-Junit question See the 'dir' attribute in the "Parameters" table of the Ant task description in the doc. Diane --- Steve Cohen <[EMAIL PROTECTED]> wrote: > 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]> > ===== ([EMAIL PROTECTED]) __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- 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]>
