ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Jones <>
Subject passing arguments to JUnit task?
Date Wed, 24 Jul 2002 21:20:19 GMT
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?

Dave Jones

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message