File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Junit Task in Ant

 
Will Myers
Ranch Hand
Posts: 372
Java jQuery Scala
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic