aspose file tools
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

Win a copy of The Software Craftsman this week in the Agile forum!
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: 343

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: 5850

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
Have you tried LearnNowOnline?
subject: Junit Task in Ant