ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacqui Guerrero" <jac...@groxis.com>
Subject JUnit JVM arguments
Date Thu, 15 May 2003 00:33:49 GMT
I am trying to pass a set of JVM arguments that need to run with a junit
test.  I am using an if condition within my <junit> task which checks if the
test class exists in my classpath.  I am doing this by checking if a
property has been set by an <available> task within a different ant target:

If task:
<target name="findtest">
    <available property="test.present" classname="my.test" >
    <classpath>
        ....
    </classpath>
</target>

Junit task:
<target name="runtest" if="test.present" depends="init, findJUnit" >
    <junit fork="on" printsummary="withOutandErr" >
        <test name="my.test" />
        <jvmarg value="-Dmyjvm.arg=somevalue">
        <jvmarg value=-Dmyotherjvm.arg=somevalue">
        ...
</target>

When I run ant against my runtest target, I do not see any of my JVM
arguments passed in - I know this because the test outputs system
properties, which are set using JVM arguments passed in.  It seems to take
the value of the current environment.  My test class uses JFCUnit constructs
and has a static block which starts a GUI program.  Is there a special
handle on running such kinds of tests in ant?

Thanks,
Jacqui

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message