ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dubois, Jeff" <jeff.dub...@thomson.com>
Subject Ant not passing System values to JUnit task
Date Tue, 02 Dec 2003 17:05:25 GMT

When doing an Ant build of my project (see attached myBuild.xml script) It
appears that ant is not passing System variables/values when executing the
JUnit task.  I am on Windows using Ant 1.5.3.

For my JUnit test cases to succeed I need a VM/System variable called
"active.level" set to "dev"..  When executing Ant (via a batch file) I pass
in the value of "active.level" via a "-Dactive.level=dev" argument on the
command line.
In my ant script I echo out the value of "active.level" and indeed it is set
to "dev" (see runUnitTest target in attached script).

However, when I run the Unit test, this "active.level" variable is no longer
set.  I verified this by printing out the value of "active.level" in one of
the Java test cases that get run.
    The code I use is:
           System.out.println( "active.level is: " +
System.getProperty("active.level"));     
The corresponding output when run through ant is:
          [junit] active.level is: null
By default are not all System variables supposed to be passed to the JUnit
task? 

Thanks!
    Jeff

 
 <<myBuild.xml>> 


Mime
View raw message