You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Audley <ch...@gmail.com> on 2010/10/05 16:10:23 UTC

Running tests with dynamic file sets

I'm writing a POM for a project that needs to run unit tests in two
groups, one with forkMode "once" and the other with forkMode "always".
 I understand how to configure two separate executions of the surefire
plugin in the <build> section with separate <configuration> blocks.
The problem I have is that the files to be run by each execution can't
be defined by file patterns in <includes> and <excludes> elements.

Our current ant based build system uses annotations included in the
test sources to create two filesets, a junit task is then used to run
each of the filesets separately.  I know I can use ant within maven to
create these filesets.  Is there a way I can feed these filesets into
the surefire plugin?

Is it better to just forego the surefire plugin and run my unit tests
using an ant based mojo?

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


Re: Running tests with dynamic file sets

Posted by Justin Edelson <ju...@gmail.com>.
On 10/5/10 10:10 AM, Chris Audley wrote:
> I'm writing a POM for a project that needs to run unit tests in two
> groups, one with forkMode "once" and the other with forkMode "always".
>  I understand how to configure two separate executions of the surefire
> plugin in the <build> section with separate <configuration> blocks.
> The problem I have is that the files to be run by each execution can't
> be defined by file patterns in <includes> and <excludes> elements.
> 
> Our current ant based build system uses annotations included in the
> test sources to create two filesets, a junit task is then used to run
> each of the filesets separately.  I know I can use ant within maven to
> create these filesets.  Is there a way I can feed these filesets into
> the surefire plugin?

Not as such. Surefire supports this for TestNG groups. You could
probably also do something similar with JUnit test suites, but that
wouldn't be exactly the same workflow as you have now.

> 
> Is it better to just forego the surefire plugin and run my unit tests
> using an ant based mojo?

I think you'd be better off using TestNG groups if they meet your needs.

Justin


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