You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by lanchez <ap...@purpleblade.net> on 2007/03/16 22:07:23 UTC

Pass params from command line to Junit test

How would I run maven to execute all tests (JUnit) in a specific class and
pass params to it on the command line?  I just need to pass a string on the
command line like:

mvn (options to run class) (string)
-- 
View this message in context: http://www.nabble.com/Pass-params-from-command-line-to-Junit-test-tf3416833s177.html#a9522483
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Pass params from command line to Junit test

Posted by lanchez <ap...@purpleblade.net>.
Thanks.  I want to pass it on the command line and have setUp
fetch it.  Do you have an example of this?

thanks

L


Tony Ambrozie wrote:
> 
> You may want to have a look at maven-surefire-plugin:
> http://maven.apache.org/plugins/maven-surefire-plugin/index.html
> 
> You can also pass the desired string as a system property in the cmd line,
> and your test class can retrieve it in setUp.
> 
> 
> On 3/16/07, lanchez <ap...@purpleblade.net> wrote:
>>
>>
>> How would I run maven to execute all tests (JUnit) in a specific class
>> and
>> pass params to it on the command line?  I just need to pass a string on
>> the
>> command line like:
>>
>> mvn (options to run class) (string)
>> --
>> View this message in context:
>> http://www.nabble.com/Pass-params-from-command-line-to-Junit-test-tf3416833s177.html#a9522483
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Pass-params-from-command-line-to-Junit-test-tf3416833s177.html#a9718426
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Pass params from command line to Junit test

Posted by Tony Ambrozie <to...@gmail.com>.
You may want to have a look at maven-surefire-plugin:
http://maven.apache.org/plugins/maven-surefire-plugin/index.html

You can also pass the desired string as a system property in the cmd line,
and your test class can retrieve it in setUp.


On 3/16/07, lanchez <ap...@purpleblade.net> wrote:
>
>
> How would I run maven to execute all tests (JUnit) in a specific class and
> pass params to it on the command line?  I just need to pass a string on
> the
> command line like:
>
> mvn (options to run class) (string)
> --
> View this message in context:
> http://www.nabble.com/Pass-params-from-command-line-to-Junit-test-tf3416833s177.html#a9522483
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>