Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Passing arguments to Junit classes from ant?

Reply
Thread Tools

Passing arguments to Junit classes from ant?

 
 
Roy Smith
Guest
Posts: n/a
 
      04-30-2004
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.
 
Reply With Quote
 
 
 
 
John C. Bollinger
Guest
Posts: n/a
 
      04-30-2004
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
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
functions and arguments.length; passing unknown number of arguments oldyork90 Javascript 10 09-27-2008 03:05 AM
passing arguments to tcpserver classes Eric Spaulding Python 2 06-14-2007 04:56 AM
Passing Classes as Arguments to Functions of Other Classes crouse@physics.wm.edu Java 7 08-12-2006 02:08 AM
JUnit not accessing user defined classes of digester apka Java 0 07-18-2006 06:58 AM
passing custom classes or stucture as arguments Joe Abou Jaoude ASP .Net Web Services 4 12-14-2005 09:43 AM



Advertisments