ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Altenburg <altenbu...@businesslogic.com>
Subject RE: passing arguments to JUnit task?
Date Wed, 24 Jul 2002 21:57:37 GMT
You may find the <sysproperty> element to be useful.  It's probably not as
simple as what you're looking for (you'd need to modify your test classes to
get the info from that property), but you don't want to depend on your
classes' main methods in order to run the test anyway.

HTH,

David Altenburg

>-----Original Message-----
>From: Dave Jones [mailto:djones@neteffectllc.com] 
>Sent: Wednesday, July 24, 2002 4:20 PM
>To: Ant Users List
>Subject: passing arguments to JUnit task?
>
>
>Hi,
>Is there a way to pass arguments to tests running in a JRun task?
>
>Background: I have a series of functional and acceptance tests 
>(usually using HTTPUnit) I run against development and staging 
>code. By passing in the server address as a command-line pararm, 
>I can run the same tests against both development and staging.
>
>I'd like to include the tests in a build file used to move code 
>into staging. However, I've been unable to figure out how to pass 
>an argument to the included tests to indicate which server to 
>run against.
>
>Sample JRun task looks like:
>       <junit printsummary="true">
>	<formatter type="xml" usefile="true" />
>          <test name="com.bbyo.test.testProspectAdd" />
>...
>
>Unfortunately, the <test> element does not allow <arg> sub-elements.
>
>I could use a Java task to invoke my tests, but then I lose the 
>ability to use <junitreport> (is this correct?)
>
>I could also write a wrapper around the tests that passes in the 
>arguments and call the wrappers from the build, but then I've 
>just doubled my number of test files.
>
>So, is there a way to pass arguments to tests included in a JRun task?
>
>TIA,
>Dave Jones
>NetEffect
>
>
>--
>To unsubscribe, e-mail:   
><mailto:ant-user->unsubscribe@jakarta.apache.org>
>For 
>additional commands, 
>e-mail: <mailto:ant-user-help@jakarta.apache.org>
>

Mime
View raw message