File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Junit Task in Ant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Junit Task in Ant" Watch "Junit Task in Ant" New topic

Junit Task in Ant

Will Myers
Ranch Hand

Joined: Aug 05, 2009
Posts: 370

I'm trying to run some Junit tests with Ant that require a properties file to run (to pick up database info, etc) however the forked JVM doesn't pick up the file, am I doing something stupid? The tests that do not require this file run fine and running the tests in Eclipse is also ok...

Peter Johnson

Joined: May 14, 2008
Posts: 5852

It looks like you are passing in the properties file as an system property name, which will make it hard to look up. I would have expected to see something like this instead (replace 'configfile' with the proprty name your app uses to look up the file):

As an aside, it would be better to place your config file in the classpath and look it up from there - then you don't have to give the app the exact location.

JBoss In Action
I agree. Here's the link:
subject: Junit Task in Ant
jQuery in Action, 3rd edition