Advertisement

05.12.2008 at 01:35PM PDT, ID: 23395881
[x]
Attachment Details

ANT calling JUnit ... how to pass Java some command-line switches?

Asked by DanielWilson in Test / Validation Development Software, Java Programming Language, New to Java Programming

I have an ANT script that invokes JUnit.

I need to pass java "-Xms 512M -Xmx 2048M " when JUnit runs on this particular target.  But how?

I tried the jvm= option below ... no good.  I just got an error about trying to load the jvmwatcher.

Thanks for the help!Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
<target name="testimage" depends="clean,compile" description="Test image rendering">
        <junit printsummary="off" fork="on" dir="." jvm="java -Xms 512M -Xmx 2048M" >
            <sysproperty key="test.pdfbox.util.TextStripper.file" value="${file}"/>
            <classpath>
                <pathelement path="${ant.jar}" />
                <pathelement path="${lucene.jar}" />
                <pathelement path="${lucene-demo.jar}" />
                <pathelement path="${fontbox.jar}" />
                <pathelement path="${jempbox.jar}" />
                <pathelement path="${bcprov.jar}" />
                <pathelement path="${bcmail.jar}" />
                <pathelement path="${jai_codec.jar}" />
                <pathelement path="${jai_core.jar}" />
                <pathelement path="${dest.dir}"/>
                <pathelement path="." />
            </classpath>
            <formatter usefile="false" type="plain" />
            <test name="test.pdfbox.util.TestPDFToImage" />
        </junit>
    </target>
[+][-]05.12.2008 at 03:48PM PDT, ID: 21551106

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Test / Validation Development Software, Java Programming Language, New to Java Programming
Sign Up Now!
Solution Provided By: objects
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.12.2008 at 04:27PM PDT, ID: 21551261

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_EXPERT_20070906