Passing arguments to Junit classes from ant?

Discussion in 'Java' started by Roy Smith, Apr 30, 2004.

  1. Roy Smith

    Roy Smith Guest

    I'm using Junit under ant. Some of my test cases need to read files
    which contain test data. I don't mind imbedding the file names in the
    test cases, but I'd like to have the name of the directory where the
    data files are stored parameterized in the build.xml file.

    What's the best was to pass information like that from build.xml down
    into the test cases? I was sort of under the impression that ant
    properties showed up as Java properties accessable via
    System.getProperty(), but they don't seem to.
    Roy Smith, Apr 30, 2004
    #1
    1. Advertising

  2. Roy Smith wrote:

    > I'm using Junit under ant. Some of my test cases need to read files
    > which contain test data. I don't mind imbedding the file names in the
    > test cases, but I'd like to have the name of the directory where the
    > data files are stored parameterized in the build.xml file.
    >
    > What's the best was to pass information like that from build.xml down
    > into the test cases? I was sort of under the impression that ant
    > properties showed up as Java properties accessable via
    > System.getProperty(), but they don't seem to.


    Specify system properties explicitly by passing "-Dname-value" as a
    <jvmarg> when you spawn JUnit.


    John Bollinger
    John C. Bollinger, Apr 30, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Koenning
    Replies:
    0
    Views:
    1,442
    Tom Koenning
    Jul 28, 2003
  2. Scout
    Replies:
    0
    Views:
    520
    Scout
    Aug 4, 2003
  3. sri
    Replies:
    0
    Views:
    424
  4. Replies:
    7
    Views:
    556
    Alex Hunsley
    Aug 12, 2006
  5. jimgardener
    Replies:
    1
    Views:
    5,322
    Donkey Hottie
    Oct 20, 2008
Loading...

Share This Page