You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by de...@canoo.com on 2006/09/20 10:59:09 UTC
configuration of Junit tests
Hello,
Im pretty new to M2 I must say. Nevertheless I would like to understand how I can do things such as calling a test class with VM arguments.
In our project we have got something similar to M2. The module has got a descriptor in which a user can configure a unit test suite including
arguments for this unit test.
such as:
<component id="foo">
...
<unittest id="bar" classname="com.x.y.z.AllTests" args="-DaKey=aValue -DanotherKey=anotherValue">
</unittest>
</component>
I've seen that the surefire plugin executes all classes with a specific pattern. So I could define the class to be executed easily. But how would I deal with VM arguments.
Does anyone has got a nice way of defining those ?
thanks,
detlef
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: configuration of Junit tests
Posted by Iulian Costan <iu...@gmail.com>.
i think you need systemProperties tag; sample bellow:
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>false</skip>
<systemProperties>
<property>
<name>HOST</name>
<value>${host}</value>
<name>CONTEXT</name>
<value>${project.build.finalName}</value>
<name>PORT</name>
<value>${tomcat.port}</value>
</property>
</systemProperties>
</configuration>
/iulian
On 9/20/06, detlef.brendle@canoo.com <de...@canoo.com> wrote:
>
> Hello,
> Im pretty new to M2 I must say. Nevertheless I would like to understand
> how I can do things such as calling a test class with VM arguments.
> In our project we have got something similar to M2. The module has got a
> descriptor in which a user can configure a unit test suite including
> arguments for this unit test.
> such as:
> <component id="foo">
> ...
> <unittest id="bar" classname="com.x.y.z.AllTests" args="-DaKey=aValue
> -DanotherKey=anotherValue">
> </unittest>
> </component>
>
> I've seen that the surefire plugin executes all classes with a specific
> pattern. So I could define the class to be executed easily. But how would I
> deal with VM arguments.
>
> Does anyone has got a nice way of defining those ?
>
> thanks,
> detlef
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>