Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 19920 invoked by uid 500); 9 May 2001 20:50:03 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Delivered-To: moderator for ant-user@jakarta.apache.org Received: (qmail 39414 invoked from network); 9 May 2001 13:52:58 -0000 Sender: nwc Message-ID: <3AF94B8B.CE01193B@visionics.com> Date: Wed, 09 May 2001 09:52:11 -0400 From: Nick Christopher Organization: Visionics X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.4.2 i686) X-Accept-Language: en MIME-Version: 1.0 To: ant-user@jakarta.apache.org Subject: Re: Junit task / Resources References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Someone already answered with an explanation... here's how I deal with it. I don't use the junit task. Instead I do: This runs junit in the directiory I want (${test.build.dir}) with the classpath I want. (test.classpath). I don't get all the reporting support the task offers but honestly that stuff seemed too much effort anyway. Bryce Penberthy wrote: > Hello, > > I have a JUnit test that will cause a class to try to load an XML file as > a URL resource. If I run this straight from JUnit with the appropriate > CLASSPATH environment variable set then it works fine. However if I try > to run this within the JUnit task, then the class is unable to find the > XML file. > > Currently javac will output the classes to a build output directory, then > copy all .xml and .properties files over to this structure. When the > JUnit task runs, I figured that I would just add the build output > directory to the classpath there. > > I have a path refid that I am using for the element, and I > have echo'ed it to verify that my build output directory exists > there. It will run the test classes, but somehow never pick up the xml > file. Currently I am not forking the JUnit process. > > One twist that I have found is that if I specify the build output file in > the CLASSPATH environment variable before running Ant, then it works like > a charm. However I am trying to get away from my build.xml file having > dependencies on environment variables.. > > Has anyone run into this problem? Any help would be greatly appreciated. > > Thank you > > Bryce Penberthy