You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Allen, Daniel" <Da...@kbcfp.com> on 2008/04/22 22:07:56 UTC

Running some tests but not others according to a -D property?

Does anyone know if it's possible to have Surefire run some tests but
not others, deciding based on a setting from the command line? My
situation is that some tests are working with Tibco Rendezvous, and the
daemon isn't always available. It would be nice to include
"-Dskip.rv.tests=true" on the command line and run all the tests except
those that would fail because RV is offline.

Thanks for any advice.
~Dan Allen

-- 
This message may contain confidential, proprietary, or legally privileged information. No confidentiality or privilege is waived by any transmission to an unintended recipient. If you are not an intended recipient, please notify the sender and delete this message immediately. Any views expressed in this message are those of the sender, not those of any entity within the KBC Financial Products group of companies (together referred to as "KBC FP"). 

This message does not create any obligation, contractual or otherwise, on the part of KBC FP. It is not an offer (or solicitation of an offer) of, or a recommendation to buy or sell, any financial product. Any prices or other values included in this message are indicative only, and do not necessarily represent current market prices, prices at which KBC FP would enter into a transaction, or prices at which similar transactions may be carried on KBC FP's own books. The information contained in this message is provided "as is", without representations or warranties, express or implied, of any kind. Past performance is not indicative of future returns.


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


Re: Running some tests but not others according to a -D property?

Posted by "David C. Hicks" <dh...@i-hicks.org>.
We had a similar problem that we solved using a profile. We have a 
default test name pattern ("_FT") that designates a test as a 
functional/integration test. We include a plugin entry for 
maven-surefire-plugin that runs on the integration-test phase and 
includes files with that pattern. If we want to ignore those tests, we 
use the profile to set the pattern to something ridiculous that would 
never match. All the integration tests of that pattern are then skipped.

Here are some snippets:

<properties>
<ft_patterns>_*FT</ft_patterns>
</properties>

<profile>
<id>no_fts</id>
<activation>
<activeByDefault/>
</activation>
<properties>
<ft_patterns>_XXFTXX</ft_patterns>
</properties>
</profile>

<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<executions>
<execution>
<id>itest</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>false</skip>
<includes>
<include>**/*${ft_patterns}.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>


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